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 plugins READMEs from babel.github.io [skip ci] #4931
Conversation
see babel/website#997 - babel-plugin-transform-class-properties - babel-plugin-transform-decorators - babel-plugin-transform-do-expressions - babel-plugin-transform-es3-member-expression-literals - babel-plugin-transform-es3-property-literals - babel-plugin-transform-es5-property-mutators - babel-plugin-transform-eval - babel-plugin-transform-exponentiation-operator - babel-plugin-transform-export-extensions - babel-plugin-transform-flow-comments - babel-plugin-transform-flow-strip-types - babel-plugin-transform-function-bind - babel-plugin-transform-jscript - babel-plugin-transform-object-set-prototype-of-to-assign - babel-plugin-transform-proto-to-assign - babel-plugin-transform-runtime - babel-plugin-transform-strict-mode - babel-plugin-undeclared-variables-check
Current coverage is 89.22% (diff: 100%)@@ master #4931 diff @@
==========================================
Files 204 204
Lines 10487 10487
Methods 1153 1153
Messages 0 0
Branches 2759 2759
==========================================
Hits 9357 9357
Misses 1130 1130
Partials 0 0
|
> Turn flow type annotations into comments. | ||
> | ||
> You should be able to use this plugin instead of `babel-plugin-flow-strip-types` to preserve the `/* @flow */` directive and still use flow. | ||
> [Flow Comments Blog Post](http://flowtype.org/blog/2015/02/20/Flow-Comments.html) |
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.
On the website, package descriptions are removed. They need to be on one single line.
Could you maybe split the comment into two parts ? Thanks.
Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals. | ||
> Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals. (This plugin is recommended in a library/tool) | ||
> | ||
> NOTE: Instance methods such as `"foobar".includes("foo")` will not work since that would require modification of existing builtins (Use [`babel-polyfill`](/docs/usage/polyfill) for that). |
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.
Also here.
already. | ||
|
||
> This plugin places a `"use strict";` directive at the top of all files to enable [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode). | ||
> | ||
> This plugin may be enabled via `babel-plugin-transform-es2015-modules-commonjs`. | ||
> If you wish to disable it you can either turn `strict` off or pass | ||
> `strictMode: false` as an option to the commonjs transform. |
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.
Same here.
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.
Just a few comments, but nice work T! Glad I could coerce you into contributing :)
@@ -1,16 +1,46 @@ | |||
# babel-plugin-transform-class-properties | |||
|
|||
> This plugin transforms es2015 static class properties as well as |
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.
As @xtuc mentioned, due to the way we parse these we need the descriptions on a single line.
|
||
Another purpose of this transformer is to create a sandboxed environment for your code. If you use [babel-polyfill](https://babeljs.io/docs/usage/polyfill/) and the built-ins it provides such as `Promise`, `Set` and `Map`, those will pollute the global scope. While this might be ok for an app or a command line tool, it becomes a problem if your code is a library which you intend to publish for others to use or if you can't exactly control the environment in which your code will run. | ||
Another purpose of this transformer is to create a sandboxed environment for your code. If you use [babel-polyfill](/docs/usage/polyfill/) and the built-ins it provides such as `Promise`, `Set` and `Map`, those will pollute the global scope. While this might be ok for an app or a command line tool, it becomes a problem if your code is a library which you intend to publish for others to use or if you can't exactly control the environment in which your code will run. |
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 think we want to keep the absolute link (for babel-polyfill) here since they might be referring to the README via npm or GitHub.
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.
Good catch. I totally missed that one.
After a quick search a found a few more broken relative links to /docs
and /repl
.
It is also recommended you install the `babel-runtime` package as a | ||
runtime dependency, if you haven't already, as the transformed code will | ||
require that package. See the examples below for more details. | ||
It is also recommended you install the [babel-runtime](https://www.npmjs.com/package/babel-runtime) package as a runtime dependency, if you haven't already, as the transformed code will require that package. See the examples below for more details. |
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.
Should we link to our own babel-runtime
docs instead of npm?
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.
the package is preferred yeah, either works
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.
Hmm now that I think about it, we don't actually have a page for babel-runtime
, so we can probably update this later (worth adding to babel/website#1021?)
Thanks for the PR @raspo! |
You are welcome @hzoo I have been wanting to contribute in some way, thank @existentialism for bringing that issue to my attention 😄 |
I think just change https://www.npmjs.com/package/babel-runtime to the website link instead and we are good to go |
see babel/website#997