Releases: shakacode/shakapacker
Release list
v10.3.0
Added
Fixed
- Fixed implicit SWC defaults for existing webpack/Babel apps without
swc-loader. PR #1206 by justin808. Webpack apps that omit bothjavascript_transpilerand the deprecatedwebpack_loadernow fall back to Babel with a warning when Shakapacker's bundled SWC default is active,swc-loaderis missing, and Babel is present. Explicit transpiler settings, webpack apps withswc-loader, and Rspack's built-in SWC path keep their existing behavior. Closes #1203. - Fixed JavaScript config loading for missing Rails environments to use the production fallback. PR #1206 by justin808. When
RAILS_ENVhas no matching section inconfig/shakapacker.yml, the Node package config now merges theproductionsection instead of only bundled defaults, matching Ruby configuration loading and honoring explicit productionjavascript_transpiler,source_path,dev_server, and related settings for custom environments such as staging. - Fixed helper binstubs delegating Node resolution to Ruby
execin unset and emptyPATHenvironments. PR #1200 and PR #1201 by justin808. Restores shell-compatible Node lookup forbin/shakapacker-configandbin/diff-bundler-configafter thev10.2.0Ruby-binstub regression, while keeping friendly missing-Node errors forENOENTandEACCES.
v10.2.0
Added
- Added
webpack_compile_flagsconfiguration. PR #1180 by justin808. Allows Rails-driven Shakapacker compiles to pass extra webpack/rspack CLI flags, such as--fail-on-warningsor--progress, throughbin/shakapacker. Fixes #1175. - Added AI analysis prompt generation to the config exporter. PR #695, PR #1184 by justin808. When running doctor mode (
bin/shakapacker-config --doctor), the exporter now also writes anAI-ANALYSIS-PROMPT.md: a ready-to-paste prompt that guides an AI assistant (ChatGPT, Claude, Gemini, etc.) to review the configuration for migration issues (webpack ↔ rspack), build errors, client/server and development/production optimizations, and best practices. The React on Rails–specific guidance in the generated prompt is included only when React on Rails is detected in the app (viapackage.json,Gemfile, orGemfile.lock). This is purely additive; existing exports are unchanged, and a failure to write the prompt file only warns without affecting the exported configs. - Added support for
sass-loaderv17. PR #1141 by fukayatsu. Widened the optionalsass-loaderpeer range to^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0in coreshakapacker,shakapacker-webpack, andshakapacker-rspack. The Sass rule already selectsloadPathsfor v16+ and keepsapi: "modern", both of which remain valid in v17. Note that sass-loader v17 requires Node.js 22.11.0+ and dropsnode-sassand the legacy Sass JS API, so apps that opt into v17 must already be on Node 22.12+ (the upper branch of Shakapacker'sengines.noderange). - Added Babel 8 peer dependency support. PR #1187 by justin808. Widened the Babel peer ranges in core
shakapackerand theshakapacker-webpacksupplemental package to allow Babel 8, and updated the Shakapacker Babel preset to omit options removed in Babel 8 while preserving existing Babel 7 behavior. Repository development pins stay on Babel 7, with added compatibility tests covering Babel 8. Refs #1163.
Changed
- New installs now default to Rspack instead of webpack. PR #1150 by justin808.
bundle exec rake shakapacker:installnow scaffolds an Rspack project (config, dependencies, andconfig/shakapacker.yml) by default. This is a new-install default only: existing applications are unaffected. The Rspack default applies only to brand-new installs — re-running the installer on an app that already has aconfig/shakapacker.ymlkeeps that app's current bundler (and installs that bundler's dependencies), so the installer never silently switches an existing project's bundler. To install with webpack, runbundle exec rake shakapacker:install[webpack]or setSHAKAPACKER_ASSETS_BUNDLER=webpack; to change an existing app's bundler, usebundle exec rake shakapacker:switch_bundler. - Changed Rspack support to target Rspack v2 only. PR #1179 by justin808. Core, installer, switch-bundler defaults, supplemental package, dummy app, and docs now use
@rspack/core,@rspack/cli,@rspack/dev-server, and@rspack/plugin-react-refreshv2 ranges. Rspack installs now also requirerspack-manifest-plugin@^5.2.2, andshakapacker-rspackrequirescss-loader@^7.1.4for Rspack v2 peer compatibility. The Rspack React Refresh loader now uses the v2 namedReactRefreshRspackPluginexport instead of retaining legacy v1 export-shape fallbacks.
Fixed
- Fixed helper binstubs and doctor checks for subdirectory JavaScript layouts. PR #1192 by justin808.
bin/shakapacker-configandbin/diff-bundler-confignow resolve package scripts from a configured client package root before falling back to the Rails root, andshakapacker:doctornow searches package metadata, lockfiles, and installed packages across client/root layouts while reducing false SWC dependency issues for custom hybrid webpack/Rspack setups. Fixes #1170 and #1090. - Fixed dev-server passthrough argument validation messages. PR #1180 by justin808.
bin/shakapacker-dev-server -- --host ...or--port ...now fails with a clearer Shakapacker message instead of forwarding the separator to the bundler; setdev_server.hostanddev_server.portinconfig/shakapacker.ymlinstead. - Fixed
shakapacker:export_bundler_configregression on apps upgraded from older Shakapacker versions. PR #1127 by justin808. The task previously invokedbin/shakapacker-configunconditionally viaRbConfig.ruby, which crashed when the file was still the legacy JavaScript binstub (#!/usr/bin/env node) left over from earlier installs. The task now inspects the shebang and exec's the file directly when it points at Node, while keeping the Ruby+RbConfig.rubypath for the current Ruby binstub. Affected users are also nudged to runbundle exec rake shakapacker:binstubsto refresh their helper binstub. Refs #1123. - Fixed
shakapacker:doctorSass implementation detection forsass-embeddedapps. PR #1178 by justin808. The doctor now accepts either modern Sass implementation package (sassorsass-embedded) when Sass files are present, matching Shakapacker's default modern Sass API instead of incorrectly requiring Dart Sass. New installs also includesassalongsidesass-loader. Fixes #1172. - Fixed
Psych::DisallowedClassboot crash whenpnpm-lock.yamlcontains atime:section. PR #1161 by justin808. pnpm >= 10.16 (default in pnpm 11) writes publish timestamps intopnpm-lock.yamlthat Psych 4+ refuses to safe-load, so theshakapacker.version_checkerboot initializer raisedPsych::DisallowedClass: Tried to load unspecified class: Timeand crashed every Rails boot — even when version checking was disabled. The lockfile is now parsed withYAML.safe_load(..., permitted_classes: [Time, Date]). Fixes #1160. - Fixed Rspack dev-server lazy compilation defaults for Rails split dev-server topology. PR #1179 by justin808. Generated Rspack development configs now set top-level
lazyCompilation: falsewhile the dev server is running, preventing Rspack CLI dev-server auto-lazy behavior from routing dynamic imports through lazy trigger URLs Rails does not serve. Apps that intentionally use lazy compilation can still set a safe top-levellazyCompilationvalue in their Rspack config. - Fixed Rspack dev-server config loading during static watch builds. PR #1142 by justin808. The Rspack
devServerconfiguration is now gated behindWEBPACK_SERVE=true, matching the webpack development config, so static watch builds (bin/shakapacker --watch) no longer load the dev-server client. ThedevMiddleware.writeToDiskfilter that skips hot-update files is preserved. Fixes #1137. - Fixed compiler strategies ignoring the instance config of custom
Shakapacker::Instanceobjects. PR #1147 by justin808. Ports #976 by brunodccarvalho. Strategies now read the instance-specific config and watch both webpack and rspack config directories.
v10.1.0
Added
- Added supplemental npm packages
shakapacker-webpackandshakapacker-rspack. PR #1096, PR #1133 by justin808. Optional packages that lockstep with core and declare the managed-build stack as required peer dependencies (so on npm 7+ a singleyarn add shakapacker-webpackauto-installsshakapacker,webpack,webpack-cli, andwebpack-assets-manifest;shakapacker-rspackdeclaresshakapacker,@rspack/core,@rspack/cli, andrspack-manifest-plugin). Required peers eliminate the silent duplicate-bundler failure mode that direct dependencies could cause when an app or transitive dep pins a different bundler version. Optional features (transpilers, dev-server, CSS preprocessors, react-refresh) remain as opt-inpeerDependenciesso SCSS/native-binding bloat isn't forced on every install. The wrappers emit structured warnings (SHAKAPACKER_BUNDLER_MISMATCH,SHAKAPACKER_NO_TRANSPILER) whenconfig.assets_bundlerorjavascript_transpilerdoesn't match the installed peers. pnpm and Yarn PnP users should keep packages imported by app config files as explicit app dependencies (the Rails installer handles this automatically). See the v10.1 migration guide for adoption steps anddocs/dependency-strategy.mdfor the design rationale and v11 roadmap. - Added
shakapacker:doctorcheck for disabled Rspack cache. PR #1100 by justin808. The doctor now inspects the Rspack config file for an explicitcache: false, warns when found (disabling cache causes significantly slower builds), and also flags Rspack v1 installs (where persistent cache is experimental) with a recommendation to upgrade to v2. - Added a
shakapacker:doctorhint to compiler output. PR #1100 by justin808. The compiler now logs a one-time tip suggestingbundle exec rake shakapacker:doctorafter a failed compilation, so healthy build loops stay quiet.
Migration Notes
-
Simplify your
package.jsonby adopting a supplemental package. On npm 7+ (or Yarn 2+ innodeLinker: node-modulesmode), existing apps can drop the explicit managed-build deps fromdevDependenciesand let the supplemental package's required peers be auto-installed:- Rspack apps can replace
shakapacker+@rspack/core+@rspack/cli+rspack-manifest-pluginwith a singleshakapacker-rspack. Seepackages/shakapacker-rspack/README.md§"Simplifying an existing rspack install" for the before/after. - Webpack apps can replace
shakapacker+webpack+webpack-cli+webpack-assets-manifestwith a singleshakapacker-webpack. Seepackages/shakapacker-webpack/README.md§"Simplifying an existing webpack install" for the before/after. - Optional peers (transpilers,
webpack-dev-server, CSS preprocessors, react-refresh) stay only if your app uses those features. - Adoption is opt-in: leaving your
package.jsonuntouched on v10.1 also continues to work.
- Rspack apps can replace
-
Adopting
shakapacker-webpackrequireswebpack-assets-manifest@^6.0.0. Coreshakapackerstill accepts both v5 and v6 (^5.0.6 || ^6.0.0), butshakapacker-webpackpins~6.5.1. Apps still onwebpack-assets-manifest@5.xmust upgrade when switching to the supplemental package; v6 fixed an ENOENT crash on clean builds withmerge: trueand dropped a Node 14 install path. See the v5→v6 release notes andpackages/shakapacker-webpack/README.mdfor details.
⚠️ Breaking Changes
- Breaking: tightened
package.jsonengines.nodeto^20.19.0 || >=22.12.0. PR #1099 by justin808. Raised from>= 20, dropping support for Node 20.0.0–20.18.x and Node 21.x to match@rspack/core@2.0.0-rc.0. Consumers on those versions will hit an engine error with--engine-strictor yarn workspaces and need to upgrade. The PR also bumps.node-versionto22.20.0and updatesconductor-setup.shto enforce the same disjoint range up front, so contributors get a clear error beforeyarn installfails with a confusing engine mismatch.
Changed
- Changed
shakapacker:installto default fresh Rspack installs to v2 (^2.0.0-0). PR #1091 by ihabadham.lib/install/package.jsonnow declares@rspack/coreand@rspack/clias^1.0.0 || ^2.0.0-0; fresh installs pick the v2 range. Existing apps are unaffected. Note: Rspack v2 requires Node.js 20.19.0+. - Slimmed the published gem from ~486K (294 files) to ~121K (75 files). PR #1110, PR #1120 by justin808. Replaced the broad
git ls-filesgem manifest with an explicit runtime/install allowlist (CHANGELOG.md,MIT-LICENSE,README.md, gemspec,lib,sig,package.json), excluding repo-only docs, tests, JavaScript package source, CI/tooling files, andtest_filesmetadata from the published gem. Fixes #987.
Fixed
- Fixed webpack-dev-server
staticconfig defaulting to watchpublic/directory unnecessarily. PR #1032 by ihabadham. Three bugs fixed: (1)staticnow defaults tofalseinstead of a misconfigured object that caused webpack-dev-server to watch thepublic/directory, which is already served by Rails viaActionDispatch::Static; (2) settingstatic: falseinshakapacker.ymlis no longer silently ignored; (3) the default template no longer includesstatic.watch, which was a v3→v4 migration artifact. Fixes #1031. - Fixed Rspack React Refresh plugin loading with
@rspack/plugin-react-refreshv2. PR #1116 by justin808. Shakapacker now reads the v2 namedReactRefreshRspackPluginexport while retaining compatibility with v1 direct/default CommonJS export shapes, preventingTypeError: ReactRefreshRspackPlugin is not a constructorduring rspack dev-server startup. - Widened
@rspack/plugin-react-refreshpeer range to^1.0.0 || ^2.0.0-0. PR #1091 by ihabadham. Fixes theERESOLVEconflict when installing@rspack/plugin-react-refresh@^2.0.0alongsideshakapacker@10.0.0. - Fixed
NodePackageVersion#find_versionfor local-pathshakapackerinstalls (e.g.yalc,file:, relative paths). PR #1086, PR #1106 by justin808. The version check now consultspackage.jsonfirst and short-circuits on../,./, andfile:dependencies, so stale lockfile semvers no longer trigger false gem↔node version mismatches.package_json_dependencyalso consultsdevDependenciesin addition todependencies. TheLOCAL_PATH_REGEXconstant replaces a duplicated inline regex and anchors both alternatives to the start of the string, removing a latent false-positive on version strings containing..mid-value. Fixes #1103. - Fix rspack setup not reusing certain shared webpack-rspack config settings. PR #1085 by brunodccarvalho. Default config changes include
optimization.splitChunks.chunks="all",optimization.runtimeChunk="single", the webpack compression plugin in production, and the removal of minimization plugins in development. Fixes #984. - Fixed Rspack Sass rule blocking
sass-embeddedusers by requiring thesasspackage. PR #1105 by justin808. Rspack Sass detection now only checks forsass-loader; the implementation (sass,sass-embedded, etc.) is resolved by the loader at build time, matching the webpack code path. - Fixed
bin/shakapacker-configandbin/diff-bundler-configin ESM apps and on upgraded apps. PR #1104, PR #1132 by justin808. Apps with"type": "module"inpackage.jsonfailed to run the JavaScript binstubs because Node parsed them as ESM. The binstubs are now Ruby wrappers that locate Node (without executing it during lookup) and invoke.cjspackage scripts shipped insidenode_modules/shakapacker/package/bin/. The wrappers also mapNODE_ENVfromRAILS_ENVand print useful messages for non-ErrorCLI rejections.shakapacker:export_bundler_configdispatches binstubs by shebang, so upgraded apps with legacy JavaScript binstubs continue to run via Node while Ruby wrappers run via Ruby. Existing apps with the old JavaScript binstubs should re-runbundle exec rake shakapacker:binstubsto install the new Ruby wrappers. Fixes #1123.
v10.1.0-rc.2
Added
- Added supplemental npm packages
shakapacker-webpackandshakapacker-rspack. PR #1096 by justin808. Optional packages that lockstep with core and bundle the managed-build stack as directdependencies(so a singleyarn add shakapacker-webpackpulls inshakapacker,webpack,webpack-cli, andwebpack-assets-manifest; the rspack package bundlesshakapacker,@rspack/core,@rspack/cli, andrspack-manifest-plugin). Optional features (transpilers, dev-server, CSS preprocessors, react-refresh) remain as opt-inpeerDependenciesso SCSS/native-binding bloat isn't forced on every install. The wrappers emit structured warnings (SHAKAPACKER_BUNDLER_MISMATCH,SHAKAPACKER_NO_TRANSPILER) whenconfig.assets_bundlerorjavascript_transpilerdoesn't match the installed peers. See the v10.1 migration guide for adoption steps anddocs/dependency-strategy.mdfor the design rationale and v11 roadmap. - Added
shakapacker:doctorcheck for disabled Rspack cache. PR #1100 by justin808. The doctor now inspects the Rspack config file for an explicitcache: false, warns when found (disabling cache causes significantly slower builds), and also flags Rspack v1 installs (where persistent cache is experimental) with a recommendation to upgrade to v2. - Added a
shakapacker:doctorhint to compiler output. PR #1100 by justin808. The compiler now logs a one-time tip suggestingbundle exec rake shakapacker:doctorafter a failed compilation, so healthy build loops stay quiet.
Migration Notes
-
Simplify your
package.jsonby adopting a supplemental package. Existing apps can drop the explicit managed-build deps fromdevDependenciesand rely on the bundled stack:- Rspack apps can replace
shakapacker+@rspack/core+@rspack/cli+rspack-manifest-pluginwith a singleshakapacker-rspack. Seepackages/shakapacker-rspack/README.md§"Simplifying an existing rspack install" for the before/after. - Webpack apps can replace
shakapacker+webpack+webpack-cli+webpack-assets-manifestwith a singleshakapacker-webpack. Seepackages/shakapacker-webpack/README.md§"Simplifying an existing webpack install" for the before/after. - Optional peers (transpilers,
webpack-dev-server, CSS preprocessors, react-refresh) stay only if your app uses those features. - Adoption is opt-in: leaving your
package.jsonuntouched on v10.1 also continues to work.
- Rspack apps can replace
-
Adopting
shakapacker-webpackrequireswebpack-assets-manifest@^6.0.0. Coreshakapackerstill accepts both v5 and v6 (^5.0.6 || ^6.0.0), butshakapacker-webpackpins~6.5.1. Apps still onwebpack-assets-manifest@5.xmust upgrade when switching to the supplemental package; v6 fixed an ENOENT crash on clean builds withmerge: trueand dropped a Node 14 install path. See the v5→v6 release notes andpackages/shakapacker-webpack/README.mdfor details.
⚠️ Breaking Changes
- Breaking: tightened
package.jsonengines.nodeto^20.19.0 || >=22.12.0. PR #1099 by justin808. Raised from>= 20, dropping support for Node 20.0.0–20.18.x and Node 21.x to match@rspack/core@2.0.0-rc.0. Consumers on those versions will hit an engine error with--engine-strictor yarn workspaces and need to upgrade. The PR also bumps.node-versionto22.20.0and updatesconductor-setup.shto enforce the same disjoint range up front, so contributors get a clear error beforeyarn installfails with a confusing engine mismatch.
Changed
- Restructured
shakapacker-webpackandshakapacker-rspackdependency declarations. PR #1133 by justin808. In response to #1131, bundler singletons (webpack,webpack-cli,webpack-assets-manifestfor webpack;@rspack/core,@rspack/cli,rspack-manifest-pluginfor rspack) are now required peer dependencies instead of directdependencies. This eliminates the silent duplicate-bundler failure mode that direct deps could cause when an app or transitive dep pinned a different bundler version. npm 7+ auto-installs required peers, preserving the one-command install experience there; pnpm and Yarn PnP users should keep packages imported by app config files as explicit app dependencies (the Rails installer handles this automatically). The tilde (~) constraints from the v10.1.0-rc.1 shape have also been loosened to caret (^) for all non-shakapackerpackages, so consumers can pick up upstream patch/minor releases without waiting for a coordinated Shakapacker release.terser-webpack-pluginmoved from optional peer to direct dependency onshakapacker-webpackbecausepackage/optimization/webpack.tsalways requires it for the default production minimizer. - Changed
shakapacker:installto default fresh Rspack installs to v2 (^2.0.0-0). PR #1091 by ihabadham.lib/install/package.jsonnow declares@rspack/coreand@rspack/clias^1.0.0 || ^2.0.0-0; fresh installs pick the v2 range. Existing apps are unaffected. Note: Rspack v2 requires Node.js 20.19.0+. - Slimmed the published gem from ~486K (294 files) to ~121K (75 files). PR #1110, PR #1120 by justin808. Replaced the broad
git ls-filesgem manifest with an explicit runtime/install allowlist (CHANGELOG.md,MIT-LICENSE,README.md, gemspec,lib,sig,package.json), excluding repo-only docs, tests, JavaScript package source, CI/tooling files, andtest_filesmetadata from the published gem. Fixes #987.
Fixed
- Fixed config helper binstubs and
shakapacker:export_bundler_configdispatch for upgraded apps. PR #1132 by justin808. The export task now runs legacy JavaScriptbin/shakapacker-configbinstubs via Node while keeping Ruby binstubs on Ruby. Generated helper binstubs now mapNODE_ENVfromRAILS_ENV, locate Node without executing it during lookup, and print useful messages for non-ErrorCLI rejections. Fixes #1123. - Fixed webpack-dev-server
staticconfig defaulting to watchpublic/directory unnecessarily. PR #1032 by ihabadham. Three bugs fixed: (1)staticnow defaults tofalseinstead of a misconfigured object that caused webpack-dev-server to watch thepublic/directory, which is already served by Rails viaActionDispatch::Static; (2) settingstatic: falseinshakapacker.ymlis no longer silently ignored; (3) the default template no longer includesstatic.watch, which was a v3→v4 migration artifact. Fixes #1031. - Fixed Rspack React Refresh plugin loading with
@rspack/plugin-react-refreshv2. PR #1116 by justin808. Shakapacker now reads the v2 namedReactRefreshRspackPluginexport while retaining compatibility with v1 direct/default CommonJS export shapes, preventingTypeError: ReactRefreshRspackPlugin is not a constructorduring rspack dev-server startup. - Widened
@rspack/plugin-react-refreshpeer range to^1.0.0 || ^2.0.0-0. PR #1091 by ihabadham. Fixes theERESOLVEconflict when installing@rspack/plugin-react-refresh@^2.0.0alongsideshakapacker@10.0.0. - Fixed
NodePackageVersion#find_versionfor local-pathshakapackerinstalls (e.g.yalc,file:, relative paths). PR #1086 by justin808. The version check now consultspackage.jsonfirst and short-circuits on../orfile:dependencies, so stale lockfile semvers no longer trigger false gem↔node version mismatches.package_json_dependencyalso consultsdevDependenciesin addition todependencies. TheLOCAL_PATH_REGEXconstant replaces a duplicated inline regex and anchors both alternatives to the start of the string, removing a latent false-positive on version strings containing..mid-value. - Detected single-dot (
./...) local-path declarations inNodePackageVersion#find_version. PR #1106 by justin808. ExtendedLOCAL_PATH_REGEXto treat./vendor/shakapacker-style declarations as local-path installs (alongside the../andfile:patterns added in #1086), so version checks short-circuit before consulting potentially stale lockfile semvers. Fixes #1103. - Fix rspack setup not reusing certain shared webpack-rspack config settings. PR #1085 by brunodccarvalho. Default config changes include
optimization.splitChunks.chunks="all",optimization.runtimeChunk="single", the webpac...
v10.1.0-rc.1
Added
- Added supplemental npm packages
shakapacker-webpackandshakapacker-rspack. PR #1096 by justin808. Optional packages that lockstep with core and bundle the managed-build stack as directdependencies(so a singleyarn add shakapacker-webpackpulls inshakapacker,webpack,webpack-cli, andwebpack-assets-manifest; the rspack package bundlesshakapacker,@rspack/core,@rspack/cli, andrspack-manifest-plugin). Optional features (transpilers, dev-server, CSS preprocessors, react-refresh) remain as opt-inpeerDependenciesso SCSS/native-binding bloat isn't forced on every install. The wrappers emit structured warnings (SHAKAPACKER_BUNDLER_MISMATCH,SHAKAPACKER_NO_TRANSPILER) whenconfig.assets_bundlerorjavascript_transpilerdoesn't match the installed peers. See the v10.1 migration guide for adoption steps anddocs/dependency-strategy.mdfor the design rationale and v11 roadmap. - Added
shakapacker:doctorcheck for disabled Rspack cache. PR #1100 by justin808. The doctor now inspects the Rspack config file for an explicitcache: false, warns when found (disabling cache causes significantly slower builds), and also flags Rspack v1 installs (where persistent cache is experimental) with a recommendation to upgrade to v2. - Added a
shakapacker:doctorhint to compiler output. PR #1100 by justin808. The compiler now logs a one-time tip suggestingbundle exec rake shakapacker:doctorafter a failed compilation, so healthy build loops stay quiet.
Migration Notes
-
Simplify your
package.jsonby adopting a supplemental package. Existing apps can drop the explicit managed-build deps fromdevDependenciesand rely on the bundled stack:- Rspack apps can replace
shakapacker+@rspack/core+@rspack/cli+rspack-manifest-pluginwith a singleshakapacker-rspack. Seepackages/shakapacker-rspack/README.md§"Simplifying an existing rspack install" for the before/after. - Webpack apps can replace
shakapacker+webpack+webpack-cli+webpack-assets-manifestwith a singleshakapacker-webpack. Seepackages/shakapacker-webpack/README.md§"Simplifying an existing webpack install" for the before/after. - Optional peers (transpilers,
webpack-dev-server, CSS preprocessors, react-refresh) stay only if your app uses those features. - Adoption is opt-in: leaving your
package.jsonuntouched on v10.1 also continues to work.
- Rspack apps can replace
-
Adopting
shakapacker-webpackrequireswebpack-assets-manifest@^6.0.0. Coreshakapackerstill accepts both v5 and v6 (^5.0.6 || ^6.0.0), butshakapacker-webpackpins~6.5.1. Apps still onwebpack-assets-manifest@5.xmust upgrade when switching to the supplemental package; v6 fixed an ENOENT crash on clean builds withmerge: trueand dropped a Node 14 install path. See the v5→v6 release notes andpackages/shakapacker-webpack/README.mdfor details.
⚠️ Breaking Changes
- Breaking: tightened
package.jsonengines.nodeto^20.19.0 || >=22.12.0. PR #1099 by justin808. Raised from>= 20, dropping support for Node 20.0.0–20.18.x and Node 21.x to match@rspack/core@2.0.0-rc.0. Consumers on those versions will hit an engine error with--engine-strictor yarn workspaces and need to upgrade. The PR also bumps.node-versionto22.20.0and updatesconductor-setup.shto enforce the same disjoint range up front, so contributors get a clear error beforeyarn installfails with a confusing engine mismatch.
Changed
- Changed
shakapacker:installto default fresh Rspack installs to v2 (^2.0.0-0). PR #1091 by ihabadham.lib/install/package.jsonnow declares@rspack/coreand@rspack/clias^1.0.0 || ^2.0.0-0; fresh installs pick the v2 range. Existing apps are unaffected. Note: Rspack v2 requires Node.js 20.19.0+. - Slimmed the published gem from ~486K (294 files) to ~121K (75 files). PR #1110 by justin808. Replaced the broad
git ls-filesgem manifest with an explicit runtime/install allowlist (CHANGELOG.md,MIT-LICENSE,README.md, gemspec,lib,sig), excluding repo-only docs, tests, JavaScript package source, CI/tooling files, andtest_filesmetadata from the published gem. Fixes #987.
Fixed
- Fixed webpack-dev-server
staticconfig defaulting to watchpublic/directory unnecessarily. PR #1032 by ihabadham. Three bugs fixed: (1)staticnow defaults tofalseinstead of a misconfigured object that caused webpack-dev-server to watch thepublic/directory, which is already served by Rails viaActionDispatch::Static; (2) settingstatic: falseinshakapacker.ymlis no longer silently ignored; (3) the default template no longer includesstatic.watch, which was a v3→v4 migration artifact. Fixes #1031. - Fixed Rspack React Refresh plugin loading with
@rspack/plugin-react-refreshv2. PR #1116 by justin808. Shakapacker now reads the v2 namedReactRefreshRspackPluginexport while retaining compatibility with v1 direct/default CommonJS export shapes, preventingTypeError: ReactRefreshRspackPlugin is not a constructorduring rspack dev-server startup. - Widened
@rspack/plugin-react-refreshpeer range to^1.0.0 || ^2.0.0-0. PR #1091 by ihabadham. Fixes theERESOLVEconflict when installing@rspack/plugin-react-refresh@^2.0.0alongsideshakapacker@10.0.0. - Fixed
NodePackageVersion#find_versionfor local-pathshakapackerinstalls (e.g.yalc,file:, relative paths). PR #1086 by justin808. The version check now consultspackage.jsonfirst and short-circuits on../orfile:dependencies, so stale lockfile semvers no longer trigger false gem↔node version mismatches.package_json_dependencyalso consultsdevDependenciesin addition todependencies. TheLOCAL_PATH_REGEXconstant replaces a duplicated inline regex and anchors both alternatives to the start of the string, removing a latent false-positive on version strings containing..mid-value. - Detected single-dot (
./...) local-path declarations inNodePackageVersion#find_version. PR #1106 by justin808. ExtendedLOCAL_PATH_REGEXto treat./vendor/shakapacker-style declarations as local-path installs (alongside the../andfile:patterns added in #1086), so version checks short-circuit before consulting potentially stale lockfile semvers. Fixes #1103. - Fix rspack setup not reusing certain shared webpack-rspack config settings. PR #1085 by brunodccarvalho. Default config changes include
optimization.splitChunks.chunks="all",optimization.runtimeChunk="single", the webpack compression plugin in production, and the removal of minimization plugins in development. Fixes #984. - Fixed Rspack Sass rule blocking
sass-embeddedusers by requiring thesasspackage. PR #1105 by justin808. Rspack Sass detection now only checks forsass-loader; the implementation (sass,sass-embedded, etc.) is resolved by the loader at build time, matching the webpack code path. - Fixed
bin/shakapacker-configandbin/diff-bundler-configin ESM apps. PR #1104 by justin808. Apps with"type": "module"inpackage.jsonfailed to run the JavaScript binstubs because Node parsed them as ESM. The binstubs are now Ruby wrappers that locate Node and invoke.cjspackage scripts shipped insidenode_modules/shakapacker/package/bin/. Existing apps with the old JavaScript binstubs should re-runbundle exec rake shakapacker:binstubsto install the new Ruby wrappers.
v10.1.0-rc.0
Added
- Added supplemental npm packages
shakapacker-webpackandshakapacker-rspack. PR #1096 by justin808. Optional packages that lockstep with core and bundle the managed-build stack as directdependencies(so a singleyarn add shakapacker-webpackpulls inshakapacker,webpack,webpack-cli, andwebpack-assets-manifest; the rspack package bundlesshakapacker,@rspack/core,@rspack/cli, andrspack-manifest-plugin). Optional features (transpilers, dev-server, CSS preprocessors, react-refresh) remain as opt-inpeerDependenciesso SCSS/native-binding bloat isn't forced on every install. The wrappers emit structured warnings (SHAKAPACKER_BUNDLER_MISMATCH,SHAKAPACKER_NO_TRANSPILER) whenconfig.assets_bundlerorjavascript_transpilerdoesn't match the installed peers. See the v10.1 migration guide for adoption steps anddocs/dependency-strategy.mdfor the design rationale and v11 roadmap. - Added
shakapacker:doctorcheck for disabled Rspack cache. PR #1100 by justin808. The doctor now inspects the Rspack config file for an explicitcache: false, warns when found (disabling cache causes significantly slower builds), and also flags Rspack v1 installs (where persistent cache is experimental) with a recommendation to upgrade to v2. - Added a
shakapacker:doctorhint to compiler output. PR #1100 by justin808. The compiler now logs a one-time tip suggestingbundle exec rake shakapacker:doctorafter a failed compilation, so healthy build loops stay quiet.
Migration Notes
-
Simplify your
package.jsonby adopting a supplemental package. Existing apps can drop the explicit managed-build deps fromdevDependenciesand rely on the bundled stack:- Rspack apps can replace
shakapacker+@rspack/core+@rspack/cli+rspack-manifest-pluginwith a singleshakapacker-rspack. Seepackages/shakapacker-rspack/README.md§"Simplifying an existing rspack install" for the before/after. - Webpack apps can replace
shakapacker+webpack+webpack-cli+webpack-assets-manifestwith a singleshakapacker-webpack. Seepackages/shakapacker-webpack/README.md§"Simplifying an existing webpack install" for the before/after. - Optional peers (transpilers,
webpack-dev-server, CSS preprocessors, react-refresh) stay only if your app uses those features. - Adoption is opt-in: leaving your
package.jsonuntouched on v10.1 also continues to work.
- Rspack apps can replace
-
Adopting
shakapacker-webpackrequireswebpack-assets-manifest@^6.0.0. Coreshakapackerstill accepts both v5 and v6 (^5.0.6 || ^6.0.0), butshakapacker-webpackpins~6.5.1. Apps still onwebpack-assets-manifest@5.xmust upgrade when switching to the supplemental package; v6 fixed an ENOENT crash on clean builds withmerge: trueand dropped a Node 14 install path. See the v5→v6 release notes andpackages/shakapacker-webpack/README.mdfor details.
⚠️ Breaking Changes
- Breaking: tightened
package.jsonengines.nodeto^20.19.0 || >=22.12.0. PR #1099 by justin808. Raised from>= 20, dropping support for Node 20.0.0–20.18.x and Node 21.x to match@rspack/core@2.0.0-rc.0. Consumers on those versions will hit an engine error with--engine-strictor yarn workspaces and need to upgrade. The PR also bumps.node-versionto22.20.0and updatesconductor-setup.shto enforce the same disjoint range up front, so contributors get a clear error beforeyarn installfails with a confusing engine mismatch.
Changed
- Changed
shakapacker:installto default fresh Rspack installs to v2 (^2.0.0-0). PR #1091 by ihabadham.lib/install/package.jsonnow declares@rspack/coreand@rspack/clias^1.0.0 || ^2.0.0-0; fresh installs pick the v2 range. Existing apps are unaffected. Note: Rspack v2 requires Node.js 20.19.0+. - Slimmed the published gem from ~486K (294 files) to ~121K (75 files). PR #1110 by justin808. Replaced the broad
git ls-filesgem manifest with an explicit runtime/install allowlist (CHANGELOG.md,MIT-LICENSE,README.md, gemspec,lib,sig), excluding repo-only docs, tests, JavaScript package source, CI/tooling files, andtest_filesmetadata from the published gem. Fixes #987.
Fixed
- Fixed Rspack React Refresh plugin loading with
@rspack/plugin-react-refreshv2. PR #1116 by justin808. Shakapacker now reads the v2 namedReactRefreshRspackPluginexport while retaining compatibility with v1 direct/default CommonJS export shapes, preventingTypeError: ReactRefreshRspackPlugin is not a constructorduring rspack dev-server startup. - Widened
@rspack/plugin-react-refreshpeer range to^1.0.0 || ^2.0.0-0. PR #1091 by ihabadham. Fixes theERESOLVEconflict when installing@rspack/plugin-react-refresh@^2.0.0alongsideshakapacker@10.0.0. - Fixed
NodePackageVersion#find_versionfor local-pathshakapackerinstalls (e.g.yalc,file:, relative paths). PR #1086 by justin808. The version check now consultspackage.jsonfirst and short-circuits on../orfile:dependencies, so stale lockfile semvers no longer trigger false gem↔node version mismatches.package_json_dependencyalso consultsdevDependenciesin addition todependencies. TheLOCAL_PATH_REGEXconstant replaces a duplicated inline regex and anchors both alternatives to the start of the string, removing a latent false-positive on version strings containing..mid-value. - Detected single-dot (
./...) local-path declarations inNodePackageVersion#find_version. PR #1106 by justin808. ExtendedLOCAL_PATH_REGEXto treat./vendor/shakapacker-style declarations as local-path installs (alongside the../andfile:patterns added in #1086), so version checks short-circuit before consulting potentially stale lockfile semvers. Fixes #1103. - Fix rspack setup not reusing certain shared webpack-rspack config settings. PR #1085 by brunodccarvalho. Default config changes include
optimization.splitChunks.chunks="all",optimization.runtimeChunk="single", the webpack compression plugin in production, and the removal of minimization plugins in development. Fixes #984.
v10.0.0
Added
- Added
bin/diff-bundler-configCLI for semantic bundler configuration diffs. PR #973 by justin808. Wraps the extractedpack-config-diffpackage to provide semantic diffing of webpack/rspack configurations with normalized exit codes. Supersedes #961. - Added
bin/shakapacker-watchbinstub for clean Ctrl-C shutdown in Procfile-based workflows. PR #1026 by justin808. The new wrapper script traps INT/TERM signals and forwards TERM to the underlyingbin/shakapacker --watchprocess, preventing Ruby interrupt backtraces when stoppingbin/dev. Usebin/shakapacker-watch --watchin Procfiles instead ofbin/shakapacker --watch. - Allowed
webpack-cliv7 (^7.0.0) in peer dependencies. PR #1021 by justin808. Fixes #1020. Note:webpack-cliv7 requires Node.js >= 20.9.0.
⚠️ Breaking Changes
- Breaking: bumped the minimum
webpackversion to^5.101.0. PR #1021 by justin808. The previous minimum was^5.76.0. - Breaking: required
webpack-dev-server^5.2.2and dropped support for v4. PR #1021 by justin808. The removed v4 range was^4.15.2.
Changed
- Changed
shakapacker:installto defaultwebpack-cliinstalls to the latest v6 range. PR #1021 by justin808. This keeps installs compatible with Node.js20.0-20.8; v7 remains supported via peer dependencies for Node.js >= 20.9.0. - Changed dev server config handling to warn on deprecated middleware hooks and ignore them for webpack-dev-server v5. PR #1021 by justin808. Use
setup_middlewaresinstead ofon_before_setup_middlewareandon_after_setup_middleware.
Fixed
v10.0.0-rc.1
Added
- Added
bin/diff-bundler-configCLI for semantic bundler configuration diffs. PR #973 by justin808. Wraps the extractedpack-config-diffpackage to provide semantic diffing of webpack/rspack configurations with normalized exit codes. Supersedes #961. - Added
bin/shakapacker-watchbinstub for clean Ctrl-C shutdown in Procfile-based workflows. PR #1026 by justin808. The new wrapper script traps INT/TERM signals and forwards TERM to the underlyingbin/shakapacker --watchprocess, preventing Ruby interrupt backtraces when stoppingbin/dev. Usebin/shakapacker-watch --watchin Procfiles instead ofbin/shakapacker --watch. - Allowed
webpack-cliv7 (^7.0.0) in peer dependencies. PR #1021 by justin808. Fixes #1020. Note:webpack-cliv7 requires Node.js >= 20.9.0.
⚠️ Breaking Changes
- Breaking: bumped the minimum
webpackversion to^5.101.0. PR #1021 by justin808. The previous minimum was^5.76.0. - Breaking: required
webpack-dev-server^5.2.2and dropped support for v4. PR #1021 by justin808. The removed v4 range was^4.15.2.
Changed
- Changed
shakapacker:installto defaultwebpack-cliinstalls to the latest v6 range. PR #1021 by justin808. This keeps installs compatible with Node.js20.0-20.8; v7 remains supported via peer dependencies for Node.js >= 20.9.0. - Changed dev server config handling to warn on deprecated middleware hooks and ignore them for webpack-dev-server v5. PR #1021 by justin808. Use
setup_middlewaresinstead ofon_before_setup_middlewareandon_after_setup_middleware.
Fixed
v10.0.0-rc.0
Added
- Added
bin/shakapacker-watchbinstub for clean Ctrl-C shutdown in Procfile-based workflows. PR #1026 by justin808. The new wrapper script traps INT/TERM signals and forwards TERM to the underlyingbin/shakapacker --watchprocess, preventing Ruby interrupt backtraces when stoppingbin/dev. Usebin/shakapacker-watch --watchin Procfiles instead ofbin/shakapacker --watch. - Allowed
webpack-cliv7 (^7.0.0) in peer dependencies. PR #1021 by justin808. Fixes #1020. Note:webpack-cliv7 requires Node.js >= 20.9.0.
⚠️ Breaking Changes
- Breaking: bumped the minimum
webpackversion to^5.101.0. PR #1021 by justin808. The previous minimum was^5.76.0. - Breaking: required
webpack-dev-server^5.2.2and dropped support for v4. PR #1021 by justin808. The removed v4 range was^4.15.2.
Changed
- Changed
shakapacker:installto defaultwebpack-cliinstalls to the latest v6 range. PR #1021 by justin808. This keeps installs compatible with Node.js20.0-20.8; v7 remains supported via peer dependencies for Node.js >= 20.9.0. - Changed dev server config handling to warn on deprecated middleware hooks and ignore them for webpack-dev-server v5. PR #1021 by justin808. Use
setup_middlewaresinstead ofon_before_setup_middlewareandon_after_setup_middleware.
Fixed
v9.7.0
Added
- Added rspack v2 support. PR #975 by justin808. Peer dependencies now accept both rspack v1 and v2 (
^1.0.0 || ^2.0.0-0). No source code changes were needed — all existing APIs work identically in v2. Note that rspack v2 requires Node.js 20.19.0+.
Fixed
- Fixed config exporter path traversal and annotation format validation. PR #914 by justin808. Added
safeResolvePathsecurity check to prevent path traversal in export save paths, and enforced YAML format when using annotations with build exports. - Fixed
webpack-subresource-integrityv5 named export handling. PR #978 by justin808. Supports both the default export (older versions) and the namedSubresourceIntegrityPluginexport (v5.1+), preventing runtime breakage when upgrading the plugin. Fixes #972.