-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Update: add initial support for ES2018 #348
Conversation
Is it not too early to enable es2018 yet? Seems like a bunch more proposals should make it into final spec. |
I think we can still expose the option with the currently-available proposals, and add more features as necessary. This is the same thing that we did with the es2017 option last year. |
👎 This goes against the way we have handled ES updates. We haven't, and I'd argue shouldn't, be implementing any new ecmaVersion value until the spec is locked down. Doing otherwise means that we will constantly be introducing breaking changes anytime there's a change in the spec. Our position has always been that we support the latest ratified version of ES only, and that for anything experimental you will need to use Babel. I'd like to see us continue on that path. |
I'm confused -- isn't this the same thing we've been doing before? We added support for async functions and trailing function commas last September, but ES2017 was officially locked down only a few months ago. I thought our position was to support stage 4 features, not wait for the yearly release schedule. |
Yes, I believe we are supporting stage 4 syntax. Template literal revisions are stage 4 syntax of ES2018, so I think we should support it. |
@not-an-aardvark I think the difference between what you and @nzakas is saying is "ratified" vs. "locked down". ES2017 was ratified just a few weeks ago, however, it was locked down in February (as in, no TC39 meetings between February and ratification date, so nothing can change at that point). ES2018 is pretty far from being locked down right now, so I really think it would make sense to wait a little, at least until closer to the end of the year. |
@nzakas @ilyavolodin So, I have believed we are supporting stage 4 syntax, but it's wrong? At least, we immediately accepted async/await when it had become stage 4. |
It was July. Now is July as well. |
The thing we have always tried to avoid is the race to implement new ES features so we can avoid getting on the same hamster wheel that Babel is on. That's a very difficult path that takes a lot of work, as people barrage you with "it's stage 4 now, when will you support it?" I think the ES2017 implementation was probably earlier than we should have done it. I know there was a lot of pressure to get async functions in and we (I) probably didn't feel like fighting any longer. I do think we need a better strategy going forward. ES changes are not guaranteed to be 100% backwards compatible, and as such, if we start implementing ecmaVersion: 2018 piece by piece, we are effectively creating a breaking change each time (for both Espree and ESLint, we will be changing the meaning of ecmaVersion: 2018). I realize our policy on how we add new features is ill-defined right now, so we should probably formalize it. My preference would be something like:
(As Ilya pointed out, that happens months before ratification.) Again, I'd rather let Babel-ESLint be the bleeding edge parser and keep Espree as a more stable one. |
Thank you for the explanation.
I don't think so.
|
I'm imaging our semver policy, I think that the support of new syntaxes should reduce errors. |
TSC Summary: This PR adds an TSC Question: Should we add this now, or should we wait until ES2018 is locked down next year? |
In the 2017-07-20 TSC meeting, we decided to accept new features once they reach stage 4. |
(Builds on #347, look at that first)This adds support for
ecmaVersion: 2018
(orecmaVersion: 9
). Currently, the only stage 4 proposal in ES2018 is the template literal revision, which Acorn now supports in 5.1.0.