ui-kit icon indicating copy to clipboard operation
ui-kit copied to clipboard

POC: react router migration compatibility mode setup

Open Sarah4VT opened this issue 2 years ago • 3 comments

Summary

This is a very small POC to see how the react-router-dom-v5-compat package works and if it would be a good fit for us to leverage as we migrate from react-router v5 -> v6. It was mentioned at the very top of the official React-Router migration from v5 docs, and I didn't see it discussed (good or bad) in the RFC, so I assumed if it had been considered and rejected already, that would have been documented in the RFC.

It seems to allow us to use the new v6 API's at the same time we use v5 features which allows for a gradual migration without breakages.

Description

The first commit sets up the package.

The second commit shows examples of a file fully migrated to using v6 only features. It also includes a file that demonstrates mixed v5 and v6 features in a single file.

Other notes

I tried to do this POC on app kit which probably has more interesting routes, but it's been a minute since I've worked in that project and I couldn't get it running and it was past Europe time zone to get chapter help. So I decided to try it in UI kit at least, but it's hard for me to test as I think these files are the Percy visual test files? I was going to open a PR anyways for people to review the code that was required to do this, but I'm watching to see if the visual tests pass, because I've never run these locally as I don't have the access to update them anyways.

Sarah4VT avatar Sep 26 '24 20:09 Sarah4VT

⚠️ No Changeset found

Latest commit: 8979e5ea30c8e9fffe9bf7965fde4471648b5d2a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Sep 26 '24 20:09 changeset-bot[bot]

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

Name Status Preview Comments Updated (UTC)
ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 8:01pm

vercel[bot] avatar Sep 26 '24 20:09 vercel[bot]

Hi @Sarah4VT

The changes you are making here can be tested locally by running the Visual Testing App which is the one also used for the Percy integration. You just need to build the packages and then start the app by running this commands:

# Build packages
yarn build

# Start app
yarn visual-testing-app:start

You can then access the application in http://localhost:3000

CarlosCortizasCT avatar Sep 27 '24 10:09 CarlosCortizasCT

We finally decided not using the compatibility mode.

CarlosCortizasCT avatar Oct 28 '24 17:10 CarlosCortizasCT