Skip to content

fix: revert plugin changes, allow createMiddleware self compilation, fix HMR tests#7396

Open
Sheraff wants to merge 5 commits into
mainfrom
fix-createmiddleware-self-compilation
Open

fix: revert plugin changes, allow createMiddleware self compilation, fix HMR tests#7396
Sheraff wants to merge 5 commits into
mainfrom
fix-createmiddleware-self-compilation

Conversation

@Sheraff
Copy link
Copy Markdown
Contributor

@Sheraff Sheraff commented May 13, 2026

#7373 assumed createMiddleware would be imported internally and still be compiled away IIF the compiler was made recursive.

It seemed to work, but also the compiler broke HMR E2E tests (and possibly actual HMR, not just tests).

Instead, this PR reverts the compiler changes, and adds a createMiddleware stub (registered in the plugin) so it still gets compiled away.


This works well, but is a little weird for "where to put the code", the stub is untyped because all types live alongside the actual implementation.

Another solution could be to move the implementation of createCsrfMiddleware to start-server-core maybe? We attempt this alternative fix in #7400

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 13, 2026

View your CI Pipeline Execution ↗ for commit 8ce33ee

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 9m 12s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 54s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-14 16:34:32 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🚀 Changeset Version Preview

42 package(s) bumped directly, 0 bumped as dependents.

🟨 Minor bumps

Package Version Reason
@tanstack/arktype-adapter 1.166.9 → 1.167.0 Changeset
@tanstack/eslint-plugin-router 1.161.6 → 1.162.0 Changeset
@tanstack/eslint-plugin-start 0.0.1 → 0.1.0 Changeset
@tanstack/history 1.161.6 → 1.162.0 Changeset
@tanstack/nitro-v2-vite-plugin 1.154.9 → 1.155.0 Changeset
@tanstack/react-router 1.169.2 → 1.170.0 Changeset
@tanstack/react-router-devtools 1.166.13 → 1.167.0 Changeset
@tanstack/react-router-ssr-query 1.166.12 → 1.167.0 Changeset
@tanstack/react-start 1.167.65 → 1.168.0 Changeset
@tanstack/react-start-client 1.166.48 → 1.167.0 Changeset
@tanstack/react-start-rsc 0.0.44 → 0.1.0 Changeset
@tanstack/react-start-server 1.166.52 → 1.167.0 Changeset
@tanstack/router-cli 1.166.43 → 1.167.0 Changeset
@tanstack/router-core 1.169.2 → 1.170.0 Changeset
@tanstack/router-devtools 1.166.13 → 1.167.0 Changeset
@tanstack/router-devtools-core 1.167.3 → 1.168.0 Changeset
@tanstack/router-generator 1.166.42 → 1.167.0 Changeset
@tanstack/router-plugin 1.167.35 → 1.168.0 Changeset
@tanstack/router-ssr-query-core 1.168.0 → 1.169.0 Changeset
@tanstack/router-utils 1.161.8 → 1.162.0 Changeset
@tanstack/router-vite-plugin 1.166.50 → 1.167.0 Changeset
@tanstack/solid-router 1.169.2 → 1.170.0 Changeset
@tanstack/solid-router-devtools 1.166.13 → 1.167.0 Changeset
@tanstack/solid-router-ssr-query 1.166.12 → 1.167.0 Changeset
@tanstack/solid-start 1.167.62 → 1.168.0 Changeset
@tanstack/solid-start-client 1.166.47 → 1.167.0 Changeset
@tanstack/solid-start-server 1.166.51 → 1.167.0 Changeset
@tanstack/start-client-core 1.168.2 → 1.169.0 Changeset
@tanstack/start-fn-stubs 1.161.6 → 1.162.0 Changeset
@tanstack/start-plugin-core 1.169.20 → 1.170.0 Changeset
@tanstack/start-server-core 1.167.30 → 1.168.0 Changeset
@tanstack/start-static-server-functions 1.166.41 → 1.167.0 Changeset
@tanstack/start-storage-context 1.166.35 → 1.167.0 Changeset
@tanstack/valibot-adapter 1.166.9 → 1.167.0 Changeset
@tanstack/virtual-file-routes 1.161.7 → 1.162.0 Changeset
@tanstack/vue-router 1.169.2 → 1.170.0 Changeset
@tanstack/vue-router-devtools 1.166.13 → 1.167.0 Changeset
@tanstack/vue-router-ssr-query 1.166.12 → 1.167.0 Changeset
@tanstack/vue-start 1.167.58 → 1.168.0 Changeset
@tanstack/vue-start-client 1.166.43 → 1.167.0 Changeset
@tanstack/vue-start-server 1.166.47 → 1.167.0 Changeset
@tanstack/zod-adapter 1.166.9 → 1.167.0 Changeset

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Bundle Size Benchmarks

  • Commit: 5050cbb9215c
  • Measured at: 2026-05-14T16:26:17.463Z
  • Baseline source: history:038cd123b70b
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.29 KiB 0 B (0.00%) 87.15 KiB 274.07 KiB 75.85 KiB ▁▁▁▁▁▁▁▁███
react-router.full 90.82 KiB 0 B (0.00%) 90.68 KiB 285.58 KiB 78.89 KiB ▁▁▁▁▁▁▁▁███
solid-router.minimal 35.51 KiB 0 B (0.00%) 35.39 KiB 106.36 KiB 31.97 KiB ▁▁▁▁▁▁▁▁███
solid-router.full 40.23 KiB 0 B (0.00%) 40.10 KiB 120.58 KiB 36.14 KiB ▁▁▁▁▁▁▁▁███
vue-router.minimal 53.29 KiB 0 B (0.00%) 53.15 KiB 151.51 KiB 47.85 KiB ▁▁▁▁▁▁▁▁███
vue-router.full 58.41 KiB 0 B (0.00%) 58.28 KiB 167.69 KiB 52.39 KiB ▁▁▁▁▁▁▁▁███
react-start.minimal 101.97 KiB 0 B (0.00%) 101.83 KiB 322.51 KiB 88.17 KiB ▁▁▁▁▁▁▁▃███
react-start.full 105.41 KiB 0 B (0.00%) 105.27 KiB 332.84 KiB 91.19 KiB ▁▁▁▁▁▁▁▄███
react-start.rsbuild.minimal 99.59 KiB -2 B (-0.00%) 99.42 KiB 316.98 KiB 85.72 KiB ▁▁▁▁▁▁▁▄████
react-start.rsbuild.full 102.89 KiB -7 B (-0.01%) 102.72 KiB 327.41 KiB 88.49 KiB ▁▁▁▁▁▁▁▃████
solid-start.minimal 49.61 KiB 0 B (0.00%) 49.48 KiB 152.48 KiB 43.78 KiB ▁▁▁▁▁▁▁▄███
solid-start.full 55.40 KiB 0 B (0.00%) 55.27 KiB 169.39 KiB 48.72 KiB ▁▁▁▁▁▁▁▄███

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7396

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7396

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7396

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7396

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7396

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7396

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7396

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7396

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7396

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7396

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7396

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7396

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7396

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7396

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7396

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7396

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7396

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7396

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7396

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7396

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7396

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7396

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7396

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7396

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7396

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7396

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7396

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7396

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7396

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7396

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7396

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7396

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7396

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7396

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7396

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7396

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7396

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7396

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7396

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7396

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7396

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7396

commit: 8ce33ee

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We replaced the unnecessary as type assertion on csrfCtx with an explicit type annotation on the variable declaration, which resolves the @typescript-eslint/no-unnecessary-type-assertion ESLint error. Since ctx is typed as any, asserting it with as does not change the resulting type, making the assertion redundant. This change preserves the intended typing of csrfCtx while satisfying the linting rules.

Tip

We verified this fix by re-running @tanstack/start-client-core:test:eslint.

Warning

The suggested diff is too large to display here, but you can view it on Nx Cloud ↗


Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally oNnh-5WY9

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant