-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Externalize babel helpers using @babel/runtime #402
Externalize babel helpers using @babel/runtime #402
Conversation
Codecov Report
@@ Coverage Diff @@
## master #402 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 10 10
Lines 207 207
Branches 61 61
=====================================
Hits 207 207 Continue to review full report at Codecov.
|
.babelrc.js
Outdated
@@ -16,6 +16,7 @@ module.exports = { | |||
], | |||
plugins: [ | |||
'@babel/plugin-transform-flow-strip-types', | |||
'@babel/plugin-transform-runtime', |
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.
could you remove it from .babelrc.js
and add it like this: https://github.com/final-form/react-final-form/pull/351/files#diff-ff6e5f22a9c7e66987b19c0199636480R86 ?
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.
@Andarist Fixed ✅
@erikras friendly 🏓 |
Fixed merge conflict, all checks pass |
Published in |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
tl,dr:
This reduces the ES module size from
27545
to26852
bytes (~2.5%) by externalizing babel runtime helper functions.Many people are using these helper functions elsewhere. By externalizing them, folks can take advantage of only including a single copy (as opposed to the additional copy that was inlined by
react-final-form
).It appears this was the original intent of the repository since
@babel/runtime
is already a production dependency.Details
react-final-form.es.js goes from something like this:
to this:
Related
final-form/react-final-form-arrays#60