Skip to content

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

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

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

@SheraffSheraff commented May 13, 2026

Copy link
Copy Markdown
Collaborator

#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

nx-cloudBot commented May 13, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 8ce33ee

CommandStatusDurationResult
nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded9m 12sView ↗
nx run-many --target=build --exclude=examples/*...✅ Succeeded54sView ↗

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

@github-actions

github-actionsBot commented May 13, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟨 Minor bumps

PackageVersionReason
@tanstack/arktype-adapter1.166.9 → 1.167.0Changeset
@tanstack/eslint-plugin-router1.161.6 → 1.162.0Changeset
@tanstack/eslint-plugin-start0.0.1 → 0.1.0Changeset
@tanstack/history1.161.6 → 1.162.0Changeset
@tanstack/nitro-v2-vite-plugin1.154.9 → 1.155.0Changeset
@tanstack/react-router1.169.2 → 1.170.0Changeset
@tanstack/react-router-devtools1.166.13 → 1.167.0Changeset
@tanstack/react-router-ssr-query1.166.12 → 1.167.0Changeset
@tanstack/react-start1.167.65 → 1.168.0Changeset
@tanstack/react-start-client1.166.48 → 1.167.0Changeset
@tanstack/react-start-rsc0.0.44 → 0.1.0Changeset
@tanstack/react-start-server1.166.52 → 1.167.0Changeset
@tanstack/router-cli1.166.43 → 1.167.0Changeset
@tanstack/router-core1.169.2 → 1.170.0Changeset
@tanstack/router-devtools1.166.13 → 1.167.0Changeset
@tanstack/router-devtools-core1.167.3 → 1.168.0Changeset
@tanstack/router-generator1.166.42 → 1.167.0Changeset
@tanstack/router-plugin1.167.35 → 1.168.0Changeset
@tanstack/router-ssr-query-core1.168.0 → 1.169.0Changeset
@tanstack/router-utils1.161.8 → 1.162.0Changeset
@tanstack/router-vite-plugin1.166.50 → 1.167.0Changeset
@tanstack/solid-router1.169.2 → 1.170.0Changeset
@tanstack/solid-router-devtools1.166.13 → 1.167.0Changeset
@tanstack/solid-router-ssr-query1.166.12 → 1.167.0Changeset
@tanstack/solid-start1.167.62 → 1.168.0Changeset
@tanstack/solid-start-client1.166.47 → 1.167.0Changeset
@tanstack/solid-start-server1.166.51 → 1.167.0Changeset
@tanstack/start-client-core1.168.2 → 1.169.0Changeset
@tanstack/start-fn-stubs1.161.6 → 1.162.0Changeset
@tanstack/start-plugin-core1.169.20 → 1.170.0Changeset
@tanstack/start-server-core1.167.30 → 1.168.0Changeset
@tanstack/start-static-server-functions1.166.41 → 1.167.0Changeset
@tanstack/start-storage-context1.166.35 → 1.167.0Changeset
@tanstack/valibot-adapter1.166.9 → 1.167.0Changeset
@tanstack/virtual-file-routes1.161.7 → 1.162.0Changeset
@tanstack/vue-router1.169.2 → 1.170.0Changeset
@tanstack/vue-router-devtools1.166.13 → 1.167.0Changeset
@tanstack/vue-router-ssr-query1.166.12 → 1.167.0Changeset
@tanstack/vue-start1.167.58 → 1.168.0Changeset
@tanstack/vue-start-client1.166.43 → 1.167.0Changeset
@tanstack/vue-start-server1.166.47 → 1.167.0Changeset
@tanstack/zod-adapter1.166.9 → 1.167.0Changeset

@github-actions

github-actionsBot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 5050cbb9215c
  • Measured at: 2026-05-14T16:26:17.463Z
  • Baseline source: history:038cd123b70b
  • Dashboard: bundle-size history
ScenarioCurrent (gzip)Delta vs baselineInitial gzipRawBrotliTrend
react-router.minimal87.29 KiB0 B (0.00%)87.15 KiB274.07 KiB75.85 KiB▁▁▁▁▁▁▁▁███
react-router.full90.82 KiB0 B (0.00%)90.68 KiB285.58 KiB78.89 KiB▁▁▁▁▁▁▁▁███
solid-router.minimal35.51 KiB0 B (0.00%)35.39 KiB106.36 KiB31.97 KiB▁▁▁▁▁▁▁▁███
solid-router.full40.23 KiB0 B (0.00%)40.10 KiB120.58 KiB36.14 KiB▁▁▁▁▁▁▁▁███
vue-router.minimal53.29 KiB0 B (0.00%)53.15 KiB151.51 KiB47.85 KiB▁▁▁▁▁▁▁▁███
vue-router.full58.41 KiB0 B (0.00%)58.28 KiB167.69 KiB52.39 KiB▁▁▁▁▁▁▁▁███
react-start.minimal101.97 KiB0 B (0.00%)101.83 KiB322.51 KiB88.17 KiB▁▁▁▁▁▁▁▃███
react-start.full105.41 KiB0 B (0.00%)105.27 KiB332.84 KiB91.19 KiB▁▁▁▁▁▁▁▄███
react-start.rsbuild.minimal99.59 KiB-2 B (-0.00%)99.42 KiB316.98 KiB85.72 KiB▁▁▁▁▁▁▁▄████
react-start.rsbuild.full102.89 KiB-7 B (-0.01%)102.72 KiB327.41 KiB88.49 KiB▁▁▁▁▁▁▁▃████
solid-start.minimal49.61 KiB0 B (0.00%)49.48 KiB152.48 KiB43.78 KiB▁▁▁▁▁▁▁▄███
solid-start.full55.40 KiB0 B (0.00%)55.27 KiB169.39 KiB48.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

pkg-pr-newBot commented May 13, 2026

Copy link
Copy Markdown
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.

@nx-cloudnx-cloudBot left a comment

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.

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 CloudReject 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 freeto 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.

2 participants

@Sheraff@schiller-manuel