-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update babel.github.io babili plugin docs #1029
Merged
xtuc
merged 1 commit into
babel:master
from
geordidearns:update-babili-plugin-readme-files
Dec 5, 2016
Merged
Changes from all commits
Commits
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 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify constant folding | ||
description: Tries to evaluate expressions and inline the result. For now only deals with numbers and strings | ||
permalink: /docs/plugins/minify-constant-folding/ | ||
package: babel-plugin-minify-constant-folding | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify dead code elimination | ||
description: Inlines bindings when possible. Tries to evaluate expressions and prunes unreachable as a result | ||
permalink: /docs/plugins/minify-dead-code-elimination/ | ||
package: babel-plugin-minify-dead-code-elimination | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify empty function | ||
description: This is mostly a Facebook-specific transform that removes noop function calls. However, can be generalized to detect and remove noops | ||
permalink: /docs/plugins/minify-empty-function/ | ||
package: babel-plugin-minify-empty-function | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify flip comparisons | ||
description: While this plugin doesn’t shorten the output in any way, it does optimize it for repetition-based compression algorithms such as gzip | ||
permalink: /docs/plugins/minify-flip-comparisons/ | ||
package: babel-plugin-minify-flip-comparisons | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify guarded expressions | ||
description: | ||
permalink: /docs/plugins/minify-guarded-expressions/ | ||
package: babel-plugin-minify-guarded-expressions | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify infinity | ||
description: | ||
permalink: /docs/plugins/minify-infinity/ | ||
package: babel-plugin-minify-infinity | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify mangle names | ||
description: Context - and scope - aware variable renaming | ||
permalink: /docs/plugins/minify-mangle-names/ | ||
package: babel-plugin-minify-mangle-names | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify numeric literals | ||
description: Shortening of numeric literals via scientific notation | ||
permalink: /docs/plugins/minify-numeric-literals/ | ||
package: babel-plugin-minify-numeric-literals | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify replace | ||
description: Configurable "search and replace" plugin. Replaces matching nodes in the tree with a given replacement node | ||
permalink: /docs/plugins/minify-replace/ | ||
package: babel-plugin-minify-replace | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify simplify | ||
description: This plugin will transform code in mainly two ways - 1) Reduce as much statements as possible into expressions, and 2) Make expressions as uniform as possible for better compressibility | ||
permalink: /docs/plugins/minify-simplify/ | ||
package: babel-plugin-minify-simplify | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} | ||
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Minify type constructors | ||
description: Not recommended if full support for IE8 and lower is required | ||
permalink: /docs/plugins/minify-type-constructors/ | ||
package: babel-plugin-minify-type-constructors | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Inline consecutive adds transform | ||
description: This plugin inlines consecutive property assignments, array pushes, etc | ||
permalink: /docs/plugins/transform-inline-consecutive-adds/ | ||
package: babel-plugin-transform-inline-consecutive-adds | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -1,55 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Inline environment variables transform | ||
description: | ||
description: Inline environment variables | ||
permalink: /docs/plugins/transform-inline-environment-variables/ | ||
package: babel-plugin-transform-inline-environment-variables | ||
--- | ||
|
||
This plugin allows Babel to transform inlines environment variables. | ||
|
||
## Example | ||
|
||
For example compiling the following file: | ||
|
||
**script.js** | ||
|
||
```javascript | ||
if (process.env.NODE_ENV === "development") { | ||
development(); | ||
} else { | ||
production(); | ||
} | ||
``` | ||
|
||
with the command: | ||
|
||
```sh | ||
$ NODE_ENV=development babel --plugins transform-inline-environment-variables script.js | ||
``` | ||
|
||
outputs: | ||
|
||
```javascript | ||
if ("development" === "development") { | ||
development(); | ||
} else { | ||
production(); | ||
} | ||
``` | ||
|
||
## Installation | ||
|
||
```sh | ||
$ npm install --save-dev babel-plugin-transform-inline-environment-variables | ||
``` | ||
|
||
## Usage | ||
|
||
Add the following line to your `.babelrc` file: | ||
|
||
```json | ||
{ | ||
"plugins": ["transform-inline-environment-variables"] | ||
} | ||
``` | ||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -1,39 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Member expression literals transform | ||
description: | ||
description: Turn valid member expression property literals into plain identifiers | ||
permalink: /docs/plugins/transform-member-expression-literals/ | ||
package: babel-plugin-transform-member-expression-literals | ||
--- | ||
|
||
This plugin allows Babel to transform member expression valid identifier literal properties into identifiers. | ||
|
||
## Example | ||
|
||
**In** | ||
|
||
```javascript | ||
foo["bar"]; | ||
``` | ||
|
||
**Out** | ||
|
||
```javascript | ||
foo.bar; | ||
``` | ||
|
||
## Installation | ||
|
||
```sh | ||
$ npm install --save-dev babel-plugin-transform-member-expression-literals | ||
``` | ||
|
||
## Usage | ||
|
||
Add the following line to your `.babelrc` file: | ||
|
||
```json | ||
{ | ||
"plugins": ["transform-member-expression-literals"] | ||
} | ||
``` | ||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -1,41 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Merge sibling variables transform | ||
description: | ||
description: Merge sibling variables into one | ||
permalink: /docs/plugins/transform-merge-sibling-variables/ | ||
package: babel-plugin-transform-merge-sibling-variables | ||
--- | ||
|
||
This plugin allows Babel to merge sibling variable declarations. | ||
|
||
## Example | ||
|
||
**In** | ||
|
||
```javascript | ||
var foo = "bar"; | ||
var bar = "foo"; | ||
``` | ||
|
||
**Out** | ||
|
||
```javascript | ||
var foo = "bar", | ||
bar = "foo"; | ||
``` | ||
|
||
## Installation | ||
|
||
```sh | ||
$ npm install --save-dev babel-plugin-transform-merge-sibling-variables | ||
``` | ||
|
||
## Usage | ||
|
||
Add the following line to your `.babelrc` file: | ||
|
||
```json | ||
{ | ||
"plugins": ["transform-merge-sibling-variables"] | ||
} | ||
``` | ||
{% include package_readme.html from="babili" %} |
This file contains 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 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 |
---|---|---|
@@ -1,46 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: NODE_ENV inline transform | ||
description: | ||
description: Inline the NODE_ENV environment variable and if it's a part of a binary expression | ||
permalink: /docs/plugins/transform-node-env-inline/ | ||
package: babel-plugin-transform-node-env-inline | ||
--- | ||
|
||
Inline the `NODE_ENV` environment variable and if it's a part of a binary expression | ||
(eg. `process.env.NODE_ENV === "development"`) then statically evaluate and replace it. | ||
|
||
## Example | ||
|
||
**In** | ||
|
||
```javascript | ||
process.env.NODE_ENV === "development"; | ||
process.env.NODE_ENV === "production"; | ||
``` | ||
|
||
**Out** | ||
|
||
```sh | ||
$ NODE_ENV=development babel in.js --plugins transform-node-env-inline | ||
``` | ||
|
||
```javascript | ||
true; | ||
false; | ||
``` | ||
|
||
## Installation | ||
|
||
```sh | ||
$ npm install --save-dev babel-plugin-transform-node-env-inline | ||
``` | ||
|
||
## Usage | ||
|
||
Add the following line to your `.babelrc` file: | ||
|
||
```json | ||
{ | ||
"plugins": ["transform-node-env-inline"] | ||
} | ||
``` | ||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -1,43 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Property literals transform | ||
description: | ||
description: This plugin allows Babel to transform valid identifier property key literals into identifiers | ||
permalink: /docs/plugins/transform-property-literals/ | ||
package: babel-plugin-transform-property-literals | ||
--- | ||
|
||
This plugin allows Babel to transform valid identifier property key literals into identifiers. | ||
|
||
## Example | ||
|
||
**In** | ||
|
||
```javascript | ||
var foo = { | ||
"bar": function () {} | ||
}; | ||
``` | ||
|
||
**Out** | ||
|
||
```javascript | ||
var foo = { | ||
bar: function () {} | ||
}; | ||
``` | ||
|
||
## Installation | ||
|
||
```sh | ||
$ npm install --save-dev babel-plugin-transform-property-literals | ||
``` | ||
|
||
## Usage | ||
|
||
Add the following line to your `.babelrc` file: | ||
|
||
```json | ||
{ | ||
"plugins": ["transform-property-literals"] | ||
} | ||
``` | ||
{% include package_readme.html from="babili" %} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: docs | ||
title: Regexp constructors transform | ||
description: This changes RegExp constructors into literals if the RegExp arguments are strings | ||
permalink: /docs/plugins/transform-regexp-constructors/ | ||
package: babel-plugin-transform-regexp-constructors | ||
--- | ||
|
||
{% include package_readme.html from="babili" %} |
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.
I'm not sure why this happens, the README seems good: https://github.com/babel/babili/blob/master/packages/babel-plugin-minify-simplify/README.md
/cc @existentialism
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.
Need to add an extra line between the text and the code block, since markdownify behaves differently than GH flavored markdown.
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.
I will make the changes now. Thanks
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.
Sorry @existentialism Is this where the actual documentation is, not on this change?
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.
Ok, I will change it.
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.
Thanks @xtuc
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.
@xtuc pushed a quick fix: babel/minify#320