-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 @babel/runtime as a dependency to @wordpress/components #8057
Conversation
1db2ab6
to
6735aad
Compare
6735aad
to
78ec603
Compare
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.
Yeah, it wasn’t clear how we should approach it. It seems like the best way to go. I think we should do it for every package which transpiles code 😃
agreed! that will also fix #7936 |
@gziolo Does Lerna bump the package version, or would you like me to update it in |
I can make PRs for the other packages too, I wanted to see what folks thought first 👍 |
No, Lerna takes care of it when doing publishing. It also creates git tags and temporary replaces all locally scoped packages with the proper published version in the dependencies list. Isn’t it sweet? 😃 |
👍 Thanks for the reviews! |
That would be ace, I would be able to publish updates tomorrow morning. |
@gziolo At least anything using It looks like we're currently shipping polyfills in the packages. We may not want to do that long term. We're polluting the global prototypes for anything that uses these packages and polyfillng even in cases where the polyfill isn't needed. Other projects (React, Draft, ...) are now stating what needs to be polyfilled up front and leaving it up to the client. That might be an approach to take? |
Honestly speaking, we are learning the process ourselves. If you have exact recommendations on how to setup all that let us know. Excluding all the packages which aren't transpiled we ship 2 versions using the following Babel config:
The fact that we include import statements for both polyfills and Babel runtime comes from the new /cc @youknowriad |
Clients won't generally ever want to consume es.next, it's just too difficult given current tooling. Some will want es5 wrapped in commonJS ( Whether or not you have polyfills in the es5 code is a separate issue. Libraries should not ship polyfills that affect the global scope. Instead you should use babel's |
@blowery do you mind opening up a new issue so folks can discuss transformation options for packages? It's a good discussion to have and I'm afraid your comment will be lost on this PR. |
We use We also add |
Currently we publish a bundle that refers to
@babel/runtime
but does not require it as an explicit dependency inpackage.json
. To not confuse consumers of this package, let's declare this dependency!