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

build: update node to v22.13.1 #28368

Merged
merged 3 commits into from
Jan 24, 2025
Merged

build: update node to v22.13.1 #28368

merged 3 commits into from
Jan 24, 2025

Conversation

HowardBraham
Copy link
Contributor

@HowardBraham HowardBraham commented Nov 7, 2024

Description

Node LTS just moved to 22, let's start using it.

Keeping this as-is in package.json for now:
"node": ">= 20",

Was previously blocked by 101arrowz/fflate#227
Just merged this and now it's unblocked #29177

Open in GitHub Codespaces

@HowardBraham HowardBraham requested review from kumavis and a team as code owners November 7, 2024 20:45
Copy link
Contributor

github-actions bot commented Nov 7, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-tiger Tiger team (for tech debt reduction + performance improvements) label Nov 7, 2024
@HowardBraham HowardBraham self-assigned this Nov 7, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [48d757f]
Page Load Metrics (1833 ± 77 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16142270183416378
domContentLoaded16002184181015675
load16132250183316177
domInteractive137347178
backgroundConnect874282010
firstReactRender48169982411
getState45514157
initialActions01000
loadScripts11251641132613665
setupStore65414168
uiStartup18002468203417886
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [b0dcd1e]
Page Load Metrics (1613 ± 38 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1501190016398340
domContentLoaded1490181315927235
load1503188316137938
domInteractive178748209
backgroundConnect76623168
firstReactRender4610287168
getState45512147
initialActions00000
loadScripts1078137311666732
setupStore647994
uiStartup1684209117839244
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@@ -3,13 +3,13 @@ version: 2.1
executors:
node-browsers-small:
docker:
- image: cimg/node:20.17-browsers
- image: cimg/node:current-browsers
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use current. Tests must always be as deterministic as possible.

@metamaskbot
Copy link
Collaborator

Builds ready [14d098e]
Page Load Metrics (1940 ± 53 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17892253194211153
domContentLoaded17362234191811153
load17872255194011053
domInteractive18105582311
backgroundConnect97629178
firstReactRender492901126833
getState580272613
initialActions01000
loadScripts1252169413879847
setupStore65114147
uiStartup19902638219918388
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham marked this pull request as draft November 8, 2024 20:53
auto-merge was automatically disabled November 8, 2024 20:53

Pull request was converted to draft

@HowardBraham
Copy link
Contributor Author

@davidmurdoch in development/webpack/utils/plugins/ManifestPlugin/index.ts, are we supposed to be using AsyncZipDeflate or ZipDeflate? Because I think AsyncZipDeflate is what's hanging in Node 22.

@davidmurdoch
Copy link
Contributor

@davidmurdoch in development/webpack/utils/plugins/ManifestPlugin/index.ts, are we supposed to be using AsyncZipDeflate or ZipDeflate? Because I think AsyncZipDeflate is what's hanging in Node 22.

It uses AsyncZipDeflate, as this allows it to compress many files on many Workers simultaneously (utilizing all of the machine's available threads/cores), rather than blocking on the main thread.

from the docs:

there is an asynchronous version of every method as well. [...] this will cause the compression or decompression run in a separate thread entirely and automatically by using [...] Workers. This means that the processing will not block the main thread at all.

I benchmarked this on my local machine when I implemented it and it measurably was faster to use AsyncZipDeflate, despite the overhead of starting up the workers.

@metamaskbot
Copy link
Collaborator

Builds ready [5fb6104]
Page Load Metrics (1689 ± 76 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint47019621552380183
domContentLoaded14162132167116177
load14242140168915976
domInteractive248043188
backgroundConnect75321147
firstReactRender1599482813
getState45414168
initialActions01000
loadScripts10301683122414972
setupStore685172010
uiStartup16632501198419795
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2024
…t8Array`s before zipping (#29177)

Use a copy of the Buffer via `Buffer.from(asset)`, as Zip will *consume*
it, which breaks things if we are compiling for multiple browsers at
once. `Buffer.from` uses the internal pool, so it's superior to `new
Uint8Array` if we don't need to pass it off to a worker thread.

Additionally, in Node.js 22+ a Buffer marked as "Untransferable" (like
ours) can't be passed to a worker, which `AsyncZipDeflate` uses. See:
101arrowz/fflate#227 (comment)

This can probably be simplified to `zipFile.push(Buffer.from(asset),
true);` if the above issue is resolved.

This fix should hopefully unblock
#28368


<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.


## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29177?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**


### **Before**


### **After**


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

-->
@HowardBraham HowardBraham marked this pull request as ready for review December 16, 2024 18:13
@HowardBraham HowardBraham requested review from a team as code owners December 16, 2024 18:13
@HowardBraham HowardBraham changed the base branch from main to prep-deps-and-self-hosted December 16, 2024 18:16
danjm pushed a commit that referenced this pull request Dec 18, 2024
…t8Array`s before zipping (#29177)

Use a copy of the Buffer via `Buffer.from(asset)`, as Zip will *consume*
it, which breaks things if we are compiling for multiple browsers at
once. `Buffer.from` uses the internal pool, so it's superior to `new
Uint8Array` if we don't need to pass it off to a worker thread.

Additionally, in Node.js 22+ a Buffer marked as "Untransferable" (like
ours) can't be passed to a worker, which `AsyncZipDeflate` uses. See:
101arrowz/fflate#227 (comment)

This can probably be simplified to `zipFile.push(Buffer.from(asset),
true);` if the above issue is resolved.

This fix should hopefully unblock
#28368


<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.


## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29177?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**


### **Before**


### **After**


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

-->
Copy link

socket-security bot commented Dec 18, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@tsconfig/[email protected] None 0 2.36 kB typescript-deploys

🚮 Removed packages: npm/@tsconfig/[email protected]

View full report↗︎

@HowardBraham
Copy link
Contributor Author

I think this PR should also update @tsconfig/node20 to @tsconfig/node22 (needs to be updated in depcheck as well). Also the readme references Node v20 (Install [Node.js](https://nodejs.org) version 20).

@davidmurdoch good call, done

@metamaskbot
Copy link
Collaborator

Builds ready [613236d]
Page Load Metrics (1607 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint50419221534283136
domContentLoaded13331921158417082
load13401950160717685
domInteractive23124392612
backgroundConnect95723157
firstReactRender156631199
getState46416178
initialActions01000
loadScripts9461415117513264
setupStore671202110
uiStartup15242241183020397
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

davidmurdoch
davidmurdoch previously approved these changes Dec 19, 2024
@HowardBraham HowardBraham added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Dec 20, 2024
@HowardBraham HowardBraham force-pushed the node-22.11 branch 2 times, most recently from e3ba505 to 0dfb518 Compare January 10, 2025 00:42
@metamaskbot
Copy link
Collaborator

Builds ready [0dfb518]
Page Load Metrics (1916 ± 132 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32424921710501240
domContentLoaded153925461881266128
load154525571916274132
domInteractive26183614120
backgroundConnect899332311
firstReactRender1699502512
getState56424199
initialActions01000
loadScripts115120311437224108
setupStore6171031
uiStartup180428902226317152
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham changed the title build: update node to v22.12 build: update node to v22.13.1 Jan 24, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [e82784b]
Page Load Metrics (1700 ± 49 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32819501558402193
domContentLoaded15071933167610148
load15191944170010149
domInteractive2391422010
backgroundConnect775272110
firstReactRender16100502613
getState415831
initialActions00000
loadScripts1053143012278842
setupStore68314199
uiStartup17572397197815072
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@HowardBraham HowardBraham added this pull request to the merge queue Jan 24, 2025
Merged via the queue into main with commit fad926a Jan 24, 2025
70 checks passed
@HowardBraham HowardBraham deleted the node-22.11 branch January 24, 2025 20:55
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2025
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jan 24, 2025
@metamaskbot metamaskbot added the release-12.12.0 Issue or pull request that will be included in release 12.12.0 label Jan 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.12.0 Issue or pull request that will be included in release 12.12.0 team-tiger Tiger team (for tech debt reduction + performance improvements)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants