You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node.js 22 has just hit LTS, bringing with it some additional goodies like support for Iterator.toArray and Iterator.map.
We're also no longer constrained to Node 20, since Cloudflare has confirmed that using their codegen for types (which we are) means we do not need to pin the @types/node package to v20, so we can actually upgrade to Node 22.
Context
This will be useful in cleaning up components of our data pipelines, since we use the following pattern a lot:
consttheMap=newMap<string,unknown>();// toArray can even be omitted in cases where the function consuming res accepts an Iteratorconstres=theMap.keys().map((key)=>{ ... }).toArray();
Action Items
Set version in .nvmrc to 22.11.0
Install latest @types/node at workspace level
Remove @types/node at package level
Refactor code using Array.from
Verify that nothing broke
The text was updated successfully, but these errors were encountered:
Node.js 22 has just hit LTS, bringing with it some additional goodies like support for
Iterator.toArray
andIterator.map
.We're also no longer constrained to Node 20, since Cloudflare has confirmed that using their codegen for types (which we are) means we do not need to pin the
@types/node
package to v20, so we can actually upgrade to Node 22.Context
This will be useful in cleaning up components of our data pipelines, since we use the following pattern a lot:
Which can then be converted into this pattern:
Action Items
.nvmrc
to 22.11.0@types/node
at workspace level@types/node
at package levelArray.from
The text was updated successfully, but these errors were encountered: