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

Upgrade to Node 20.12.2 #54

Merged
merged 7 commits into from
Jul 26, 2024
Merged

Upgrade to Node 20.12.2 #54

merged 7 commits into from
Jul 26, 2024

Conversation

joshuacurtiss
Copy link
Contributor

@joshuacurtiss joshuacurtiss commented Jun 23, 2024

In addition to upgrading the project to Node 20.12.2, including its GitHub Actions job, we also made these adjustments:

When regenerating the package-lock.json file, browserslist made updates that cause Babel processing to allow const in the transformed output. (This is because the latest browser data eliminates safari 9.1 from browserslist with our settings, and Babel thus decided to keep const in its output.) As a result, uglification was throwing errors:

Warning: Uglification failed.
Unexpected token: keyword (const).

Upgrading grunt-contrib-uglify to v4.0.1 resolves the uglification error, but we use the latest v5.2.2 as a consistent version across projects.

It was also noted that the uglification settings were set to mangle/compress in debug mode and beautify in production mode. Presumably, this was intended to be the reverse.

@coveralls
Copy link

Coverage Status

coverage: 5.618%. remained the same
when pulling a843f02 on joshuacurtiss:jcurtiss/upgrade-node-20.12.2
into 0697579 on silvermine:master.

@Timodie
Copy link

Timodie commented Jun 23, 2024

Will we need to bump up the version number as part of the node upgrade?
I noticed that the version bump followed the node upgrade in some of the other projects

@onebytegone
Copy link
Contributor

Will we need to bump up the version number as part of the node upgrade? I noticed that the version bump followed the node upgrade in some of the other projects

@Timodie Yes, once this PR is merged and if no additional changes are needed, we'll cut a new version of this package. We don't typically have a version bump in the same PR as other changes.

@joshuacurtiss
Copy link
Contributor Author

I updated the PR description (after a closer before/after examination of the browserslist output after regenerating the package-lock.json) to explain that const being passed through Babel's output is due to browserslist removing safari 9.1, which only has partial support for const.

I was unsure if this change in Babel output would be acceptable, but if according to caniuse/browserslist/babel it is safe to use const when Safari 9.1 is eliminated, then our new built artifacts containing const should be alright, given that our current desired Safari support is iOS Safari 12.2.

CC: @kmuncie

@coveralls
Copy link

coveralls commented Jul 18, 2024

Coverage Status

coverage: 5.618%. remained the same
when pulling 1c024a6 on joshuacurtiss:jcurtiss/upgrade-node-20.12.2
into 0697579 on silvermine:master.

@joshuacurtiss
Copy link
Contributor Author

@onebytegone, would you mind giving me your thoughts on 80d826e? Namely:

  • Incorporating the .nvmrc version into the test matrix
  • Using git status --porcelain to check for uncommitted changes

I'm just checking that this particular approach is what you had in mind for accomplishing these two goals in GitHub Actions jobs.

@joshuacurtiss
Copy link
Contributor Author

  • Using git status --porcelain to check for uncommitted changes

Come to think of it, there's a case for saying that the "uncommitted changes" step should be last in the build job, in the unlikely event that even standards checks or other tests have compromised code..

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
The CI steps need to be updated to use Node 20. While doing so, we
incorporate some additional work:

- Update all actions to use the latest versions that run on Node 20
- Update the test matrix to use our .nvmrc file as one of the Node
  versions to test against
- Check for uncommitted changes after installing dependencies
The grunt-contrib-uglify@3.0.1 package would break because Babel no
longer removes `const` based on our configurations and how they interact
with the latest browserslist output.

However, grunt-contrib-uglify@4.0.1 or later does not break when it sees
`const`. So, we can update to the latest version, 5.2.2.
Uglify was configured to mangle/compress in debug mode and beautify in
production mode. This should be reversed.
@joshuacurtiss
Copy link
Contributor Author

@onebytegone Ok, made all suggested changes..

Note I also moved the "uncommitted changes" check as the last step of the build job, since it makes more sense to be last.

Also note... to serve as an example, it makes sense to add npm run build. However, this particular repo has a prepublish script which runs a build. Since prepublish runs on npm install, the project is technically already built with the npm ci command. Just wanted to point that out before we proceed!

@onebytegone onebytegone merged commit dbf8f7d into silvermine:master Jul 26, 2024
11 checks passed
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.

4 participants