Skip to content

fix(router-plugin): HMR for autoCodesplitting routes - #3275

Merged
SeanCassiere merged 9 commits into
mainfrom
fix/better-code-splitting
Jan 29, 2025
Merged

fix(router-plugin): HMR for autoCodesplitting routes#3275
SeanCassiere merged 9 commits into
mainfrom
fix/better-code-splitting

Conversation

@SeanCassiere

@SeanCassiere SeanCassiere commented Jan 29, 2025

Copy link
Copy Markdown
Member
  • Fixes an issue where components that got code-split and therefore moved into the virtual route didn't have HMR working.
    • This is because the component's variable naming in the virtual route didn't follow the rules of React.
    • i.e. const component = ... => const Component = ...
  • Fixes an issue where the dummy component for the reference route wasn't being saved after the DCE pass.
    • i.e. function DummyComponent () { ... } => export function DummyComponent() { ... }
  • Refactored to use a consolidated config to control the compilation of the reference and virtual route files during automatic code-splitting.

@nx-cloud

nx-cloud Bot commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 6944fcb.

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

☁️ Nx Cloud last updated this comment at 2025-01-29 23:20:57 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jan 29, 2025

Copy link
Copy Markdown

Open in Stackblitz

More templates

@tanstack/arktype-adapter

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

@tanstack/create-router

npm i https://pkg.pr.new/@tanstack/create-router@3275

@tanstack/create-start

npm i https://pkg.pr.new/@tanstack/create-start@3275

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/@tanstack/directive-functions-plugin@3275

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/react-cross-context

npm i https://pkg.pr.new/@tanstack/react-cross-context@3275

@tanstack/react-router

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

@tanstack/react-router-with-query

npm i https://pkg.pr.new/@tanstack/react-router-with-query@3275

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-cli

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/@tanstack/server-functions-plugin@3275

@tanstack/start

npm i https://pkg.pr.new/@tanstack/start@3275

@tanstack/start-api-routes

npm i https://pkg.pr.new/@tanstack/start-api-routes@3275

@tanstack/start-client

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

@tanstack/start-config

npm i https://pkg.pr.new/@tanstack/start-config@3275

@tanstack/start-plugin

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

@tanstack/start-router-manifest

npm i https://pkg.pr.new/@tanstack/start-router-manifest@3275

@tanstack/start-server

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

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/@tanstack/start-server-functions-client@3275

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/@tanstack/start-server-functions-fetcher@3275

@tanstack/start-server-functions-handler

npm i https://pkg.pr.new/@tanstack/start-server-functions-handler@3275

@tanstack/start-server-functions-server

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

@tanstack/start-server-functions-ssr

npm i https://pkg.pr.new/@tanstack/start-server-functions-ssr@3275

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 6944fcb

@SeanCassiere SeanCassiere changed the title fix(router-plugin): correctly export the dummy component fix(router-plugin): HMR for autoCodesplitting routes Jan 29, 2025
@SeanCassiere
SeanCassiere marked this pull request as ready for review January 29, 2025 23:20
@SeanCassiere
SeanCassiere merged commit a65f770 into main Jan 29, 2025
@SeanCassiere
SeanCassiere deleted the fix/better-code-splitting branch January 29, 2025 23:27
This was referenced Jan 29, 2025
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.

1 participant