Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5520803
Add RFC for tightening dependencies in Shakapacker v17
justin808 Mar 29, 2026
e30f8de
Revise RFC to adopt supplemental packages approach
justin808 Apr 12, 2026
58bb082
Use unscoped package names shakapacker-webpack/shakapacker-rspack
justin808 Apr 12, 2026
65c47ad
Add monorepo structure and lockstep versioning strategy to RFC
justin808 Apr 12, 2026
176c3b6
Revise RFC: phased rollout v10.1/v11, all packages under packages/
justin808 Apr 13, 2026
faee9d3
Implement Phase 1 supplemental packages (shakapacker-webpack/rspack)
justin808 Apr 19, 2026
bffd1d3
Address PR review feedback on Phase 1 supplemental packages
justin808 Apr 23, 2026
3ebccaa
Address second-round PR review feedback on Phase 1 packages
justin808 Apr 23, 2026
852a136
Address third-round PR review feedback on Phase 1 packages
justin808 Apr 29, 2026
2f1d3d2
Address fourth-round PR review feedback on Phase 1 packages
justin808 Apr 29, 2026
aa0cddc
Merge remote-tracking branch 'origin/main' into HEAD
justin808 Apr 30, 2026
f88dcad
Align supplemental dev server peer floor
justin808 Apr 30, 2026
33bab5f
Address fifth-round PR review feedback on Phase 1 packages
justin808 Apr 30, 2026
1cfb513
Address sixth-round PR review feedback on Phase 1 packages
justin808 Apr 30, 2026
5e3ac03
Address seventh-round PR review feedback on Phase 1 packages
justin808 May 3, 2026
1ab04ba
Address optional PR review feedback on shakapacker-webpack/index.js
justin808 May 3, 2026
d8a5464
Pin supplemental package dependencies
justin808 May 3, 2026
0ed4cf1
Reject empty npm publish tag
justin808 May 3, 2026
b67ee6c
Address supplemental package review feedback
justin808 May 4, 2026
2ead6ad
Merge remote-tracking branch 'origin/main' into jg/tighten-deps-v17
justin808 May 4, 2026
ce880ca
Address eighth-round PR review feedback on Phase 1 packages
justin808 May 5, 2026
1f56562
Bump gem version to 10.1.0 to match package.json
justin808 May 5, 2026
2c319d8
Address ninth-round PR review feedback on Phase 1 packages
justin808 May 8, 2026
cfc5273
Address dependency review comments
justin808 May 9, 2026
fb89107
Address package wrapper review comments
justin808 May 9, 2026
7ce4758
Align CHANGELOG/RFC with shipped peer-pinning policy
justin808 May 10, 2026
357c461
Address eleventh-round PR review feedback on Phase 1 packages
justin808 May 10, 2026
e8b8917
Fix CI failures: prettier formatting and Gemfile.lock version sync
justin808 May 10, 2026
5b01765
Address twelfth-round PR review feedback on Phase 1 packages
justin808 May 10, 2026
7beac0d
Fix spurious SHAKAPACKER_NO_TRANSPILER warning on config load failure
justin808 May 10, 2026
42a2602
Address fourteenth-round PR review feedback on Phase 1 packages
justin808 May 10, 2026
bf50bd3
Address fifteenth-round PR review feedback on Phase 1 packages
justin808 May 10, 2026
25d096b
Bundle managed-build deps into wrapper packages
justin808 May 10, 2026
15c749c
Updated license
justin808 May 10, 2026
a9a545a
Address PR feedback: clarify v11, flip installer default to rspack, s…
justin808 May 10, 2026
0232b86
Split RFC into user-facing migration doc + design doc; add v10.1 blog…
justin808 May 10, 2026
f4752e7
Revert gem version bump and drop stale Open Questions section
justin808 May 10, 2026
288ecd1
Wire publish-packages.sh into rake release; address review feedback
justin808 May 10, 2026
a2060c6
Bump supplemental core dep on release; tighten lockstep + warning-cod…
justin808 May 11, 2026
e89ad18
Update packages/shakapacker-webpack/index.js
justin808 May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@

## [Unreleased]

### Added

- **Added supplemental npm packages `shakapacker-webpack` and `shakapacker-rspack`**. [PR #1096](https://github.com/shakacode/shakapacker/pull/1096) by [justin808](https://github.com/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](docs/migration/v10.1-supplemental-packages.md) for adoption steps and [`docs/dependency-strategy.md`](docs/dependency-strategy.md) for the design rationale and v11 roadmap.

### 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](https://github.com/webdeveric/webpack-assets-manifest/releases) 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](https://github.com/shakacode/shakapacker/pull/1099) by [justin808](https://github.com/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.
Expand Down
75 changes: 75 additions & 0 deletions docs/blog/2026-05-10-shakapacker-10-1-supplemental-packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Shakapacker 10.1: One-Package Installs with `shakapacker-rspack` and `shakapacker-webpack`

**Date:** 2026-05-10
**Author:** Justin Gordon

Shakapacker 10.1 ships two new optional npm packages — `shakapacker-rspack` and `shakapacker-webpack` — that turn a four-or-five-package install into one. Same Shakapacker, simpler `package.json`.

## The 30-second pitch

If you're starting a new app today:

```sh
yarn add --dev shakapacker-rspack
```

That's it. You get `shakapacker`, `@rspack/core`, `@rspack/cli`, and `rspack-manifest-plugin` together, all pinned to the exact versions Shakapacker is tested against. Webpack users get the same shape with `shakapacker-webpack`.

If you're already on Shakapacker 10.0, you can drop the now-bundled deps from your `devDependencies` and rely on the supplemental package to bring them along. Nothing breaks if you don't.

## What changed

Until now, a typical Shakapacker install meant listing the gem, the npm package, the bundler, the bundler's CLI, the manifest plugin, and your transpiler — all as direct dependencies. That worked, but it pushed the version-matching problem onto every user. Were you on a tested combination? You had to read the changelog to find out.

10.1 shifts that responsibility to the supplemental packages. Each one declares the bundler stack as direct `dependencies` with patch-tolerant `~X.Y.Z` ranges:

- `shakapacker-rspack` bundles `shakapacker`, `@rspack/core`, `@rspack/cli`, `rspack-manifest-plugin`.
- `shakapacker-webpack` bundles `shakapacker`, `webpack`, `webpack-cli`, `webpack-assets-manifest`.

Optional features — transpilers (swc / babel / esbuild for webpack), CSS preprocessors, dev-server, react-refresh — stay as opt-in `peerDependencies` so you only download what you actually use. (Bundling sass into every install would force a 10MB native-binding download on apps that don't even import a `.scss` file. We're not doing that.)

## Adopting in an existing app

Replace the explicit deps with the supplemental package:

```diff
{
"devDependencies": {
- "shakapacker": "^10.0.0",
- "@rspack/core": "^2.0.0",
- "@rspack/cli": "^2.0.0",
- "rspack-manifest-plugin": "^5.0.0"
+ "shakapacker-rspack": "~10.1.0"
}
}
```

Run `yarn install`. No changes to `config/shakapacker.yml`, `bin/shakapacker`, or your bundler config are required. The full step-by-step (including the webpack flow and the optional-peer cheatsheet) lives in [`docs/migration/v10.1-supplemental-packages.md`](../migration/v10.1-supplemental-packages.md).

## What if I don't want to migrate?

Don't. Adoption is opt-in for the entire 10.x line. Apps that keep their existing `package.json` will continue to work exactly as they did on 10.0. The supplemental packages are the recommended path for new projects and a cleanup for existing ones, not a forced upgrade.

## Runtime safety net

The supplemental packages emit two structured warnings (via Node's built-in `process.emitWarning`) when your config and your installed peers disagree:

- `SHAKAPACKER_BUNDLER_MISMATCH` — you installed `shakapacker-webpack` but `config/shakapacker.yml` says `assets_bundler: rspack` (or vice versa).
- `SHAKAPACKER_NO_TRANSPILER` — the configured `javascript_transpiler:` doesn't have its loader pair installed (e.g., `swc` configured but `@swc/core`/`swc-loader` aren't resolvable).

Both are visible by default in dev and CI, suppressible with `--no-warnings`, and fire before your bundler throws a confusing module-not-found error.

## Looking ahead to v11

v11 will make the supplemental packages required for managed builds — core `shakapacker` will stop declaring bundler peer deps and apps that haven't adopted a supplemental package will need to switch. Custom-build users (apps that produce their own `manifest.json` from Vite, esbuild, or a hand-rolled webpack config) keep using bare `shakapacker` and aren't affected.

There's no firm v11 date yet. The 10.1 line is intentionally a soak period — we want real-world adoption signal on the supplemental packages before locking the design in. The full design rationale and roadmap lives in [`docs/dependency-strategy.md`](../dependency-strategy.md).

## Try it

- Migration guide: [`docs/migration/v10.1-supplemental-packages.md`](../migration/v10.1-supplemental-packages.md)
- `shakapacker-rspack` README: [`packages/shakapacker-rspack/README.md`](../../packages/shakapacker-rspack/README.md)
- `shakapacker-webpack` README: [`packages/shakapacker-webpack/README.md`](../../packages/shakapacker-webpack/README.md)
- Design rationale: [`docs/dependency-strategy.md`](../dependency-strategy.md)

Bug reports, feedback, and "this didn't work for me" stories all welcome on [GitHub issues](https://github.com/shakacode/shakapacker/issues) — we're using the 10.1 soak window to find rough edges before v11 closes the door.
Loading
Loading