Skip to content
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 acorn and increase default ecmaVersion #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gudahtt
Copy link

@Gudahtt Gudahtt commented Oct 22, 2021

acorn has been updated to v8.5, and acorn-walk has been updated to v8.2. These versions include many new bug fixes and features, including the features currently being added by this package using plugins. These features are supported by acorn only when ecmaVersion is set to "2022", so the default ecmaVersion has been set to 2022.

Since the plugins are no longer needed, they have been removed, along with all related build steps and documentation.

`acorn` has been updated to v8.5, and `acorn-walk` has been updated to
v8.2. These versions include many new bug fixes and features, including
the features currently being added by this package using plugins. These
features are supported by `acorn` only when `ecmaVersion` is set to
"2022", so the default `ecmaVersion` has been set to `2022`.

Since the plugins are no longer needed, they have been removed, along
with all related build steps and documentation.
@@ -17,7 +17,7 @@ test('parses object spread syntax', function (t) {

test('does not change main acorn module', function (t) {
t.throws(function () {
baseAcorn.parse('var a = 10n')
baseAcorn.parse('#!/usr/bin/env node\nconsole.log("ok")', { ecmaVersion: 2021 })
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was updated to use a hashbang as an example of something the main acorn module would not support by default.

acorn requires that ecmaVersion is set (as of v8), so that had to be included.

@@ -27,6 +27,5 @@ build/Release
node_modules
package-lock.json

lib/*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't seem necessary to ignore this directory, since it's not used anymore. It was only used for the plugins.

@Gudahtt
Copy link
Author

Gudahtt commented Oct 22, 2021

This is a pretty substantial change, since arguably bringing these plugins in was the main purpose of this package. If they're not needed anymore, why use this package at all, v.s. using acorn directly? But the idea of setting sane defaults still has some merit.

It is unfortunate that the default ecmaVersion had to change though, which could be considered a breaking change. I could try updating acorn without changing ecmaVersion, and keeping the plugins around for supporting those features. Let me know if you'd prefer that.

@staltz
Copy link

staltz commented Feb 7, 2023

@goto-bus-stop Is this library not maintained anymore? I volunteer to maintain it, since it's a core dependency in https://github.com/staltz/noderify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants