Skip to content

feat(react): Add react-router to create-nx-workspace and react app generator#30316

Merged
FrozenPandaz merged 1 commit intomasterfrom
feat/react-router-app-generator
Mar 14, 2025
Merged

feat(react): Add react-router to create-nx-workspace and react app generator#30316
FrozenPandaz merged 1 commit intomasterfrom
feat/react-router-app-generator

Conversation

@ndcunningham
Copy link
Copy Markdown
Contributor

@ndcunningham ndcunningham commented Mar 9, 2025

This pull request introduces improvements to React Router integration and removes the Remix preset.

Key Changes:

  • Updated create-nx-workspace to support React Router.
  • Removed the Remix option from create-nx-workspace, but the package remains to support existing users.

SSR & React Router Support

  • New users who want SSR in their React apps can enable it via the React option and select React Router for SSR support.
  • The ecosystem has shifted to migrating from Remix to React Router for SSR needs.
  • This option is only available for plain React apps and uses Vite. Other types of React apps (Micro Frontends, Webpack, Rspack, etc.) remain unaffected.

Default Routing Behavior

--routing is now enabled by default when creating a React app using create-nx-workspace, aligning with Angular’s default behaviour.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Mar 14, 2025 5:32pm

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Mar 9, 2025

View your CI Pipeline Execution ↗ for commit 28c2e51.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 42m 35s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 17s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base=00820... ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx documentation ✅ Succeeded 1m 35s View ↗

☁️ Nx Cloud last updated this comment at 2025-03-14 18:05:26 UTC

@ndcunningham ndcunningham force-pushed the feat/react-router-app-generator branch from 4d731d4 to 0ec423f Compare March 10, 2025 20:06
@ndcunningham ndcunningham self-assigned this Mar 10, 2025
@ndcunningham ndcunningham added the scope: react Issues related to React support for Nx label Mar 10, 2025
@ndcunningham ndcunningham force-pushed the feat/react-router-app-generator branch from 0ec423f to dbaf05a Compare March 10, 2025 21:34
@ndcunningham ndcunningham force-pushed the feat/react-router-app-generator branch from dbaf05a to e3de28f Compare March 10, 2025 21:42
@ndcunningham ndcunningham changed the title feat(react): WIP react router feat(react): Add react-router to create-nx-workspace and react app generator Mar 10, 2025
@ndcunningham ndcunningham force-pushed the feat/react-router-app-generator branch from e3de28f to bdc36b8 Compare March 10, 2025 23:55
@ndcunningham ndcunningham marked this pull request as ready for review March 11, 2025 06:42
@ndcunningham ndcunningham force-pushed the feat/react-router-app-generator branch from bdc36b8 to ccc48b6 Compare March 11, 2025 14:33
@xiongemi
Copy link
Copy Markdown
Contributor

xiongemi commented Mar 11, 2025

just got a question: what is the diff between --routing and --useReactRouter? if i pass in --routing, would be there other routing library to use?

Comment thread packages/react/src/generators/application/application.ts Outdated
Comment thread packages/react/src/utils/versions.ts Outdated
@ndcunningham
Copy link
Copy Markdown
Contributor Author

ndcunningham commented Mar 12, 2025

just got a question: what is the diff between --routing and --useReactRouter? if i pass in --routing, would be there other routing library to use?

You get react-router-dom similar to what is on master. The --useReactRouter is to future-proof so we can also support library mode for react router without impacting users currently using react-router-dom.

…act generator

This also removes Remix from create-nx-workspace (React->Remix)
@ndcunningham ndcunningham force-pushed the feat/react-router-app-generator branch from f2ee2f9 to 28c2e51 Compare March 14, 2025 17:16
@FrozenPandaz FrozenPandaz merged commit 363088a into master Mar 14, 2025
@FrozenPandaz FrozenPandaz deleted the feat/react-router-app-generator branch March 14, 2025 19:06
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scope: react Issues related to React support for Nx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants