A `from` union should result in a intersection of relative `to` paths
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Router
Describe the bug
When from is a union of different paths, to allows a union of relative paths for from instead of an intersection, resulting in invalid links.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Use a
fromthat is an union of different valid paths - Write a relative
to
Expected behavior
to should only allow relative paths that are valid for all from paths.
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Chrome
- Version: 131.0.6778.140
Additional context
I wonder if this can be done in TS 🤔
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and the referenced files: src/Page.tsx, src/routes/__root.tsx, src/routes/posts/post/$postId.tsx, and src/routes/users/user/$userId.tsx. Reproduce a relative to with a union-valued from, then trace the router's TypeScript path types. Done means invalid relative paths are rejected when they are not valid for every from path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100