feat: forward parsePath and createPath from history#8278
feat: forward parsePath and createPath from history#8278timdorr merged 8 commits intoremix-run:devfrom
parsePath and createPath from history#8278Conversation
|
We can expose |
|
I see. Let me check what I am using in my code |
|
This is what we use: Values:
Types:
|
|
As Michael said, we anticipate some major changes to history and don't want to couple that API to React Router's. In v6, history even became an internal dependency.
|
parsePath and createPath from history
|
@ryanflorence - I updated the PR with only the relevant exports. Is this good? |
brophdawg11
left a comment
There was a problem hiding this comment.
@KutnerUri I think this looks good - one callout about also exporting Search, and then there's some conflicts likely due to a recent prettier change in dev. If you wouldn't mind getting those fixed up, I think this is in good shape to merge 👍
|
@brophdawg11 done, go ahead |
|
@KutnerUri Can you also add your name to the CLA signature file? That's required for merging. |
|
@timdorr - what is that? the |
|
Ah, apologies, you started this PR before the bot was in place, so it never posted its comment here. That looks like this: #8689 (comment) But yes, you should add your username to that file. |
|
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
|
@timdorr - any idea why this test is failing? I am clearly forwarding the export from |
|
wait I see it.. |
|
There we go. Thanks! |
parsePath and createPath from historyparsePath and createPath from history
When using React Router, it is common to use advanced history methods, like
parsePathandcreatePath.React Router has a strong dependency on History, so whenever RR updates, or history releases a new version, we get errors (usually just types) and are forced to match our application History with the current version of History RR's is using. It's frustrating.
We literally just use History to use RR's features.
For this reason, it makes sense to forward History from React Router, or just the methods RR is using (
parsePath,createMemoryHistory(?),createBrowserHistory,createHashHistory,createPath).(I can make a separate PR for that, if you'd like)
It is cheap, and create a lot of value for the community.