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

feat: upgrade Node.js and related nix files #1325

Merged
merged 2 commits into from
Feb 12, 2024
Merged

feat: upgrade Node.js and related nix files #1325

merged 2 commits into from
Feb 12, 2024

Conversation

o-az
Copy link
Member

@o-az o-az commented Feb 10, 2024

Summary:

  • upgrade Node.js to v21,
  • upgrade svelte-language-server and typescript-language-server to latest.
    @PoisonPhang suggested following our current approach when we need to use the latest version of a tool: this Node.js upgrade follows our current approach by supplying a separate nixpkgs, the same way we nixify solc and go:
    nixpkgs-nodejs.url = "github:NixOS/nixpkgs/nixos-unstable";

Why upgrade:

  • Need up to date svelte-language-server and typescript-language-server as they were quite behind in terms of what versions of svelte and typescript they covered,
  • v21 fixes a couple of bugs, upgrades npm to v10,
  • To overcome the recurring node-gyp issue. It hasn't been possible to update Astro since every version post-4.0.9 resulted in that nasty sharp x node-gyp issue. To overcome that issue, I tested a scenario that worked: building the site with Node.js v21 and overriding sharp version. To override sharp's version, simply adding sharp to package.json doesn't work because other dependencies also have sharp as their dependency with different versions:
     npm ls sharp
     
     ├─┬ [email protected]
     │ └── [email protected] # different version
     └── [email protected] # version in package.json
    Long story short, I upgraded Node.js to v21 and leveraged npm's overrides field which lets me override the version of any dependency down the tree. So now:
     npm ls sharp
     
     ├─┬ [email protected]
     │ └── [email protected] overridden
     └── [email protected] overridden

Copy link

github-actions bot commented Feb 10, 2024

Site/Docs 🤠

✨ Deployment complete! Take a peek over at https://9b10d23d.docs-19u.pages.dev

2024-02-07T02:02:52Z

Copy link

github-actions bot commented Feb 10, 2024

App 🤌

✨ Deployment complete! Take a peek over at https://ce43b309.app-1b1.pages.dev

2024-02-07T02:02:52Z

site/package.json Show resolved Hide resolved
@o-az o-az requested review from cor, PoisonPhang and benluelo February 10, 2024 09:12
cor
cor previously approved these changes Feb 10, 2024
Copy link
Contributor

@cor cor left a comment

Choose a reason for hiding this comment

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

Great PR! node projects are the most difficult to package/manage in Nix for sure bc of the node-gyp stuff, and you managed to find a way for us to be on the latest versions of dependencies without issues with sharp. Great job sir

benluelo
benluelo previously approved these changes Feb 11, 2024
PoisonPhang
PoisonPhang previously approved these changes Feb 12, 2024
@o-az o-az dismissed stale reviews from PoisonPhang, benluelo, and cor via b734450 February 12, 2024 20:57
@o-az o-az merged commit 3d43d39 into main Feb 12, 2024
37 checks passed
@o-az o-az deleted the update-node-deps branch February 12, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants