Skip to content

docs: Migrate to tanstack router#2895

Draft
MichaelParadis wants to merge 14 commits intomasterfrom
MIKE/migrate-to-tanstack-router
Draft

docs: Migrate to tanstack router#2895
MichaelParadis wants to merge 14 commits intomasterfrom
MIKE/migrate-to-tanstack-router

Conversation

@MichaelParadis
Copy link
Contributor

@MichaelParadis MichaelParadis commented Feb 2, 2026

Motivations

There are some improvements we want to make to the doc site such as linking directly to tabs and using hashes to link directly to headings. While react-router-dom supports this type of stuff we are currently using a super old version (react router dom v5 which was last updated 2 years ago). Since it was such an old version finding resources for this version would be difficult.

In theory I could have updated react-router-dom on the docs site, however I decided to migrate to tanstack router for the following reasons:

  1. There was a ticket to migrate to tanstack router https://jobber.atlassian.net/browse/JOB-111826
  2. TSR is the library we use in other repos

Future work

  1. There is some casting / messy code for the search parameters at the moment. For example here and here I want to clean these up. They were initially added while I was trying to figure out the existing logic with the search params because in some places we were using window.location and updating that manually instead of leveraging react-router-dom
  2. Simplify logic for determine the platform and version of a component being displayed. There are two places were similar code is defined.
    i. In useAtlantisPreviewViewer here
    ii. In ComponentView to determine the tab and update the preview based on the tab / version here
  3. Use file based routing instead of code based routing to reduce the need for routes to be defined in two places for side nav navigation. The two places are routeTree.gen.ts and routes.ts
  4. Adding support for copying and going to headings in other tabs (for example the implement tab)

Changes

  • Migration from react-router-dom to tanstack router. Mostly handled by cursor.
  • Use tanstack router path params for the following:
    1. Tab to display (web, mobile and implement)
    2. Component name for the docs
  • Used tanstack router search params for
    1. Determining if the legacy or v2 versions of components should be shown
    2. Determining if the minimal version of the site should be used
  • Added mdx plugins for generating the table of contents for the design tab
  • Added support for copying the link to a heading on the design tab

Added

  • Added ability to link to the tabs on a component

Changed

Deprecated

Removed

Fixed

Security

Testing

Changes can be
tested via Pre-release


In Atlantis we use Github's built in pull request reviews.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 2, 2026

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 55fdb50
Status: ✅  Deploy successful!
Preview URL: https://b20effad.atlantis.pages.dev
Branch Preview URL: https://mike-migrate-to-tanstack-rou.atlantis.pages.dev

View logs


useEffect(() => {
if (code) {
console.log("updating code");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant