-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Babel 7 #23966
Babel 7 #23966
Conversation
"js-compile-plugins": "babel --no-babelrc js/src/ --out-dir js/dist/ --source-maps --presets=es2015 --plugins=transform-es2015-modules-strip", | ||
"js-compile-standalone": "ROLLUP=true rollup --environment BUNDLE:false --config build/rollup.config.js", | ||
"js-compile-bundle": "ROLLUP=true rollup --environment BUNDLE:true --config build/rollup.config.js", | ||
"js-compile-plugins": "PLUGINS=true babel js/src/ --out-dir js/dist/ --source-maps", |
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 don't want to do it this way (or use https://www.npmjs.com/package/cross-env), don't think we support a --environment flag
but we could think about 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.
I don't understand that change, --no-babelrc
is it deprecated ?
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.
no it's because there isn't a way to pass options to a preset via cli, so it wouldn't use loose mode
I wonder if we should tweak the options to use for example single quotes. And maybe switch to |
Yeah I kept them in to explain the changes, can be removed later.
I made the individual files use the same config (loose) so that is already done.
This we just defaulted to quotes and removed the options since it's just the output and not source code. |
I'm aware it's the output. Too bad there is no option since I personally am
used to single quotes everywhere.
Anyway not a big deal I guess.
…On Sep 16, 2017 23:31, "Henry Zhu" ***@***.***> wrote:
One thing, you shouldn't include the dist files in your PR.
Yeah I kept them in to explain the changes, can be removed later.
And maybe switch to loose for concatenating strings.
I made the individual files use the same config (loose) so that is already
done.
should tweak the options to use for example single quotes.
This we just defaulted to quotes and removed the options since it's just
the output and not source code.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23966 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAVVtWtzMgW4aHR0UHSAK5KXUUqoCxbbks5sjDAKgaJpZM4PZ68t>
.
|
Yeah I hope not 😛, I just picked one - babel/babel#5139 |
Thanks for your PR @hzoo, I thought about doing that change but you were quicker than me 😄 Just remove changes in our dist files and we will merge your PR 👍 |
Ok removed the dist, js/dist changes |
Sorry but they are warning in Travis see : https://travis-ci.org/twbs/bootstrap/jobs/276359245#L618 |
Hm good catch, didn't think that was needed so I removed in rollup.config.js |
Ok I see a change we can make to loose mode for static getters https://babeljs.io/repl/build/master#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAECCIFMBOAXaBvAUNaEVhQEthoBzBNANQFEAlAZQEkB5AOQAoBKDbHaJCgFckAO2g0GLVrwC-mGUA&debug=false&circleciRepo=&evaluate=false&lineWrap=true&presets=es2015-loose&prettier=false&targets=&version=7.0.0-beta.0 which we can fix later. I also excluded typeof transform so that helper can be dropped. I assume bootstrap doesn't use |
Thanks @hzoo 👍 |
👋 Bootstrap team! Making a PR to change to v7 if desired! (instead of by
accident via #22727, hopefully we can fix that kind of dependency issue soon)
Diff
New
loose
option for classes removes a bunch of helper checks, so they won't be in the bundle/files anymore, so a smaller output. Via Remove ClassCallCheck, possibleConstructorReturn in loose mode babel/babel#4850rm
'classCallCheck', 'inherits', 'possibleConstructorReturn'
add
inheritsLoose
"
double quotes now via Hardcode to double quotes, indent to 2 spaces babel/babel#5824tokens
from the AST anymore, so it may look different but it should compile faster (faster parse/print) via Remove whitespace generation babel/babel#5833+
, can useloose
to go back to+
via default to spec mode for template literal transform babel/babel#6098