Skip to content

chore: use rolldown-vite#933

Draft
hi-ogawa wants to merge 2 commits into
mainfrom
06-11-chore_test_rolldown-vite
Draft

chore: use rolldown-vite#933
hi-ogawa wants to merge 2 commits into
mainfrom
06-11-chore_test_rolldown-vite

Conversation

@hi-ogawa
Copy link
Copy Markdown
Owner

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

repository-wide fix is extracted from #931

Copy link
Copy Markdown
Owner Author

hi-ogawa commented Jun 11, 2025

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@hi-ogawa hi-ogawa mentioned this pull request Jun 11, 2025
7 tasks
@hi-ogawa hi-ogawa changed the title chore: test rolldown-vite chore: use rolldown-vite Jun 11, 2025
@hi-ogawa hi-ogawa mentioned this pull request Jun 11, 2025
9 tasks
@hi-ogawa hi-ogawa force-pushed the 06-11-chore_test_rolldown-vite branch from 06fcdcd to 4b2dff1 Compare June 11, 2025 06:57
@hi-ogawa hi-ogawa changed the base branch from 06-10-feat_support_rolldown-vite to graphite-base/933 June 11, 2025 07:21
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.
@hi-ogawa hi-ogawa force-pushed the 06-11-chore_test_rolldown-vite branch from 4b2dff1 to ff60b77 Compare June 11, 2025 07:21
@hi-ogawa hi-ogawa force-pushed the graphite-base/933 branch from 6d871ca to 5e8f56b Compare June 11, 2025 07:21
@hi-ogawa hi-ogawa changed the base branch from graphite-base/933 to main June 11, 2025 07:22
@hi-ogawa hi-ogawa force-pushed the 06-11-chore_test_rolldown-vite branch from ff60b77 to bfaaab8 Compare June 11, 2025 07: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