Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Rolldown with Vite v6 #43

Draft
wants to merge 63 commits into
base: main
Choose a base branch
from
Draft

Using Rolldown with Vite v6 #43

wants to merge 63 commits into from

Conversation

sapphi-red
Copy link

@sapphi-red sapphi-red commented Sep 12, 2024

Description

Applied changes from #24 and #27 to the main branch after the environment API PR is merged.
Also fixed errors on Windows and cleaned up some unneeded changes.

#24 implemented build-time dep optimization partially, but I didn't include that change in this PR.

e2e test status

❌ to pass test on Windows, oxc-project/oxc-resolver#322 needs to be fixed

Playground Name Dev Build Reasons
alias
assets NOTE: watch mode tests are skipped
assets-sanitize
backend-integration NOTE: changed the test case that was relying on rollup specific chunking behavior (rolldown/rolldown#1842 (comment))
build-old -
cli -
cli-module -
config -
csp -
css -
css-codesplit NOTE: uses advancedChunks instead of manualChunks
css-codesplit-cjs -
css-dynamic-import
css-lightningcss -
css-lightningcss-proxy -
css-lightningcss-root -
css-no-codesplit -
css-sourcemap -
data-uri -
define -
dynamic-import
dynamic-import-inline -
env -
env-nested -
environment-react-ssr ⚠️ -
extensions -
external rolldown/rolldown#2041
fs-serve -
glob-import ⚠️ NOTE: passing but workarounds are applied to get around rolldown/rolldown#2394
hmr -
hmr-root - -
hmr-ssr -
html ⚠️ NOTE: passing but rolldown/rolldown#2781 should be fixed to make it work correctly in some cases
import-assertion -
js-sourcemap NOTE: uses advancedChunks instead of manualChunks
json -
legacy 🟡pending support system format
lib -
minify - -
module-graph - -
multiple-entrypoints -
nested-deps -
object-hooks object hook sequential
optimize-deps rolldown/rolldown#2031
optimize-deps-no-discovery -
optimize-missing-deps -
preload -
preserve-symlinks -
proxy-bypass -
proxy-hmr -
resolve NOTE: skipped some browser field related tests as those cases were only supported by esbuild and Vite, also skipped some test that does fallback based on the file content which is Vite only and I believe it should not be done
resolve-config -
ssr -
ssr-alias -
ssr-conditions -
ssr-deps -
ssr-html -
ssr-noexternal - -
ssr-pug -
ssr-resolve - -
ssr-webworker
tailwind -
tailwind-sourcemap -
transform-plugin
tsconfig-json experimental decorators and useDefineForClassFields: false is not supported by oxc (rolldown/rolldown#2296, oxc-project/oxc#6735)
tsconfig-json-load-error -
wasm -
worker -

missing feature list that was supported by esbuild / rollup

oxc missing feature list that was supported by esbuild

native plugin incompatibilities

TODO list for me

  • think about what to do with commonjsOptions
  • vitepress assigns to bundle: https://github.com/vuejs/vitepress/blob/68150a6f3349c1741ed5683e3010d9ecea02f3a8/src/node/plugin.ts#L353-L362
  • organize what is left to make it possible to release rolldown-vite / rolldown-vite (with native plugins)
    • rolldown-vite
      • first make a resolver plugin using oxc-resolver and add an option to use that in non-rolldown vite?
    • rolldown-vite (with native plugins)
      • how to make native plugins work in dev? (e.g. use non-native for dev)
  • convert esbuild.tsconfigRaw/esbuild.tsconfig to oxc

@sapphi-red sapphi-red marked this pull request as draft September 12, 2024 07:05
@sapphi-red sapphi-red changed the title Rolldown v6 Using Rolldown with Vite v6 Sep 12, 2024
@sapphi-red sapphi-red force-pushed the rolldown-v6 branch 10 times, most recently from 1d231ee to 2087832 Compare September 18, 2024 09:15
@IWANABETHATGUY
Copy link

IWANABETHATGUY commented Sep 20, 2024

FYI,

alias: does not support customResolver option

this is by design, if use customResolver in native plugin, there is no performance difference between js Alias and rust alias, since you always need to perform a tsfn, and make plugin execute single threaded

@IWANABETHATGUY
Copy link

for all native plugin incompatibilities section, could you give a more specific testcase?

@sapphi-red
Copy link
Author

@IWANABETHATGUY I've made reproductions for the cases other than resolve plugin related ones. (I'm going to make for the resolve related ones now.)

@sapphi-red
Copy link
Author

sapphi-red commented Sep 24, 2024

I fixed the import-meta glob reproduction; it was using import.meta.dirname but wasn't supported by stackblitz yet.

@IWANABETHATGUY
Copy link

IWANABETHATGUY commented Sep 24, 2024

I fixed the import-meta glob reproduction; it was using import.meta.dirname but wasn't supported by stackblitz yet.

Can you file these issues on rolldown?

@sapphi-red
Copy link
Author

Made the reproductions for resolve related ones.

Can you file these issues on rolldown?

Did you mean to quote #43 (comment) instead of #43 (comment), right?

@IWANABETHATGUY
Copy link

Made the reproductions for resolve related ones.

Can you file these issues on rolldown?

Did you mean to quote #43 (comment) instead of #43 (comment), right?

Sorry, yeah I mean #43 (comment)

@sapphi-red
Copy link
Author

Done 👍

I didn't make an issue for "manifest: cannot use data on Vite side (e.g. css/assets) and needs to be environment-specific" and "does not support vitejs#12786 (reproduction, expected to have console.log preserved in the output)" for now as I'm not sure what the next step is and the issue will be opaque / unactionable.

Copy link

pkg-pr-new bot commented Oct 15, 2024

Open in Stackblitz

npm i https://pkg.pr.new/rolldown/vite@43

commit: 5a51f96

@IWANABETHATGUY
Copy link

Maybe we should squash it instead of merge

* feat: use oxc for the scanner and pass non-js files directly to rolldown
* feat: use builtin transform for optimizer rolldown
* feat: use filter for the plugins for optimizer
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.

4 participants