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

Plugin Compat Status #819

Open
underfin opened this issue Apr 10, 2024 · 0 comments
Open

Plugin Compat Status #819

underfin opened this issue Apr 10, 2024 · 0 comments
Labels

Comments

@underfin
Copy link
Contributor

underfin commented Apr 10, 2024

Here is a status list of rolldown plugin api compatible with rollup.

The function hooks

  • options
  • buildStart
  • buildEnd
  • renderStart
  • renderError
  • generateBundle
  • writeBundle
  • resolveId
    i. the argument fileds assertions custom is not support
    ii. the return value fileds resolvedBy absolute/relative external assertions meta moduleSideEffects syntheticNamedExports is not support
  • load
    i.the return value fileds assertions meta moduleSideEffects syntheticNamedExports is not support, the ast will not support
  • transform
    i.the return value fileds assertions meta moduleSideEffects syntheticNamedExports is not support, the ast will not support
  • renderChunk
    i. the argument meta is not support
  • moduleParsed
    i. the argument moduleInfo is partially compatible
  • banner
  • footer
  • intro
  • outro
  • resolveDynamicImport, the options#assert is not supported
  • shouldTransformCachedModule
  • outputOptions
  • resolveFileUrl
  • resolveImportMeta
  • renderDynamicImport
  • augmentChunkHash
  • closeBundle
  • closeWatcher
  • onLog, the meta is not compatable.
  • watchChange

The object hooks

The object hooks is not support at now.

The Plugin Context

The PluginContext is not support at now.

Not Compatible

  • meta
  • addWatchFile
  • cache
  • emitFile
  • getFileName
  • getModuleIds
  • getModuleInfo
  • getWatchFiles
  • load
  • parse, it is unsupported, please diretly using acron instead of it.
  • setAssetSource
  • getCombinedSourcemap
  • debug
  • error
  • info
  • warn
  • resolve, need to support skipSelf options

Vite Plugins Compatibility

plugins marked with * means it might be a good candidate to be implemented directly as a built-in in Rust

  • assetPlugin, need to PluginContext#emitFile PluginContext#getModuleInfo PluginContext#addWatchFile .
  • assetImportMetaUrlPlugin need to PluginContext#emitFile PluginContext#getModuleInfo PluginContext#parse
  • clientInjectionsPlugin
  • completeSystemWrapPlugin
  • cssPlugin need to PluginContext#emitFile PluginContext#getModuleInfo
  • cssPostPlugin need to PluginContext#getFileName PluginContext#emitFile RenderedChunk#name augmentChunkHash
  • cssAnalysisPlugin
  • dataURIPlugin
  • definePlugin
  • *dynamicImportVarsPlugin
  • esbuildPlugin
  • buildEsbuildPlugin
  • htmlInlineProxyPlugin
  • buildHtmlPlugin need to PluginContext#emitFile PluginContext#getFileName PluginContext#getModuleInfo
  • importAnalysisPlugin
  • buildImportAnalysisPlugin
  • importGlobPlugin
  • jsonPlugin
  • loadFallbackPlugin need to PluginContext#addWatchFile
  • manifestPlugin need to OutputChunk/RenderedChunk#name PluginContext#emitFile PluginContext#getFileName
  • metadataPlugin need to mutate( add extra fileds) renderChunkArgs#RenderedChunk and using it at augmentChunkHash/generateBundle.
  • modulePreloadPolyfillPlugin
  • optimizedDepsPlugin
  • preAliasPlugin
  • buildReporterPlugin need to PluginContext#getModuleInfo
  • resolvePlugin need to PluginContext#getModuleInfo ModuleInfo#meta
  • splitVendorChunkPlugin need to manualChunks. @deprecated
  • terserPlugin
  • wasmFallbackPlugin
  • wasmHelperPlugin need to PluginContext#emitFile PluginContext#getModuleInfo
  • webWorkerPostPlugin need to resolveImportMeta
  • webWorkerPlugin need to shouldTransformCachedModule PluginContext#emitFile PluginContext#getModuleInfo
  • workerImportMetaUrlPlugin need to shouldTransformCachedModule PluginContext#emitFile PluginContext#getModuleInfo
  • ssrManifestPlugin need to PluginContext#emitFile
  • @vitejs/plugin-vue need to TransformReturnValue#meta
  • @vitejs/plugin-react

Rollup Official Plugins Compatibility

plugins marked with * means it might be a good candidate to be implemented directly as a built-in in Rust

  • @rollup/plugin-alias, you can using resolver.alais to do it at rolldown.
  • @rollup/plugin-auto-install
  • @rollup/plugin-beep
  • @rollup/plugin-commonjs, rolldown internal support it
  • * @rollup/plugin-data-uri
  • @rollup/plugin-dsv
  • * @rollup/plugin-eslint, export oxc_lint is better at rolldown
  • * @rollup/plugin-esm-shim, it using regex to replace __dirname/require/__dirname
  • @rollup/plugin-graphql
  • * @rollup/plugin-image need to PluginContext#addWatchFile(it convert image to data uri)
  • * @rollup/plugin-inject using PluginContext#parse
  • * @rollup/plugin-json
  • * @rollup/plugin-legacy
  • * @rollup/plugin-multi-entry need to options/outputOptions hook
  • * @rollup/plugin-replace
  • @rollup/plugin-run
  • * @rollup/plugin-strip using PluginContext#parse,it look like minify to remove debugger.console.log etc
  • @rollup/plugin-sucrase
  • * @rollup/plugin-swc, rolldown using oxc transformer at inter, it is unnecessary.
  • * @rollup/plugin-terser using oxc minify at future.
  • * @rollup/plugin-virtual, we could provider a rust plugin to make it faster
  • @rollup/plugin-yaml
  • @rollup/plugin-url need to PluginContext#addWatchFile
  • * @rollup/plugin-typescript using PluginContext#emitFile
  • @rollup/plugin-wasm need to PluginContext#emitFile PluginContext#addWatchFile
  • * @rollup/plugin-babel need to options hook and export the TransfromPluginContext to user. rolldown using oxc transformer at inter, it is unnecssary
  • @rollup/plugin-node-resolve, rolldown internal support it
  • *@rollup/plugin-html need to PluginContext#emitFile
  • * @rollup/plugin-dynamic-import-vars using PluginContext#parse
  • @rollup/plugin-buble need to catch plugin transfrom hook throw error

Vite Ecosystem

analog

  • jitPlugin need to find plugin by plugin name at buildStart options, then using the plugin transform, see here

astro

  • astroScannerPlugin need to using PluginContext#getModuleInfo as TransformResult#meta, see here, (todo find usage)
  • markdown need to LoadResult#meta
  • html need to mutate NormalizedOption#plugins at options hook, see here
  • astroHeadBuildPlugin need to mutate ModuleInfo#meta using PluginContext#getModuleInfo at generateBundle hook, see here
  • postprocess direct using acorn#parse
  • vitePluginAnalyzer using ModuleInfo#meta by PluginContext#getModuleIds/getModuleInfo at generateBundle hook, see here
  • vitePluginContent mutate NormalizedOption#input at options hook, see here, mutate NormalizedOption#manualChunks at same file
  • css TODO

histoire

mutate NormalizedOption#external(look like is not correct), see here

qwik

qwikCityPlugin used moduleSideEffect: no-treeshake, see here

@yyx990803 yyx990803 pinned this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant