github wyw-in-js/wyw-in-js @wyw-in-js/vite@2.6.0

Minor Changes

  • a8e53b1: Add opt-in worker threads for transforms. The Vite, esbuild and Bun plugins and the webpack loader accept parallel: true (up to four workers) or a worker count, and the CLI accepts --workers <count>. Each worker keeps its own cache, a file always returns to the worker that transformed it first, and module resolution still goes through the bundler on the main thread. Options are sent to the workers as data, so function options must be defined in a wyw-in-js config file; with function options or debug reporting, transforms stay on the main thread and a warning explains why. Workers split the parsed-AST cache budget of one process between them and start with a 1.5 GB heap limit, which is raised when a worker runs out of memory. @wyw-in-js/transform also exports the underlying TransformWorkerPool and the createParallelTransforms helper for wyw-in-js integrations; they are experimental and may change in a minor release.

Patch Changes

  • df2c701: Stop repeating config-file discovery for every transformed module. The Vite plugin now passes one options object per environment, so normalized options are reused across files, and loadWywOptions remembers the discovered config file (or its absence) per working directory for adapters that still build options per module. A remembered config file that disappears is searched for again; a config file created after the first transform is picked up after a restart.
  • 849af93: Stop the eval runner after every build of vite build --watch, not only after the first one. A runner started by a rebuild kept running after the watcher was closed and kept the Node.js process alive.
  • 849af93: Rebuild a file in watch mode when a module its styles are evaluated from changes. Imports that are only needed to compute styles at build time are removed from the transformed code, so the bundler did not know about them: Rollup watch, esbuild watch and vite build --watch kept the old CSS after such a module was edited. The plugins now register the resolved files of these dependencies, including the modules reached through them, as watched files (this.addWatchFile in Rollup and Vite, watchFiles in esbuild). Modules inside node_modules are not watched. The Vite dev server is unchanged: it already handles these edits through hot updates.
  • Updated dependencies
    • @wyw-in-js/shared@2.6.0
    • @wyw-in-js/transform@2.6.0

Don't miss a new wyw-in-js release

NewReleases is sending notifications on new releases.