Skip to content

Commit acad445

Browse files
ihabadhamclaude
andcommitted
feat: bump Rspack dependencies to v2 (^2.0.0-0)
Update generator and bin/switch-bundler Rspack dependencies from v1 to v2: - @rspack/core@^2.0.0-0 (prerelease suffix includes RC builds) - @rspack/cli@^2.0.0-0 - @rspack/plugin-react-refresh@^2.0.0 (already stable at 2.0.0) - rspack-manifest-plugin@^5.0.0 (unchanged, already compatible) The -0 prerelease suffix ensures that RC builds (currently 2.0.0-rc.1) are resolved by npm until stable 2.0.0 ships. Closes #3082 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d73245e commit acad445

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ After a release, run `/update-changelog` in Claude Code to analyze commits, writ
2424

2525
### [Unreleased]
2626

27+
#### Changed
28+
29+
- **Bump Rspack dependencies to v2**: Updated generator and `bin/switch-bundler` Rspack dependencies from v1 to v2 (`@rspack/core@^2.0.0-0`, `@rspack/cli@^2.0.0-0`, `@rspack/plugin-react-refresh@^2.0.0`). The `-0` prerelease suffix ensures RC builds are included until stable 2.0.0 lands. `rspack-manifest-plugin` remains at `^5.0.0` (already compatible with Rspack v2). Closes [Issue 3082](https://github.com/shakacode/react_on_rails/issues/3082). [PR 3084](https://github.com/shakacode/react_on_rails/pull/3084) by [justin808](https://github.com/justin808).
30+
2731
### [16.6.0] - 2026-04-09
2832

2933
#### Removed

react_on_rails/lib/generators/react_on_rails/js_dependency_manager.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,19 @@ module JsDependencyManager
9191
].freeze
9292

9393
# Rspack core dependencies (only installed when --rspack flag is used)
94+
# @rspack/core uses ^2.0.0-0 (with -0 prerelease suffix) to include RC/beta prereleases
95+
# of 2.0.0 until the stable 2.0.0 release lands.
9496
RSPACK_DEPENDENCIES = %w[
95-
@rspack/core@^1.0.0
97+
@rspack/core@^2.0.0-0
9698
rspack-manifest-plugin@^5.0.0
9799
].freeze
98100

99101
# Rspack development dependencies for hot reloading
100102
# react-refresh is pre-1.0, so left bare (see pinning note above).
103+
# @rspack/cli uses ^2.0.0-0 to match @rspack/core's prerelease range.
101104
RSPACK_DEV_DEPENDENCIES = %w[
102-
@rspack/cli@^1.0.0
103-
@rspack/plugin-react-refresh@^1.0.0
105+
@rspack/cli@^2.0.0-0
106+
@rspack/plugin-react-refresh@^2.0.0
104107
react-refresh
105108
].freeze
106109

react_on_rails/lib/generators/react_on_rails/templates/base/base/bin/switch-bundler

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class BundlerSwitcher
1515
}.freeze
1616

1717
RSPACK_DEPS = {
18-
dependencies: %w[@rspack/core@^1.0.0 rspack-manifest-plugin@^5.0.0],
19-
dev_dependencies: %w[@rspack/cli@^1.0.0 @rspack/plugin-react-refresh@^1.0.0]
18+
dependencies: %w[@rspack/core@^2.0.0-0 rspack-manifest-plugin@^5.0.0],
19+
dev_dependencies: %w[@rspack/cli@^2.0.0-0 @rspack/plugin-react-refresh@^2.0.0]
2020
}.freeze
2121

2222
def initialize(target_bundler)

react_on_rails/spec/react_on_rails/generators/install_generator_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ class ActiveSupport::TestCase
667667
it "switch-bundler has version-pinned deps and strips versions before deletion" do
668668
assert_file "bin/switch-bundler" do |content|
669669
# Version pins are present in the constants
670-
expect(content).to include("@rspack/core@^1.0.0")
670+
expect(content).to include("@rspack/core@^2.0.0-0")
671671
expect(content).to include("webpack@^5.0.0")
672672
# Version-stripping regex is used for package.json key deletion
673673
expect(content).to include('dep[%r{\A(@[^/]+/[^@]+|[^@]+)}]')

react_on_rails/spec/react_on_rails/generators/js_dependency_manager_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ def errors
140140

141141
it "defines RSPACK_DEPENDENCIES" do
142142
expect(ReactOnRails::Generators::JsDependencyManager::RSPACK_DEPENDENCIES).to eq(%w[
143-
@rspack/core@^1.0.0
143+
@rspack/core@^2.0.0-0
144144
rspack-manifest-plugin@^5.0.0
145145
])
146146
end
147147

148148
it "defines RSPACK_DEV_DEPENDENCIES" do
149149
expect(ReactOnRails::Generators::JsDependencyManager::RSPACK_DEV_DEPENDENCIES).to(
150-
eq(%w[@rspack/cli@^1.0.0 @rspack/plugin-react-refresh@^1.0.0 react-refresh])
150+
eq(%w[@rspack/cli@^2.0.0-0 @rspack/plugin-react-refresh@^2.0.0 react-refresh])
151151
)
152152
end
153153

0 commit comments

Comments
 (0)