-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Baseline Acorn plugins #3478
Comments
Yes. In the past this was not a problem as acorn was usually quick to support stage 4. I guess we need to take this into our own hands now... PR welcome. |
I would make it neither opt-in nor opt-out. I do not see any issues for people not using these features, and options always have their own maintenance fee. |
This would basically also add some stage-3 features. Not sure about that. |
I'd be glad to add them, but currently don't know how to. I just tried to configure https://github.com/acornjs/acorn-class-fields and https://www.npmjs.com/package/acorn-static-class-features but both throw due to being for the v6 version of Acorn. Maybe @adrianheine might have suggestions here. Yes not all stage3 is necessary, but I think there's a sort of user-consensus that can be found on what to include. |
Well, I think THAT is the reason why they are not part of acorn yet... |
First step: acornjs/acorn-class-fields#8 Next problem is that Acorn is required as a peer dependencies in these libraries - another argument for building this stuff into rollup. |
True, a "correct" fix would require a rework of these plugins to use the acorn instance that is passed in instead of requiring it, and that would still not solve the issue of the plugin-interdependency. |
Looks like progress is being made here. |
I'd like to propose that RollupJS provide support-by-default for a baseline set of Acorn plugins matching the ~stage 4 support.
Since any new syntax feature needs Rollup support from an analysis perspective anyway, it seems like it would improve safety in providing a fully supported baseline.
Acorn plugins can be a pain to use due to the indirect plugin injection system, version mismatch issues and conventions and lack of support and maintenance from the Acorn ecosystem. Acorn has been historically over-conservative, and will continue to be so this would help users a lot to simply provide this support out of the box.
For example, static class fields is almost impossible to set up currently despite being a feature shipping in Chrome - it should always be possible to ship JS from Rollup that Chrome supports!
Feature Proposal
The proposal is to include by default numeric separators and static class fields for now, even though Acorn core doesn't ship with these by default. Then to update this list to match what is shipping in browsers.
This feature could be opt-in or opt-out to use only full ECMA-262 stability.
The text was updated successfully, but these errors were encountered: