-
-
Notifications
You must be signed in to change notification settings - Fork 219
The rename #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
The rename #654
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,8 @@ | |
|
|
||
| ### Setup | ||
| ```sh | ||
| $ git clone https://github.com/babel/babili | ||
| $ cd babili | ||
| $ git clone https://github.com/babel/minify | ||
| $ cd minify | ||
| $ npm install | ||
| $ npm run bootstrap | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aside: this should be |
||
| ``` | ||
|
|
@@ -71,7 +71,7 @@ npm test | |
| To run tests for a specific package, | ||
|
|
||
| ```sh | ||
| npm test packages/babel-preset-babili | ||
| npm test packages/babel-preset-minify | ||
| ``` | ||
|
|
||
| #### Smoke Tests | ||
|
|
@@ -119,27 +119,27 @@ node smoke/run.js -ib lodash | |
|
|
||
| #### Benchmarks | ||
|
|
||
| [benchmark.js](https://github.com/babel/babili/blob/master/scripts/benchmark.js) compares Babili with [Uglify](https://github.com/mishoo/UglifyJS2), [Closure Compiler](https://github.com/google/closure-compiler) and [Closure Compiler JS](https://github.com/google/closure-compiler-js) | ||
| [benchmark.js](https://github.com/babel/minify/blob/master/scripts/benchmark.js) compares BabelMinify with [Uglify](https://github.com/mishoo/UglifyJS2), [Closure Compiler](https://github.com/google/closure-compiler) and [Closure Compiler JS](https://github.com/google/closure-compiler-js) | ||
|
|
||
| ```sh | ||
| ./scripts/benchmark.js [file...] | ||
| ``` | ||
|
|
||
| [plugin-timing.js](https://github.com/babel/babili/blob/master/scripts/plugin-timing.js) is used to calculate and compare the time spent in each plugin. | ||
| [plugin-timing.js](https://github.com/babel/minify/blob/master/scripts/plugin-timing.js) is used to calculate and compare the time spent in each plugin. | ||
|
|
||
| ```sh | ||
| ./scripts/plugin-timing.js file.js | ||
| ``` | ||
|
|
||
| [plugin-contribution.js](https://github.com/babel/babili/blob/master/scripts/plugin-contribution.js) calculates how much each plugin of babili contributes to size reduction. | ||
| [plugin-contribution.js](https://github.com/babel/minify/blob/master/scripts/plugin-contribution.js) calculates how much each plugin of babel-minify contributes to size reduction. | ||
|
|
||
| ```sh | ||
| ./scripts/plugin-contribution.js file.js | ||
| ``` | ||
|
|
||
| ### Debugging | ||
|
|
||
| In your project, if you find that there is a bug that appears ONLY when you use Babili, it's most likely that there is a bug in Babili and you should definitely report it. Here are some guidelines that might help you drill down the issue. If it doesn't help you, you can of course create a minimal repro project with the bug and report it. | ||
| In your project, if you find that there is a bug that appears ONLY when you use BabelMinify, it's most likely that there is a bug in BabelMinify and you should definitely report it. Here are some guidelines that might help you drill down the issue. If it doesn't help you, you can of course create a minimal repro project with the bug and report it. | ||
|
|
||
| #### Compile time Errors | ||
|
|
||
|
|
@@ -156,13 +156,13 @@ If the syntax error occurs at runtime, it likely means the code generator ([bab | |
| When you run your minified code in the browser, | ||
|
|
||
| 1. If there is an error in the console, as a first step, look around the code block where the error happens, and the code block of a few steps up in the stack. | ||
| 2. Try to predict what caused the error and try relating it to some of the plugin names in the [packages/](https://github.com/babel/babili/tree/master/packages) directory. The major ones (that do a lot of transformations) are - mangle, deadcode-elimination and simplify. | ||
| 3. Every plugin that Babili uses has an option in preset to toggle it on/off - [preset-options](https://github.com/babel/babili/tree/master/packages/babel-preset-babili#options) | ||
| 2. Try to predict what caused the error and try relating it to some of the plugin names in the [packages/](https://github.com/babel/minify/tree/master/packages) directory. The major ones (that do a lot of transformations) are - mangle, deadcode-elimination and simplify. | ||
| 3. Every plugin that Babel-Minify uses has an option in preset to toggle it on/off - [preset-options](https://github.com/babel/minify/tree/master/packages/babel-preset-minify#options) | ||
| 4. Disable any transformation(s) that you suspect are causing problems. Turning OFF mangling (`mangle: false`) is a good practice if you don't think it's related to a mangling bug, since unmangled variable names will make debugging easier. | ||
| 5. Sometimes it might NOT be a bug with one plugin but a combination of plugins. Again, `deadcode-elimination` and `simplify` maybe good candidates to start with here as they perform many transformations. | ||
| 6. Sometimes it might because of the [unsafe transformations](https://github.com/babel/babili/tree/master/packages/babel-preset-babili#option-groups). Some of them are grouped into a single option named `unsafe`. This option can help you identify it sooner if the bug is in one these plugins. | ||
| 6. Sometimes it might because of the [unsafe transformations](https://github.com/babel/minify/tree/master/packages/babel-preset-minify#option-groups). Some of them are grouped into a single option named `unsafe`. This option can help you identify it sooner if the bug is in one these plugins. | ||
| 7. Produce a minimal repro of the same issue - the function block containing the bug should be enough to help reproduce the bug. | ||
| 8. [Report it 🙂](https://github.com/babel/babili/issues/new) | ||
| 8. [Report it 🙂](https://github.com/babel/minify/issues/new) | ||
| 9. You're awesome. Thanks! | ||
|
|
||
| ### Releasing | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should be
git clone https://github.com/babel/minify babel-minify? and need to change below too