Please don’t publish experimental syntax on npm
See original GitHub issueHi, I help maintain React and some other projects like Create React App. 👋
I recently saw in this issue (https://github.com/facebook/create-react-app/issues/4648#issuecomment-398540069) 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 https://github.com/graphql/graphql-js/issues/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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:8 (3 by maintainers)
Top GitHub Comments
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.
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
import
/export
(but still no experimental syntax) instead.