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

Add /*#__PURE__*/ annotatiotion for babel-plugin-async-to-generator #6803

Merged
merged 2 commits into from Nov 13, 2017

Conversation

@satya164
Copy link
Contributor

satya164 commented Nov 12, 2017

Q                       A
Fixed Issues? Fixes #6572
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR NA
Any Dependency Changes? Yes
License MIT

This adds the /*#__PURE__*/ annotation before the IIFE generated by async to generator plugin so that uglify can perform DCE if it's not used. Tested and verified that uglify does remove the code.

@satya164

This comment has been minimized.

Copy link
Contributor Author

satya164 commented Nov 12, 2017

Excited for my first contribution to Babel. Thanks a lot @xtuc for helping me with this ❤️

Copy link
Member

xtuc left a comment

Thanks for your PR. cc @Andarist

It seems that there's some tests that need to be regenerated.

@@ -6,6 +6,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.0.0-beta.31",

This comment has been minimized.

Copy link
@xtuc

xtuc Nov 12, 2017

Member

The version can be fixed here because lerna will handle the upgrades.

@@ -1,4 +1,5 @@
class Class {
/*#__PURE__*/

This comment has been minimized.

Copy link
@xtuc

xtuc Nov 12, 2017

Member

I'm not sure about this one 🤔

@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Nov 12, 2017

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/5784/

@satya164 satya164 changed the title Add pure annotatiotion for in babel-plugin-async-to-generator Add /*#__PURE__*/ annotatiotion for babel-plugin-async-to-generator Nov 12, 2017
@@ -6,6 +6,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-annotate-as-pure": "7.0.0-beta.31",

This comment has been minimized.

Copy link
@Andarist

Andarist Nov 12, 2017

Member

probably this need an update, beta.32 is released

@xtuc

This comment has been minimized.

Copy link
Member

xtuc commented Nov 13, 2017

cc @kzc FYI and if it looks ok to you?

@xtuc
xtuc approved these changes Nov 13, 2017
@xtuc

This comment has been minimized.

Copy link
Member

xtuc commented Nov 13, 2017

Awesome contribution @satya164, thanks!

@xtuc xtuc merged commit 82a4919 into babel:master Nov 13, 2017
4 checks passed
4 checks passed
babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 87.35% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@satya164 satya164 deleted the satya164:async-to-generator-pure branch Nov 13, 2017
@lock lock bot added the outdated label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.