Skip to content
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

Merged
merged 2 commits into from Dec 2, 2016

Conversation

raspo
Copy link
Contributor

@raspo raspo commented Dec 2, 2016

Q A
Doc PR Yes

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

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
@codecov-io
Copy link

codecov-io commented Dec 2, 2016

Current coverage is 89.22% (diff: 100%)

Merging #4931 into master will not change coverage

@@             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          

Powered by Codecov. Last update 81575bc...4451341

> 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)
Copy link
Member

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).
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Member

@existentialism existentialism left a 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
Copy link
Member

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.
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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?

Copy link
Member

@hzoo hzoo Dec 2, 2016

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

Copy link
Member

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?)

@hzoo hzoo added the PR: Docs 📝 A type of pull request used for our changelog categories label Dec 2, 2016
@hzoo
Copy link
Member

hzoo commented Dec 2, 2016

Thanks for the PR @raspo!

@raspo
Copy link
Contributor Author

raspo commented Dec 2, 2016

You are welcome @hzoo

I have been wanting to contribute in some way, thank @existentialism for bringing that issue to my attention 😄

@hzoo
Copy link
Member

hzoo commented Dec 2, 2016

I think just change https://www.npmjs.com/package/babel-runtime to the website link instead and we are good to go

@existentialism existentialism merged commit 27e201e into babel:master Dec 2, 2016
@raspo raspo deleted the movereadme branch December 2, 2016 23:11
panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Docs 📝 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants