Skip to content

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Aug 11, 2025

Description

This is mostly for debugging and it's expected to work (or we need to make it work) anyways, so removing unnecessary options. For debugging purpose, we still provide DEBUG=vite-rsc:* flag.


(EDIT: The following is addressed by #705)

Actually that's not entirely the case. This potentially dual modules of the one optimized and one not optimized cannot be supported out of the box. This use case can only work when users explicitly add optimizeDeps.exlucde for such client dependency. At least, we need a different and more robust way to detect this situation and still gives a warning.

// TODO: suggest `optimizeDeps.exclude` and skip warning if that's already the case.
const ignored = useClientPluginOptions.ignoredPackageWarnings?.some(
(pattern) =>
pattern instanceof RegExp
? pattern.test(id)
: id.includes(`/node_modules/${pattern}/`),
)
if (!ignored) {
this.warn(
`[vite-rsc] detected an internal client boundary created by a package imported on rsc environment`,
)
}

@hi-ogawa hi-ogawa changed the title fix(rsc): disable ignoredPackageWarnings fix(rsc): remove ignoredPackageWarnings Aug 11, 2025
@hi-ogawa hi-ogawa changed the title fix(rsc): remove ignoredPackageWarnings fix(rsc): replace ignoredPackageWarnings with DEBUG env Aug 13, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review August 13, 2025 02:15
@hi-ogawa hi-ogawa changed the title fix(rsc): replace ignoredPackageWarnings with DEBUG env fix(rsc): deprecate ignoredPackageWarnings option in favor of DEBUG env Aug 13, 2025
@hi-ogawa hi-ogawa changed the title fix(rsc): deprecate ignoredPackageWarnings option in favor of DEBUG env fix(rsc): deprecate opt-out ignoredPackageWarnings option in favor of ont-in DEBUG env Aug 13, 2025
@hi-ogawa hi-ogawa merged commit 5d5edd4 into main Aug 13, 2025
24 checks passed
@hi-ogawa hi-ogawa deleted the fix-remove-ignoredPackageWarnings branch August 13, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant