chore: use rolldown-vite#933
Draft
hi-ogawa wants to merge 2 commits into
Draft
Conversation
Owner
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. This stack of pull requests is managed by Graphite. Learn more about stacking. |
7 tasks
06fcdcd to
4b2dff1
Compare
hi-ogawa
added a commit
that referenced
this pull request
Jun 11, 2025
## todo
- [x] `@oxc-project/types` mismatches with `estree`.
- quick workaround via tsconfig paths `"@oxc-project/types": ["./node_modules/@types/estree"]`
- [x] `const { default } = ...` syntax error tolerated by rollup/swc, but now oxc surfaces. should be fixed on my side.
- [x] `pnpm -C packages/rsc/examples/basic build` doesn't bundle `virtual:xxx`
- it looks like `{ id: "\0xxx", external: true }` isn't handled well by rolldown. probably we can fix on our side for now since this technique looks already sketchy.
- dynamic import external rendering seems to have an issue https://github.com/hi-ogawa/reproductions/tree/main/rolldown-resolveId-external-null-byte
- [x] `pnpm -C packages/rsc/examples/react-router test-e2e-cf-preview` errors with `No such module "node:module"`
- it looks like forcing `{ external: true }` is causing rolldown to keep this import as bare import https://github.com/cloudflare/workers-sdk/blob/f45208ca588d0565fa4e3abcee7be3974a1ef85d/packages/vite-plugin-cloudflare/src/index.ts#L839-L844
> Unexpected Node.js imports for environment "rsc". Do you need to enable the "nodejs_compat" compatibility flag? Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.
> "node:module" imported from "rolldown:runtime"
- vitejs/rolldown-vite#248
- workaround by `build.rollupOptions.platform: "neutral"`
- [x] `pnpm -C packages/react-server/examples/basic cf-build` errors with `node:module`
- this is different from above. there's `__require("react")` inside `require_use_sync_external_store_shim` in ssr build. the dependency is coming from `react-tweet -> swr -> use-sync-external-store -> react` where `react-tweet` is in `noExternal`, but `react` is externalized.
- vitejs/rolldown-vite#249
- workaround by manually transforming `require("react")` to `import "react"`
- [x] setup CI
- [ ] check native plugins
---
This PR only fixes `packages/rsc` to not break rolldown. Other repository-wide fixes and example fixes are extracted to #933.
4b2dff1 to
ff60b77
Compare
6d871ca to
5e8f56b
Compare
This reverts commit 5388d3f.
ff60b77 to
bfaaab8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

repository-wide fix is extracted from #931