FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Update development and CI to Node 20

Open CraigMacomber opened this issue 1 year ago • 2 comments

Description

This updates most things from node 18 to 20. This does not update the Dockerfiles.

Breaking Changes

Developers should update to node 20.15.1 or newer. This is somewhat enforced via engines blocks in the package.json.

Reviewer Guidance

The review process is outlined on this wiki page.

CraigMacomber avatar Jul 20 '24 01:07 CraigMacomber

This is failing on CI demonstrating that some fixes are needed to enable moving to node 20.

CraigMacomber avatar Jul 24 '24 21:07 CraigMacomber

This is still a useful reference.

CraigMacomber avatar Oct 03 '24 21:10 CraigMacomber

This PR should fix one of the failing tests.

The other one is this one in telemetry-utils. I looked into it, and the problem seems to be a weird interaction between sinon.useFakeTimers() and our custom performance object starting in Node20. In Node19 the test still passes, but in Node20 it doesn't anymore (using clock.tick() from Sinon's fake timers still makes the native performance.now() report time as if the fake ticks have elapsed, but our object now reports natural elapsed time).

There's another test which does basically the same thing as the failing one, but in this case the measuring is not done through our custom performance object, but directly with the native one, and that one doesn't run into issues.

I don't think we should update the failing test to also use the native performance object because it's used inside a class method that could end up being used in the browser, so using our (hopefully works-in-browser-and-in-node) performance object seems like the correct thing to do there. If it's the only blocking bit for moving to Node20, let's just skip it and capture a work item to look into it in more detail at some point.

alexvy86 avatar Nov 22 '24 23:11 alexvy86

The other one is this one in telemetry-utils. I looked into it, and the problem seems to be a weird interaction between sinon.useFakeTimers() and our custom performance object starting in Node20. In Node19 the test still passes, but in Node20 it doesn't anymore (using clock.tick() from Sinon's fake timers still makes the native performance.now() report time as if the fake ticks have elapsed, but our object now reports natural elapsed time).

@alexvy86 @CraigMacomber I started looking into this because I want our end-to-end tests to start using fake timers instead of real waits. I initially thought that it was related to this issue (https://github.com/sinonjs/fake-timers/issues/438) where performance was not overriden by the fake timers but that's not the case. peformance is overriden but the custom isomorphic performance is not overriden like Alex said. I am not sure how we can ensure that it is also overriden but I wanted to share what I did in case it gave you guys any idea.

https://github.com/sinonjs/fake-timers/issues/438

agarwal-navin avatar Jan 16 '25 20:01 agarwal-navin

I was getting the errors described in https://vercel.com/guides/corepack-errors-github-actions on CI. To get the recommended (0.31 +) version of corepack, it seems like node 20.19 is required, so I am trying that version.

CraigMacomber avatar Mar 29 '25 00:03 CraigMacomber

/azp run Build - build-common

alexvy86 avatar Mar 31 '25 15:03 alexvy86

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 31 '25 15:03 azure-pipelines[bot]