-
Notifications
You must be signed in to change notification settings - Fork 227
Please don’t publish experimental syntax on npm #107
Comments
To be clear, it's totally possible with Babel to keep the import/export in the bundle (if you consider it worth the Node compatibility issues until |
I think that would be a great first step! But my understanding is that you still want to provide a source version so I'd love to learn why. If it's just for better tree shaking with e.g. webpack, then you could provide a version with |
In particular, my concern is that publishing the source code (even as an optional other entry point) will encourage people to use it (e.g. because they think it will make their app smaller) and cause issues for the ecosystem when it starts switching to incompatible tooling. For example, even Babel 6 and Babel 7 handle class properties differently by default. And the spec isn't even finalized yet. |
Yes that was our initial thought. I'll bring this to the team in the morning so that we're all on the same page to reach a consensus. But my thinking right now is at the very least updating the npm entry points for the packages. |
Thanks! I'm always happy to chat about this, feel free to ping me anytime. I care about this because I've seen people burned by this multiple times (e.g. Babel 5 -> Babel 6 transition, RN upgrades), and unfortunately the people who suffer the most are usually beginners who just followed a tutorial and can't fix anything in a third-party package. Your fast response is very much appreciated! |
Happy to chat as well (slack/hangouts) if you need to talk through something too (I help maintain Babel). |
Thanks both for your input and support. <3 OS community. I opened PR #108, which should default to ES5 transpiled React Components. |
Hi, I help maintain React and some other projects like Create React App. 👋
I recently saw in this issue (facebook/create-react-app#4648 (comment)) that this project uses experimental syntax (such as class properties) as part of the npm entry point.
I strongly encourage you to reconsider this decision. If the class properties transform ends up changing (which is very likely) or abandoned (not as likely, but could happen), having uncompiled packages on npm using it will create a huge amount of churn for everyone (including maintainers of this project). Not to mention this makes the project unusable in any environment that respects the spec (such as Node.js).
Please compile any experimental syntax away before publishing. If you’re convinced that keeping
import
uncompiled is worth it (which is a whole separate can of worms as you can see in graphql/graphql-js#1248), please compile at least the non-standard syntax away when publishing. That includes JSX too.I understand this might seem like an inconvenience now. But it will be much better to do now than deal with pain for months when build tools and the spec changes. Thanks.
The text was updated successfully, but these errors were encountered: