Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove ClassCallCheck, possibleConstructorReturn in loose mode #4850
@@ Coverage Diff @@ ## 7.0 #4850 +/- ## ========================================== + Coverage 85.21% 85.21% +<.01% ========================================== Files 284 284 Lines 9958 9966 +8 Branches 2780 2785 +5 ========================================== + Hits 8486 8493 +7 Misses 971 971 - Partials 501 502 +1
@DrewML huge fringe benefit of doing that would be that the
Perhaps another option is a
Babel 5 docs on loose mode were:
I kind of interpret that as "generate the minimal amount of changes to make the code work, and ignore edge-cases where someone could do something bad"
It be breaking for anything that is relying on calling constructors to throw (for whatever reason, I can't think of a good one, maybe some over-testing?). It's just the preset though and I would guess as you said, those are not the people running in loose mode. Also since loose was only added in 6.13 (?) it seems like it'd be not quite as widely used yet.
I would like for Babel to generate code that is as close to ES6 compliant as possible under normal circumstances, then use loose mode to drop every line of code that is not strictly necessary to make stuff just work. It means in loose mode you can do stuff that is against spec... But probably you will dev in strict mode and catch such uses there. Once it's in production, use loose mode for max. performance.
Having a single toggle on the preset would be infinitely more valuable than having to control each plugin separately.
changed the title from
Remove ClassCallCheck in loose mode
Jun 9, 2017
Jun 26, 2017
This was referenced
Jun 29, 2017
I could some better docs for this (or a utility to make it easy) but yeah you can just overwrite your node_modules? Like literally replace the 2 files that we changed. You can probably just run the src/index.js through babeljs.io/repl and then replace the lib/index.js in node_modules and add that helper to test it