Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

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

Copy link

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 13, 2025 9:54pm

Copy link

nx-cloud bot commented Mar 9, 2025

View your CI Pipeline Execution ↗ for commit f2ee2f9.

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

☁️ Nx Cloud last updated this comment at 2025-03-13 22:20:14 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
Collaborator

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?

@ndcunningham
Copy link
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: react Issues related to React support for Nx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants