microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

Update Node to LTS version

Open gavinbarron opened this issue 1 year ago • 7 comments

Proposal: Update development environments to use Node v16 or v18

Description

Currently we require developers to use Node v12 or v14 https://github.com/microsoftgraph/microsoft-graph-toolkit/wiki#Setup-the-development-environment The current LTS version is v16, this is also required for working with spfx https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment

Rationale

Neither of the Node versions that we advise developer to use are current versions, and given the current crossover between SharePoint development and where we see usage of MTG we should take steps to ensure that it's as easy as possible for a SharePoint developer to contribute back to our repository.

Preferred Solution

Ensure that a developer can build the source code for MTG using either Node 16 or 18. Have CI guardrails to ensure that solutions using MTG as a dependency will build running on any of the even numbered Node version that are active, current, or maintained (as of now this is 14, 16, and 18)

Related work items

  • [x] #1775

gavinbarron avatar Jul 15 '22 22:07 gavinbarron

Hello gavinbarron, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

ghost avatar Jul 15 '22 22:07 ghost

Initial blockers: samples/sp-webpart has dependency on @microsoft/[email protected] which locks the node version < 15.5.0

Update sample to use [email protected]

node-sass must be > 6.0 to run on node 16+ samples/react-app uses [email protected] this introduces a transitive dependency on [email protected] which fails to meet the requirement for jest@">=26 <27" from [email protected]

The dependency on ts-jest appears to be outdated as the last tests using Jest in the library were removed in #767

gavinbarron avatar Jul 19 '22 21:07 gavinbarron

Hello @gavinbarron the latest CI run on main fails due to an incompatible node version 00865f30255e7b86c2df369e98bf9059c4601beb, is this a proper time to do the CI updates for the allowed node versions in the matrix?

musale avatar Sep 05 '22 11:09 musale

@musale yes, I think that we should be updating our supported node versions to 14 and 16 as part of the v3 release.

I suspect that we'll have quite a few dependencies which might cause us issues as we do so but now is the time.

gavinbarron avatar Sep 07 '22 23:09 gavinbarron

@gavinbarron true. Currently, I locked responselike to v2.0.0 to skip the build errors we had in main. As I was doing that, I managed to get v14.x of node to run builds. However, in azure devops it was failing because the node version was locked to v12.x. So in our updates, we should also keep that in mind. v16.x had a lot of dependencies that needed to be changed, as well as APIs.

musale avatar Sep 08 '22 12:09 musale

I saw that resolutions update @musale, thanks for that. How about we update the matrix we're using to validate builds to cover 12,14, and 16 on our next branch so that we can gauge our progress on this? We'd likely need to accept failures on 14 and 16 as we progress on this work. We could even use an additional action for this validation. Thoughts?

gavinbarron avatar Sep 08 '22 14:09 gavinbarron

Yes we can! That would also be a good point to start before moving it to the main branch. I think with v16.x we shall have the most work.

musale avatar Sep 08 '22 16:09 musale