chore(react): use babel runtime on es builds#9833
Conversation
|
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: b02bb9d 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/61771b99b6b7ea00075ecac6 😎 Browse the preview: https://deploy-preview-9833--carbon-react-next.netlify.app |
|
DCO Assistant Lite bot All contributors have signed the DCO. |
|
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: b02bb9d 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/61771b99b6ea0500083d04de 😎 Browse the preview: https://deploy-preview-9833--carbon-components-react.netlify.app/ |
|
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: b02bb9d 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/61771b99b626b90007ac8821 😎 Browse the preview: https://deploy-preview-9833--carbon-elements.netlify.app |
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
|
@salvoravida Thanks for doing this! I think we'll also need to include |
It is already included by babel. not needed. |
|
@salvoravida I think it will need to be included based on: https://babeljs.io/docs/en/babel-plugin-transform-runtime#technical-details Not everyone will be using babel directly, e.g. some could be using Rollup or esbuild so we can't transitively depend don't this through Let me know if I'm misunderstanding, I think the number one thing was just making sure that if a file gets transpiled to import |
Yes, I have added "@babel/runtime": "^7.14.6", as dependencies (is the one already downloaded by other dep, so it will not be duplicated) TL;DR @babel/runtime share all the ES5 polyfill without duplication for each file! |
tay1orjones
left a comment
There was a problem hiding this comment.
Sorry - actually needs a yarn to update the lockfile. I'll pull this down and do it.
tay1orjones
left a comment
There was a problem hiding this comment.
Done 👍 LGTM if status checks pass
|
@salvoravida just wanted to ask, could this be something that works for CommonJS builds as well? I noticed that this one was only targeting ESM 👀 |
sure! done! |
chore(react): use babel runtime on es builds
Hi guys!
This PR adds @babel/runtime on es builds. -> less 60/100k on your bundle.js depended on how many components are used.