Skip to content

Conversation

markdalgleish
Copy link
Member

@markdalgleish markdalgleish commented May 9, 2025

The values passed to optimizeDeps.entries are expected to be tinyglobby patterns, not file paths. We're currently passing file paths which means that any special matching characters in file names will accidentally trigger pattern matching.

To fix this, we now pass all paths through escapePath.

In terms of versioning, I've ensured we depend on the same tinyglobby version range as Vite: https://github.com/vitejs/vite/blob/main/packages/vite/package.json#L93

Note that in Vite v5, the globs are passed to fast-glob instead of tinyglobby, but since tinyglobby is a drop-in replacement, we don't need to do any version detection.

Copy link

changeset-bot bot commented May 9, 2025

🦋 Changeset detected

Latest commit: d050831

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch
react-router Patch
react-router-dom Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch

Not sure what this means? Click here to learn what changesets are.

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

@markdalgleish markdalgleish marked this pull request as draft May 12, 2025 00:16
@markdalgleish
Copy link
Member Author

This PR was opened to address an issue raised in Discord, but it looks like it might be an underlying Vite issue. I'm marking this as draft for now until we track down what the issue is.

Copy link
Member Author

@markdalgleish markdalgleish left a comment

Choose a reason for hiding this comment

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

Closing in favour of #13748.

@markdalgleish markdalgleish deleted the markdalgleish/escape-optimize-deps-entries branch August 29, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant