fix: revert plugin changes, allow createMiddleware self compilation, fix HMR tests#7396
fix: revert plugin changes, allow createMiddleware self compilation, fix HMR tests#7396Sheraff wants to merge 5 commits into
Conversation
|
View your CI Pipeline Execution ↗ for commit 8ce33ee
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview42 package(s) bumped directly, 0 bumped as dependents. 🟨 Minor bumps
|
Bundle Size Benchmarks
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. |
This reverts commit 2bd877c.
There was a problem hiding this comment.
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 ↗
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
#7373 assumed
createMiddlewarewould 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
createMiddlewarestub (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
createCsrfMiddlewaretostart-server-coremaybe? We attempt this alternative fix in #7400