Skip to content

Update Node.js dependencies for improved LTS support#11648

Merged
aduth merged 5 commits intomainfrom
aduth-node-22-native
Dec 17, 2024
Merged

Update Node.js dependencies for improved LTS support#11648
aduth merged 5 commits intomainfrom
aduth-node-22-native

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Dec 16, 2024

🛠 Summary of changes

Following upgrade to Node.js LTS 22 in #11605, updates use of a few dependencies to take advantage of new features:

  • Removes direct dependency on fast-glob in favor of new fs glob utility
  • Updates clipboard-polyfill, which had been stuck on an older version with TypeScript types patch due to project migrating to ESM-only, but Node.js 22 includes experimental support for CommonJS require of ESM

Additional dependency updates were required:

  • typescript and @types/node to support use of Array.fromAsync
  • webpack to resolve TypeScript errors stemming from upgrade of typescript

📜 Testing Plan

Verify build passes.

The riskiest upgrade here is webpack, which affects end-user bundled JavaScript. But we're only a few minor versions behind, so it should be relatively safe (see release notes).

changelog: Internal, Dependencies, Drop dependencies in favor of Node.js native utilities
Now includes fixed TypeScript types. Previously wasn't possible to upgrade because project is ESM, but Node.js 22 adds experimental support for CommonJS require of ESM
Avoid issues with types on Array.fromAsync
@aduth aduth added the dependencies Pull requests that update a dependency file label Dec 16, 2024
@aduth aduth requested a review from mitchellhenke December 16, 2024 18:38
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, did we find all these by searching for await glob( or did they turn up as type errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had searched fast-glob and updated references. TypeScript did come in handy when it came to converting to using Array.fromAsync, since the return type of Node.js's built-in glob is neither an array nor a promise, but instead an AsyncIterable.

@mitchellhenke mitchellhenke force-pushed the aduth-node-22-native branch 3 times, most recently from c1ae07b to 2e2fb65 Compare December 17, 2024 16:19
@aduth aduth merged commit 5827ee8 into main Dec 17, 2024
@aduth aduth deleted the aduth-node-22-native branch December 17, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants