github shakacode/shakapacker v10.1.0-rc.0

pre-release3 hours ago

Added

  • Added supplemental npm packages shakapacker-webpack and shakapacker-rspack. PR #1096 by justin808. Optional packages that lockstep with core and bundle the managed-build stack as direct dependencies (so a single yarn add shakapacker-webpack pulls in shakapacker, webpack, webpack-cli, and webpack-assets-manifest; the rspack package bundles shakapacker, @rspack/core, @rspack/cli, and rspack-manifest-plugin). Optional features (transpilers, dev-server, CSS preprocessors, react-refresh) remain as opt-in peerDependencies so SCSS/native-binding bloat isn't forced on every install. The wrappers emit structured warnings (SHAKAPACKER_BUNDLER_MISMATCH, SHAKAPACKER_NO_TRANSPILER) when config.assets_bundler or javascript_transpiler doesn't match the installed peers. See the v10.1 migration guide for adoption steps and docs/dependency-strategy.md for the design rationale and v11 roadmap.
  • Added shakapacker:doctor check for disabled Rspack cache. PR #1100 by justin808. The doctor now inspects the Rspack config file for an explicit cache: 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:doctor hint to compiler output. PR #1100 by justin808. The compiler now logs a one-time tip suggesting bundle exec rake shakapacker:doctor after a failed compilation, so healthy build loops stay quiet.

Migration Notes

  • Simplify your package.json by adopting a supplemental package. Existing apps can drop the explicit managed-build deps from devDependencies and rely on the bundled stack:

    • Rspack apps can replace shakapacker + @rspack/core + @rspack/cli + rspack-manifest-plugin with a single shakapacker-rspack. See packages/shakapacker-rspack/README.md §"Simplifying an existing rspack install" for the before/after.
    • Webpack apps can replace shakapacker + webpack + webpack-cli + webpack-assets-manifest with a single shakapacker-webpack. See packages/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.json untouched on v10.1 also continues to work.
  • Adopting shakapacker-webpack requires webpack-assets-manifest@^6.0.0. Core shakapacker still accepts both v5 and v6 (^5.0.6 || ^6.0.0), but shakapacker-webpack pins ~6.5.1. Apps still on webpack-assets-manifest@5.x must upgrade when switching to the supplemental package; v6 fixed an ENOENT crash on clean builds with merge: true and dropped a Node 14 install path. See the v5→v6 release notes and packages/shakapacker-webpack/README.md for details.

⚠️ Breaking Changes

  • Breaking: tightened package.json engines.node to ^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-strict or yarn workspaces and need to upgrade. The PR also bumps .node-version to 22.20.0 and updates conductor-setup.sh to enforce the same disjoint range up front, so contributors get a clear error before yarn install fails with a confusing engine mismatch.

Changed

  • Changed shakapacker:install to default fresh Rspack installs to v2 (^2.0.0-0). PR #1091 by ihabadham. lib/install/package.json now declares @rspack/core and @rspack/cli as ^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-files gem 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, and test_files metadata from the published gem. Fixes #987.

Fixed

  • Fixed Rspack React Refresh plugin loading with @rspack/plugin-react-refresh v2. PR #1116 by justin808. Shakapacker now reads the v2 named ReactRefreshRspackPlugin export while retaining compatibility with v1 direct/default CommonJS export shapes, preventing TypeError: ReactRefreshRspackPlugin is not a constructor during rspack dev-server startup.
  • Widened @rspack/plugin-react-refresh peer range to ^1.0.0 || ^2.0.0-0. PR #1091 by ihabadham. Fixes the ERESOLVE conflict when installing @rspack/plugin-react-refresh@^2.0.0 alongside shakapacker@10.0.0.
  • Fixed NodePackageVersion#find_version for local-path shakapacker installs (e.g. yalc, file:, relative paths). PR #1086 by justin808. The version check now consults package.json first and short-circuits on ../ or file: dependencies, so stale lockfile semvers no longer trigger false gem↔node version mismatches. package_json_dependency also consults devDependencies in addition to dependencies. The LOCAL_PATH_REGEX constant 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 in NodePackageVersion#find_version. PR #1106 by justin808. Extended LOCAL_PATH_REGEX to treat ./vendor/shakapacker-style declarations as local-path installs (alongside the ../ and file: 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.

Don't miss a new shakapacker release

NewReleases is sending notifications on new releases.