Skip to content

build: modernize dev deps#711

Merged
serhalp merged 8 commits into
mainfrom
serhalp/dep-clean
Jun 22, 2026
Merged

build: modernize dev deps#711
serhalp merged 8 commits into
mainfrom
serhalp/dep-clean

Conversation

@serhalp

@serhalp serhalp commented Jun 17, 2026

Copy link
Copy Markdown
Member

Description

  • upgrade most outdated dev deps
  • use native node instead of heavy unnecessary execa
  • use tinyglobby instead of heavier fast-glob
  • use tiny nano-staged instead of heavier lint-staged
  • use super fast tsdown, but only in maintained packages
  • upgrade from TypeScript 5 to super fast v7 tsgo preview
  • typecheck deno and node code separately
    • Upgrading TypeScript uncovered some errors in code that runs in Deno that aren't "real" errors, so instead of working around that I just fixed the setup instead.

Related Tickets & Documents

Follow-up to #709

@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for remix-edge ready!

Name Link
🔨 Latest commit 3532c8f
🔍 Latest deploy log https://app.netlify.com/projects/remix-edge/deploys/6a3958a4380d4c00086c6d1b
😎 Deploy Preview https://deploy-preview-711--remix-edge.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for remix-serverless ready!

Name Link
🔨 Latest commit 3532c8f
🔍 Latest deploy log https://app.netlify.com/projects/remix-serverless/deploys/6a3958a478e8ca000819effd
😎 Deploy Preview https://deploy-preview-711--remix-serverless.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d50faf25-e773-43a4-88da-48d202b9531d

📥 Commits

Reviewing files that changed from the base of the PR and between e8cd996 and 3532c8f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Updated pre-commit automation to always use nano-staged (removing lint-staged-based behavior).
    • Improved typechecking to run both Node and Deno checks.
    • Switched the React Router Vite plugin build process from tsup to tsdown.
    • Upgraded development tooling/package versions across the repo and refined TypeScript config for Deno/build targets.
  • Tests

    • Improved the end-to-end Netlify deployment test harness with a safer command runner and more reliable output/fixture handling.

Walkthrough

This PR performs four independent developer tooling migrations alongside coordinated dependency version updates. The pre-commit hook switches from lint-staged to nano-staged, with equivalent commands migrated to .nano-staged.json. TypeScript configuration is split to handle Deno targets separately: a new tsconfig.deno.json scopes remix-runtime and edge-function source files, the root tsconfig.json exclude list is expanded accordingly, and the typecheck script now runs tsgo --noEmit twice via run-s with separate tsconfig files. The vite-plugin-react-router build tool is switched from tsup to tsdown, replacing the old config with tsdown.config.mts in ESM-only mode with node22 target. The E2E deploy helper replaces execa and fast-glob with a local execFile-based run() helper and tinyglobby. Dependency versions are updated across multiple package.json files for Remix, TypeScript, Vite, and related tooling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • netlify/remix-compute#709: Both PRs modify tests/e2e/support/deploy-to-netlify.ts, with the main PR refactoring deployment/dependency prep command execution and the retrieved PR changing prepareDeps to inject local packages via a generated pnpm-workspace.yaml, so they overlap in the same e2e dependency-preparation area.
  • netlify/remix-compute#713: Both PRs touch packages/vite-plugin-react-router's build configuration by removing the CJS/legacy tsup-based setup; the main PR switches the build from tsup to tsdown/ESM, while the retrieved PR removes the CJS build and ESM-only export targets.

Suggested labels

type: chore

Suggested reviewers

  • pieh
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'build: modernize dev deps' accurately reflects the main objective of upgrading development dependencies shown across multiple files.
Description check ✅ Passed The description provides clear detail about modernizing dev deps by replacing heavy libraries with lighter alternatives and upgrading tools, which aligns with the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch serhalp/dep-clean

Comment @coderabbitai help to get the list of available commands and usage tips.

@serhalp serhalp force-pushed the serhalp/dep-clean branch from 6496aee to a7eba5d Compare June 17, 2026 17:48
Comment thread package.json Outdated
"typescript": "^5.0.0",
"tinyglobby": "^0.2.15",
"typescript": "^6.0.3",
"unrun": "^0.3.1",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This allows us to use a .ts file for tsdown config on older versions of node.

We're dropping node 20 in the next PR, so this is super temporary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's ship #712 first and the we should be able to drop this from this PR to avoid temp additions to main?

Just leaving ref for others https://tsdown.dev/options/config-file#config-loaders - on "Node.js 22.18.0+" we won't need unrun and we are bumping min to Node 22.22

@serhalp serhalp force-pushed the serhalp/dep-clean branch from ecadb93 to 944d816 Compare June 17, 2026 20:28
@serhalp serhalp marked this pull request as ready for review June 17, 2026 20:38
@serhalp serhalp requested a review from a team as a code owner June 17, 2026 20:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/e2e/support/deploy-to-netlify.ts (1)

17-17: ⚡ Quick win

Add a timeout to run() to prevent hanging CI jobs.

execFileAsync currently has no timeout; if pnpm install or ntl deploy hangs, the E2E job can block indefinitely.

Proposed fix
 const run = (file: string, args: string[], cwd: string) => execFileAsync(file, args, { cwd, maxBuffer: MAX_BUFFER })
+const run = (file: string, args: string[], cwd: string) =>
+  execFileAsync(file, args, {
+    cwd,
+    maxBuffer: MAX_BUFFER,
+    timeout: 10 * 60 * 1000, // 10 minutes
+  })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/e2e/support/deploy-to-netlify.ts` at line 17, The run() function in
deploy-to-netlify.ts is missing a timeout parameter in the execFileAsync call,
which can cause E2E jobs to hang indefinitely if commands like pnpm install or
ntl deploy stall. Add a timeout property to the options object passed to
execFileAsync alongside the existing cwd and maxBuffer properties to ensure the
command execution has a maximum time limit before it fails.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/e2e/support/deploy-to-netlify.ts`:
- Line 17: The run() function in deploy-to-netlify.ts is missing a timeout
parameter in the execFileAsync call, which can cause E2E jobs to hang
indefinitely if commands like pnpm install or ntl deploy stall. Add a timeout
property to the options object passed to execFileAsync alongside the existing
cwd and maxBuffer properties to ensure the command execution has a maximum time
limit before it fails.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a010de5-d66e-48eb-aba2-2909cd5e7d81

📥 Commits

Reviewing files that changed from the base of the PR and between 6a56ab0 and 944d816.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .husky/pre-commit
  • .lintstagedrc.js
  • .nano-staged.json
  • package.json
  • packages/remix-runtime/src/crypto.ts
  • packages/remix-runtime/tsconfig.json
  • packages/vite-plugin-react-router/package.json
  • packages/vite-plugin-react-router/tsconfig.json
  • packages/vite-plugin-react-router/tsdown.config.mts
  • packages/vite-plugin-react-router/tsup.config.ts
  • tests/e2e/support/deploy-to-netlify.ts
  • tsconfig.deno.json
  • tsconfig.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)
💤 Files with no reviewable changes (2)
  • .lintstagedrc.js
  • packages/vite-plugin-react-router/tsup.config.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 944d816005

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vite-plugin-react-router/package.json Outdated
serhalp added a commit that referenced this pull request Jun 18, 2026
## Description

React Router 8 has just been released.

[React Router 8](https://reactrouter.com/upgrading/v7) makes the Vite
Environment API mandatory and supports Vite 7-8. React Router 7 supports
Vite 6-7 (and 8, starting with 7.14) but users can opt in to this mode
as well via `future.v8_viteEnvironmentApi`.

Either way, the Vite Env API is forward compatible from the "client" and
"ssr" pseudo-environments present previously, and those are backwards
compatible as well.

The main change to contend with here is reading from
`config.environments?.ssr?.build` instead of `config.ssr.build`
directly. This is supported by all combinations of versions and flags
listed above. **Edit:** I ended up doing this via the
`configEnvironment` hook, which is equivalent but runs after React
Router has actually configured its environments.

We also replace `isSsrBuild` with a simple `applyToEnvironment` hook,
which is compatible with all these combinations as well.

Finally, this starts reading from `rolldownOptions` and falling back to
`rollupOptions`. This was entirely optional, but since the latter is
soft-deprecated, I introduced this here. Again, all combinations of
versions and flags are compatible with this.

Essentially:

```
       Vite 5    Vite 6   Vite 7   Vite 8
RR7      EOL       ✓        ✓        ✓    (Vite 8 requires RR 7.14.0+)
RR8      EOL       —        ✓        ✓
```

Now, unfortunately I ended up also needing to somewhat fundamentally
rework the whole plugin's approach. The previous approach was to
register our own input that wraps the (leakily) expected React Router
input. This is now fundamentally incompatible with React Router 8 as
soon as a site has any prerendered pages, because React Router 8 uses a
separate Vite Environment `prerender` that it builds by first building
the other envs, then starting a preview server, making real HTTP
requests to each path to be prerendered, and saving the response to
disk. This request was failing, seemingly due to some
[assumption in React Router 8 that is not happy with its own entry
coexisting with
another](https://github.com/remix-run/react-router/blob/da102b5928d2cf0b94cd0abc2895d0939698e7e9/packages/react-router-dev/vite/plugin.ts#L3578-L3586).
Funny enough, I more or less ended up just porting parts of our
[framework-agnostic
plugin](https://github.com/netlify/framework-adapters/blob/69d233d505afb85d848f702e70441bc3e71008bd/packages/vite-plugin/src/lib/build.ts)
here.

The bulk of the diff in this PR is adding two new fixtures for RR8
serverless + RR7 edge, and refactoring the existing test suite to allow
running table tests with different versions of Vite. This was important
because in testing this locally I contended with all sorts of different
behaviours across combinations. This is a bit clunky and will slow down
CI but I believe it is worthwhile given all this combinatorial
complexity.

Closes #698 

## Related Tickets & Documents

See also #711 and #712
serhalp added 6 commits June 22, 2026 11:15
Upgrading TypeScript uncovered some errors in code that runs in Deno that aren't "real" errors, so I
just fixed this setup instead.
- upgrade a bunch now that CI is fixed and we're dropping node 20
- use native node instead of heavy execa
- use tinyglobby instead of heavier fast-glob
- use tiny nano-staged instead of heavier lint-staged
- use super fast tsdown, but only in maintained packages
- use super fast tsgo preview
This allows us to use a `.ts` file for tsdown config on older versions of node.

We're dropping node 20 in the next PR, so this is super temporary.
@serhalp serhalp force-pushed the serhalp/dep-clean branch from 944d816 to d7c6682 Compare June 22, 2026 15:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@demos/vite-edge/package.json`:
- Around line 36-38: The typescript dependency version 6.0.3 does not match the
PR summary which mentions TypeScript 7 preview. Clarify and update the
typescript version in package.json to either stay at 6.0.3 or use the TypeScript
7 preview via the `@typescript/native-preview` package if you intend to use the
tsgo compiler. Additionally, remove the vite-tsconfig-paths dependency since
Vite 8.0.16 now has native support for TypeScript path mappings. Instead,
configure the resolve.tsconfigPaths option in your Vite configuration file to
enable this feature natively.

In `@packages/remix-adapter/package.json`:
- Around line 66-74: The tsup dependency at version ^8.5.1 in the
devDependencies has documented critical breaking issues including TypeScript
declaration file generation errors and watch mode rebuilding problems. Update
the tsup version constraint to a stable prior version that does not have these
issues, or alternatively consider migrating to tsdown if a replacement build
tool is preferred. Verify the chosen version is stable and does not exhibit the
reported TypeScript declaration or watch mode problems before committing the
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0efdc3e7-1e90-462c-b585-ed2c56fb79c4

📥 Commits

Reviewing files that changed from the base of the PR and between 944d816 and d7c6682.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • .husky/pre-commit
  • .lintstagedrc.js
  • .nano-staged.json
  • demos/vite-edge/package.json
  • demos/vite-functions/package.json
  • package.json
  • packages/remix-adapter/package.json
  • packages/remix-edge-adapter/package.json
  • packages/remix-runtime/package.json
  • packages/remix-runtime/src/crypto.ts
  • packages/remix-runtime/tsconfig.json
  • packages/vite-plugin-react-router/package.json
  • packages/vite-plugin-react-router/tsconfig.json
  • packages/vite-plugin-react-router/tsdown.config.mts
  • packages/vite-plugin-react-router/tsup.config.ts
  • tests/e2e/support/deploy-to-netlify.ts
  • tsconfig.deno.json
  • tsconfig.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)
💤 Files with no reviewable changes (2)
  • packages/vite-plugin-react-router/tsup.config.ts
  • .lintstagedrc.js
✅ Files skipped from review due to trivial changes (6)
  • .husky/pre-commit
  • tsconfig.deno.json
  • tsconfig.json
  • .nano-staged.json
  • packages/remix-runtime/src/crypto.ts
  • packages/remix-runtime/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/vite-plugin-react-router/tsconfig.json
  • packages/vite-plugin-react-router/package.json
  • tests/e2e/support/deploy-to-netlify.ts
  • package.json

Comment thread demos/vite-edge/package.json
Comment thread packages/remix-adapter/package.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8cd996bdb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
format: ['esm'],
dts: true,
target: 'node22',
external,

@pieh pieh Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://tsdown.dev/guide/migrate-from-tsup#deprecated-but-compatible-options

seems like tsdown blessed way is to use deps.neverBundle (with external being supported, but deprecated)

noted in https://github.com/netlify/remix-compute/actions/runs/27965209479/job/82757080857?pr=711#step:7:19

packages/vite-plugin-react-router build:  WARN  `external` is deprecated. Use `deps.neverBundle` instead.

@serhalp serhalp merged commit d71951a into main Jun 22, 2026
22 of 23 checks passed
@serhalp serhalp deleted the serhalp/dep-clean branch June 22, 2026 17:12
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.

2 participants