You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's hard to build a new ecosystem from scratch, to make Farm production-ready as quick as possible, Farm chooses to be compatible with Vite since 0.13.
For the Future, Farm team will focus on Rust - write faster tools in Rust, instead of re-develop existing JS Plugins, Farm will try to reuse Vite's ecosystem as much as possible.
Because Farm uses a rollup-style plugin system, Farm can be compatible with Vite easily. Currently, Farm has compatible with following hooks, Farm will be compatible with most Vite plugins hook in 1.0.
Plugin Compatibility
Build stage hooks to be supported:
config
configResolved
configureServer
apply
buildStart
resolveId
load
transform
buildEnd
handleHotUpdate
transformIndexHtml
shouldTransformCachedModule
moduledParsed
Generate stage hook to be supported:
renderChunk
argumentChunkHash
generateBundle
writeBundle
renderStart
closeBundle
Generate stage hook supported since V0.15
Other hooks are not supported.
API Compatibility
import.meta.hot
accept
dispose
prune
data
decline
invalidate
on
off
send
import.meta.hot supported since 0.15
ViteDevServer
config: transformed from Farm's server config.
middlewares: fully supported
httpServer: fully supported
watcher: fully supported
ws: fully supported
moduleGraph: partial supported.
pluginContainer
resolvedUrls: does not support
transfromRequest: does not support
transformIndexHtml: does not support
ssrLoadModule: does not support
ssrFixStacktrace: not supported. do nothing as Farm does not need it.
exportclassModuleNode{/** * Public served url path, starts with / * The same as url in Farm, cause Farm may not serve module separately */url: string/** * Resolved file system path + query */id: string|null=nullfile: string|null=nulltype: 'js'|'css'// following fields are not supported// info?: ModuleInfo// meta?: Record<string, any>// importers = new Set<ModuleNode>()// clientImportedModules = new Set<ModuleNode>()// ssrImportedModules = new Set<ModuleNode>()// acceptedHmrDeps = new Set<ModuleNode>()// acceptedHmrExports: Set<string> | null = null// importedBindings: Map<string, Set<string>> | null = null// isSelfAccepting?: boolean// transformResult: TransformResult | null = null// ssrTransformResult: TransformResult | null = null// ssrModule: Record<string, any> | null = null// ssrError: Error | null = null// lastHMRTimestamp = 0// lastInvalidationTimestamp = 0// get importedModules(): Set<ModuleNode> {// const importedModules = new Set(this.clientImportedModules)// for (const module of this.ssrImportedModules) {// importedModules.add(module)// }// return importedModules// }}
watcher
What does the proposed API look like?
Using Vite plugins in Farm out of box:
import{defineConfig}from'@farmfe/core';importvuefrom'@vitejs/plugin-vue';exportdefaultdefineConfig({// using plugins in vitePlugins and everything would work finevitePlugins: [vue()]});
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
It's hard to build a new ecosystem from scratch, to make Farm production-ready as quick as possible, Farm chooses to be compatible with Vite since 0.13.
For the Future, Farm team will focus on Rust - write faster tools in Rust, instead of re-develop existing JS Plugins, Farm will try to reuse Vite's ecosystem as much as possible.
Because Farm uses a rollup-style plugin system, Farm can be compatible with Vite easily. Currently, Farm has compatible with following hooks, Farm will be compatible with most Vite plugins hook in 1.0.
Plugin Compatibility
Build stage hooks to be supported:
Generate stage hook to be supported:
Other hooks are not supported.
API Compatibility
import.meta.hot
ViteDevServer
config
: transformed from Farm's server config.middlewares
: fully supportedhttpServer
: fully supportedwatcher
: fully supportedws
: fully supportedmoduleGraph
: partial supported.pluginContainer
resolvedUrls
: does not supporttransfromRequest
: does not supporttransformIndexHtml
: does not supportssrLoadModule
: does not supportssrFixStacktrace
: not supported. do nothing as Farm does not need it.reloadModule
: does not supportlisten
: does not supportrestart
: does not supportclose
: does not supportbindCLIShortcuts
: does not supportconfig
following field supported:
pluginContainer
moduleGraph
ModuleNode: partially supported
watcher
What does the proposed API look like?
Using Vite plugins in Farm out of box:
The text was updated successfully, but these errors were encountered: