solid-router icon indicating copy to clipboard operation
solid-router copied to clipboard

Update `moduleResolution`

Open atilafassina opened this issue 3 months ago • 1 comments

moduleResolution: "node" is a legacy setting that will soon be deprecated. It's intended for Node < 10. NodeNext targets Node 16 and onwards.

Implementation

  • [x] Add .js extension to all relative imports
  • [x] Replace moduleResolution to NodeNext
  • [x] Replace module to NodeNext
  • [x] Adds skipLibCheck: true
  • [x] adds pnpm@10 to packageManager version so there aren't lockfile conflicts between local and CI

Type Analysis

Latest on NPM

Environment @solidjs/router
node16 (from ESM) 🥴 Internal resolution error
bundler 🟢
node10 (ignored) 🟢
node16 (from CJS) (ignored) ⚠️ ESM (dynamic import only)
(ignored) 🥴 Internal resolution error
pnpx @arethetypeswrong/cli --profile esm-only --from-npm @solidjs/router -f table

This PR

@solidjs/router
node10 🟢
node16 (from CJS) ⚠️ ESM (dynamic import only)
node16 (from ESM) 🟢 (ESM)
bundler 🟢
pnpx @arethetypeswrong/cli --profile esm-only --pack .

Final note

Since type-checks and build passes, I don't expect any decrease in compatibility going forward. But adding the .js extension even when keeping modeResolution: node seems to have helped tsc, I expect this new setting to make types more reliable.

atilafassina avatar Nov 09 '25 11:11 atilafassina

🦋 Changeset detected

Latest commit: 4a543bda0f4848ecc56303d84b4f10d261abd20c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Nov 09 '25 11:11 changeset-bot[bot]