react-router icon indicating copy to clipboard operation
react-router copied to clipboard

fix: Fix for typegen issue

Open AlemTuzlak opened this issue 1 year ago • 3 comments

As the title said, I found this issue while testing out the new typegen and I have a sitemap that's located under /sitemap/$lang[.]xml which caused it to generate a param lang.xml which is invalid TS and it broke the typefile.

How to repro:

  1. create a pre-release repo
  2. add sitemap/$lang[.]xml.ts to routes and use the flat-routes routing convention
  3. run typegen (before the output was lang.xml, now it's lang)
  4. go to the +types/filename and check the Params

AlemTuzlak avatar Oct 15 '24 12:10 AlemTuzlak

Hi @AlemTuzlak,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

remix-cla-bot[bot] avatar Oct 15 '24 12:10 remix-cla-bot[bot]

⚠️ No Changeset found

Latest commit: 824d0891a0a088d4237ed7f8bb79a89c6a95d223

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 Oct 15 '24 12:10 changeset-bot[bot]

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

remix-cla-bot[bot] avatar Oct 15 '24 12:10 remix-cla-bot[bot]

Superseded by #12246

Thanks for looking into this @AlemTuzlak ! 🙏 The solution turned out to be a fair bit more involved since it surfaced a couple undocumented behaviors of React Router and needed to be consistent with RR on how it parsed the params, which is why a separate PR was warranted.

pcattori avatar Nov 07 '24 20:11 pcattori

Ahh shoot, I'll become a react-router contributor one day! Glad you managed to figure it out @pcattori, glad to help!

AlemTuzlak avatar Nov 07 '24 20:11 AlemTuzlak