vikejs / vike-node

🔨 Node integration for Vike
MIT License
23 stars 3 forks source link

Update `esbuild` #11

Closed rtritto closed 2 months ago

rtritto commented 2 months ago

Currently esbuild, as major (semantic) version, is 0 and not > 0. Imply that each upgrade of minor version can introduce breaking changes and is installed by pacakage manager (no deduped) as follow:

➤ YN0000: · Yarn 4.4.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.23.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.19.12 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed
➤ YN0000: ┌ Deduplication step
➤ YN0000: │ No packages can be deduped using the highest strategy
➤ YN0000: └ Completed
➤ YN0000: · Done

Can esbuild, dependency in vike-node, be updated with the same version of vike one?

brillout commented 2 months ago

@rtritto I guess so, up for a PR? I'd suggest we do this.

rtritto commented 2 months ago

@brillout I did the change but the 0.21.5 version of eslint is installed (not latest of 0.23.x). That's because the https://github.com/vikejs/vike-node/blob/main/.npmrc is missing resolution-mode=highest option. It needs to be updated like https://github.com/vikejs/vike/blob/main/.npmrc. (resolution-mode is highest by default from pnpm v8.7.0)

Should the shamefully-hoist=true option be removed?

brillout commented 2 months ago

Sounds good. Also, what I usually do is to add dependencies as well to devDependencies so that it busts pnpm's lock file.

rtritto commented 2 months ago

Sounds good. Also, what I usually do is to add dependencies as well to devDependencies so that it busts pnpm's lock file.

This should be a workaround.

Why should we prefer ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 over ^0.23.0?

In dependencies, I would use only ^0.23.0.

brillout commented 2 months ago

To align with Vite, e.g. last time I checked Vite doesn't use ^0.23.0 yet.