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

Fix node.js v14 support #672

Merged
merged 4 commits into from
Oct 31, 2023
Merged

Fix node.js v14 support #672

merged 4 commits into from
Oct 31, 2023

Conversation

bertschneider
Copy link
Contributor

@bertschneider bertschneider commented Oct 24, 2023

Replace two functions introduced in v16 to still support v14. Supporting this old version is probably a big stretch in the JavaScript ecosystem, though.

To verify ECMAScript compatibility the TypeScript target version is now set to ES2020 as that is mostly supported by node.js v14. This only catches invalid ECMAScript features, and would have done so in case of the two fixed usages, but not unsupported node.js APIs.

Sadly, available eslint plugins verifying correct node.js API version usage seem quite out of date.

Closes #641

@bertschneider bertschneider requested a review from a team October 24, 2023 13:46
@br-lewis
Copy link
Contributor

br-lewis commented Oct 24, 2023

I know the ticket says otherwise but if we can add tests for 14 relatively simply, I think we should so we don't get any more surprises as long we want to support 14. I think it would only require adding a test matrix in run-all-tests.yaml

@bertschneider bertschneider changed the title Support node v14 Fix node v14 support Oct 25, 2023
@bertschneider bertschneider changed the title Fix node v14 support Fix node.js v14 support Oct 25, 2023
@bertschneider
Copy link
Contributor Author

I looked into verifying correct node.js and ECMAScript usage via an eslint plugin, but the ones I found are quite out of date. Setting the TypeScript target version to ES2020 seems like an easy solution to verify correct ECMAScript usage, and would have caught the problem.

This table has a nice overview of ECMAScript versions and their node.js support. Using ES2020 should be fine for now.

@bertschneider bertschneider force-pushed the FUZZ-816_support_v14 branch 3 times, most recently from 7d7eff2 to ed4bbb1 Compare October 25, 2023 07:49
@bertschneider
Copy link
Contributor Author

In the last commit I tried to execute the examples with v14, but that does not seem to work, as npm 7 is required to support workspaces during build time. npm can not distinguish between build and runtime engine versions.

npm 7 is included in node.js v15. Using that version for the examples should work, but is it worth the hassle? WDYT?

@oetr
Copy link
Contributor

oetr commented Oct 25, 2023

Would it make sense to only add some end-to-end tests for all but one node version (say v18, or v16)? 50m to test one node version, x4 = about 4 hours. With one flaky test, and we will need several days to merge a PR.

Can the e2e tests use Jazzer.js built by a different node version?

@bertschneider bertschneider force-pushed the FUZZ-816_support_v14 branch 6 times, most recently from bffbdee to 9e9941f Compare October 25, 2023 12:20
@bertschneider
Copy link
Contributor Author

As discussed, tests and examples are now executed with all LTS versions on Linux and the end-to-end tests also with v14.

@bertschneider bertschneider force-pushed the FUZZ-816_support_v14 branch 2 times, most recently from a71eb90 to dd2e8e9 Compare October 25, 2023 12:57
Copy link
Contributor

@br-lewis br-lewis left a comment

Choose a reason for hiding this comment

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

I think the readme would be a good spot to mention our node version support. I would be inclined to say it should go towards the bottom since it isn't immediately relevant when you're trying to figure out what the project is and does. We do have architecture support at the very top so it makes sense to have it there though maybe we should move that further down as well.

package.json Show resolved Hide resolved
@bertschneider
Copy link
Contributor Author

Moved the supported architecture section further down and added a remark about supported Node.js versions.

Replace two functions introduced in v16 to still support v14. Supporting this
old version is probably a big stretch in the JavaScript ecosystem, though.

To verify ECMAScript compatibility the TypeScript target version is now set to
ES2020 as that is mostly supported by node.js v14. This only catches invalid
ECMAScript features, and would have done so in case of the two fixed usages, but
not unsupported node.js APIs.

Sadly, available eslint plugins verifying correct node.js API version usage seem
quite out of date.
Copy link
Contributor

@oetr oetr left a comment

Choose a reason for hiding this comment

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

LGTM!

@bertschneider bertschneider merged commit a317ab5 into main Oct 31, 2023
16 checks passed
@bertschneider bertschneider deleted the FUZZ-816_support_v14 branch October 31, 2023 14:38
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.

Issues running jazzer in node v14
3 participants