Skip to content

Support sass-loader v17 - #1141

Merged
justin808 merged 2 commits into
shakacode:mainfrom
fukayatsu:support-sass-loader-17
Jun 3, 2026
Merged

Support sass-loader v17#1141
justin808 merged 2 commits into
shakacode:mainfrom
fukayatsu:support-sass-loader-17

Conversation

@fukayatsu

@fukayatsu fukayatsu commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Widens the optional sass-loader peer range to include ^17.0.0 so apps on Node 22.12+ can opt into sass-loader v17. No loader-rule changes are required.

Closes #1140.

Changes

  • Add ^17.0.0 to the optional sass-loader peer range in core shakapacker, shakapacker-webpack, and shakapacker-rspack.
  • Update docs/peer-dependencies.md and docs/dependency-strategy.md to match.
  • Add a CHANGELOG entry.

Why no rule changes: the Sass rule already selects loadPaths for sass-loader v16+ and keeps api: "modern". Both remain valid in v17 — v17 only removed the legacy Sass JS API and node-sass, neither of which Shakapacker uses.

Why the installer is intentionally NOT widened: lib/install/package.json's common range is the dependency actually installed into newly generated apps (package managers install the highest match). Adding ^17.0.0 there would force every new app onto sass-loader@17, which requires Node ≥ 22.11.0 — combined with Shakapacker's engines.node (^20.19.0 || >=22.12.0) that effectively means Node 22.12+. Since Shakapacker still supports Node 20.19, defaulting new installs to v17 would break the install/build flow for Node 20 users. An OR range can't express "allow v17 but install v16", so v17 stays opt-in via the peer range and the installer default stays conservative.

Pull Request checklist

  • Add/update test to cover these changes — existing test/package/rules/sass-version-parsing.test.js already asserts v17 → loadPaths; generator specs exercise the install across npm/yarn/pnpm/bun
  • Update documentation
  • Update CHANGELOG file

Other Information

  • Compatibility: sass-loader@17 requires Node.js 22.11.0+, drops node-sass, and removes the legacy Sass JS API. Apps using Shakapacker + v17 need Node 22.12+ (the upper branch of Shakapacker's supported range). Non-breaking: Node 20 users stay on v16 via the OR range.
  • devDependency intentionally not bumped: CONTRIBUTING asks to keep devDependency/peerDependency ranges in sync, but the pinned sass-loader devDependency stays at 16.0.7 because CI runs on Node 20.19.x and sass-loader@17 requires Node 22.11+. Bumping it would require raising the whole CI Node matrix, out of scope for a compatibility-range change.
  • Testing: yarn test (full JS suite) ✓, yarn lint + Prettier ✓, bundle exec rspec spec/generator_specs/generator_spec.rb → 71 examples, 0 failures.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Wider sass-loader support: Shakapacker now accepts v13–v17 in peer-dependency ranges across packages.
  • Documentation

    • Changelog and dependency docs updated to note v17 support, Node.js minimum (22.11.0+), and guidance about opting into v17; documents that v17 removes node-sass and the legacy Sass JS API.

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80490629-0a0f-48e2-ba9b-cbb638c914f2

📥 Commits

Reviewing files that changed from the base of the PR and between 8eef9e7 and 9950c91.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • docs/dependency-strategy.md
  • docs/peer-dependencies.md
  • package.json
  • packages/shakapacker-rspack/package.json
  • packages/shakapacker-webpack/package.json
✅ Files skipped from review due to trivial changes (3)
  • package.json
  • docs/dependency-strategy.md
  • packages/shakapacker-rspack/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/peer-dependencies.md
  • CHANGELOG.md

Walkthrough

This PR expands the optional sass-loader peer dependency range to include ^17.0.0 across three package manifests and updates all related documentation to reflect the new version support.

Changes

sass-loader v17 support

Layer / File(s) Summary
Peer dependency range expansion
package.json, packages/shakapacker-webpack/package.json, packages/shakapacker-rspack/package.json
peerDependencies.sass-loader updated in all three manifests to include ^17.0.0 alongside existing ^13.0.0 through ^16.0.0 ranges.
Documentation updates
CHANGELOG.md, docs/peer-dependencies.md, docs/dependency-strategy.md
CHANGELOG adds unreleased entry documenting v17 support and Node.js requirements; peer-dependencies and dependency-strategy docs update the version matrix and supplemental package tables to include ^17.0.0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • shakacode/shakapacker#1133: Expands peerDependencies.sass-loader in packages/shakapacker-rspack/package.json to include ^17.0.0, related to prior peer-range widening.

Poem

🐰 I hopped through manifests, bold and spry,

Added "seventeen" beneath the sky,
Docs updated, changelog sings,
Now Sass can stretch its modern wings,
Cheers — a rabbit's tiny hi!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely summarizes the main change: expanding sass-loader peer dependency support to v17 across all packages.
Linked Issues check ✅ Passed All coding requirements from issue #1140 are met: sass-loader ^17.0.0 added to peer ranges in all packages, documentation updated, CHANGELOG entry added, and installer default intentionally preserved at v16.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #1140 scope: peer dependency updates, documentation updates, and CHANGELOG entry—no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR widens the optional sass-loader peer dependency range to include ^17.0.0 across shakapacker, shakapacker-webpack, and shakapacker-rspack, letting apps on Node 22.12+ opt into sass-loader v17 without any loader-rule changes. The installer default is intentionally held at v16 to preserve compatibility for Node 20 users.

  • Peer range widened in all three package.json files from ^13.0.0 || ... || ^16.0.0 to ^13.0.0 || ... || ^17.0.0; the lib/install/package.json installer default is correctly left at v16.
  • Docs updated in docs/peer-dependencies.md and docs/dependency-strategy.md to reflect the five-version range and the new table formatting.
  • CHANGELOG entry added but the PR link still contains the #XXXX placeholder that should be replaced with #1141.

Confidence Score: 5/5

Safe to merge — changes are limited to widening an optional peer range; existing Node 20 users are unaffected and no loader logic was modified.

The diff touches only peer dependency declarations and documentation. The Sass loader rule itself is unchanged, and the existing test suite already asserts that v17 maps to the correct loadPaths code path. The only cosmetic issue is the #XXXX placeholder in the changelog entry.

CHANGELOG.md — the #XXXX PR placeholder needs to be updated to #1141 before the release is cut.

Important Files Changed

Filename Overview
CHANGELOG.md Adds changelog entry for sass-loader v17 support; PR link still contains the #XXXX placeholder.
package.json Widens peerDependencies sass-loader range from ^16.0.0 to include ^17.0.0; change is consistent with other packages.
packages/shakapacker-rspack/package.json Mirrors the sass-loader peer range widening from the core package; consistent change.
packages/shakapacker-webpack/package.json Mirrors the sass-loader peer range widening from the core package; consistent change.
docs/peer-dependencies.md Documentation updated to reflect the new sass-loader ^17.0.0 peer range.
docs/dependency-strategy.md Documentation tables updated to show 5 major sass-loader versions and the expanded range; all three affected sections updated consistently.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[App installs sass-loader] --> B{Node.js version?}
    B -->|Node 20.19.x| C["Resolves sass-loader ^16.x\n(highest matching v16)"]
    B -->|Node 22.12+| D["Can opt into ^17.x\n(highest matching v17)"]
    C --> E["Sass rule: loadPaths + api: modern\n(v16+ branch)"]
    D --> E
    E --> F[Builds successfully]
    G["lib/install/package.json\n(installer default: ^16.x)"] -->|New app generated| C
    style D fill:#d4edda,stroke:#28a745
    style C fill:#fff3cd,stroke:#ffc107
Loading

Reviews (1): Last reviewed commit: "Fill in PR number for sass-loader v17 ch..." | Re-trigger Greptile

Comment thread CHANGELOG.md

### Added

- **Added support for `sass-loader` v17**. [PR #1141](https://github.com/shakacode/shakapacker/pull/1141) by [fukayatsu](https://github.com/fukayatsu). Widened the optional `sass-loader` peer range to `^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0` in core `shakapacker`, `shakapacker-webpack`, and `shakapacker-rspack`. The Sass rule already selects `loadPaths` for v16+ and keeps `api: "modern"`, both of which remain valid in v17. Note that sass-loader v17 requires Node.js 22.11.0+ and drops `node-sass` and the legacy Sass JS API, so apps that opt into v17 must already be on Node 22.12+ (the upper branch of Shakapacker's `engines.node` range).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Placeholder PR number not replaced

The changelog entry still uses #XXXX as the PR number placeholder rather than the actual PR number (#1141). Based on the project's changelog format guidelines, this should be [PR #1141](https://github.com/shakacode/shakapacker/pull/1141).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder was already replaced with #1141 in 35d6019.

@coderabbitai coderabbitai Bot added documentation p2 Medium: enhancements, docs, quality improvements labels May 27, 2026
@justin808

Copy link
Copy Markdown
Member

Thank you @fukayatsu! I just kicked off CI.

@justin808

Copy link
Copy Markdown
Member

@fukayatsu got some CI issues

@fukayatsu
fukayatsu force-pushed the support-sass-loader-17 branch from 35d6019 to 80134b8 Compare May 28, 2026 01:02
@fukayatsu

fukayatsu commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

The Test Both Bundlers CI failure predates this PR — it's been failing since run 26350915966 and is unrelated to the sass-loader change. It looks like #1142 will fix it, so I'm leaving it as-is here to keep this PR focused on the sass-loader v17 change.

@justin808

Copy link
Copy Markdown
Member

@fukayatsu thanks! Fixing and I'll push a release asap.

@justin808

Copy link
Copy Markdown
Member

@fukayatsu rebase as #1142 merged.

@fukayatsu
fukayatsu force-pushed the support-sass-loader-17 branch from 80134b8 to 8eef9e7 Compare May 28, 2026 08:31
@fukayatsu

Copy link
Copy Markdown
Contributor Author

@justin808 Rebased onto upstream/main, thanks!

@justin808

Copy link
Copy Markdown
Member

@claude please review this PR. Focus on:

  • Code quality and best practices
  • Potential bugs or issues
  • Security implications
  • Performance considerations

Please post your review as a PR comment, and use inline comments for specific code issues.

fukayatsu and others added 2 commits June 1, 2026 13:49
Widen the optional sass-loader peer range to include ^17.0.0 in core
shakapacker, shakapacker-webpack, and shakapacker-rspack, and update the
peer-dependency and dependency-strategy docs to match.

No rule changes are needed: the Sass rule already selects loadPaths for
v16+ and keeps api: "modern", both of which remain valid in v17. v17
requires Node.js 22.11.0+ and drops node-sass and the legacy Sass JS API,
so the addition is non-breaking — apps that opt into v17 already satisfy
the upper branch of engines.node (>=22.12.0), while Node 20 users stay on
v16 via the OR range. The pinned devDependency stays at 16.0.7 because CI
runs on Node 20.19.x.

The installer (lib/install/package.json) is intentionally NOT widened to
^17.0.0: its common range is the dependency actually installed into new
apps (package managers install the highest match), so defaulting new
installs to sass-loader 17 would force Node 22.12+ on apps that Shakapacker
still supports on Node 20.19. v17 stays opt-in via the peer range.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fukayatsu
fukayatsu force-pushed the support-sass-loader-17 branch from 8eef9e7 to 9950c91 Compare June 1, 2026 04:49
@fukayatsu

Copy link
Copy Markdown
Contributor Author

Rebased onto main to resolve the CHANGELOG.md conflict.

@justin808

Copy link
Copy Markdown
Member

@claude please review the latest commit on this PR. Focus on:

  • Code quality and best practices
  • Potential bugs or issues
  • Security implications
  • Performance considerations

Post your review as a PR comment, and use inline comments for specific code issues.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Claude finished @justin808's task in 1m 50s —— View job


PR Review: Support sass-loader v17

  • Gather context and understand the request
  • Read changed files
  • Analyze code quality, best practices, bugs, security, and performance
  • Post review findings

Summary

This is a clean, minimal PR that correctly widens the sass-loader peer range to ^17.0.0 without requiring any rule changes. The rationale is solid and well-documented. No bugs, security issues, or performance concerns were found.


Code Quality & Correctness ✅

Sass rule logic handles v17 correctly (package/rules/sass.ts:7):

const optionKey = packageMajorVersion("sass-loader") >= 16 ? "loadPaths" : "includePaths"

The >= 16 boundary already covers v17 — no rule change is needed. packageMajorVersion in package/utils/helpers.ts:85-88 uses parseInt for robust numeric comparison.

All three package manifests updated consistentlypackage.json, packages/shakapacker-webpack/package.json, and packages/shakapacker-rspack/package.json all now declare ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0. ✓

Installer intentionally left at v16lib/install/package.json still has ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0. The rationale is correct: npm/yarn/pnpm install the highest satisfying version, and v17's Node 22.11+ requirement would break new installs for Node 20 users who are still supported. ✓

peerDependenciesMeta.sass-loader.optional: true is set in all packages, so this remains non-breaking for apps that don't use Sass. ✓


Test Coverage

Existing sass-version-parsing.test.js:67 already asserts v17+loadPaths:

test("sass-loader v17+ uses loadPaths", () => {
  expect(getOptionKey(17)).toBe("loadPaths")
})

One minor observation (pre-existing, not introduced by this PR): sass.test.js and sass1.test.js both have a test description saying "v15 or earlier" but actually test with the real installed version (v16.0.7) because they don't mock packageMajorVersion. The assertions expect loadPaths (correct for v16), but the descriptions are misleading. Since sass16.test.js exists but there's no sass17.test.js, a dedicated file mocking packageMajorVersion = () => 17 would make the v17 story explicit in the integration test layer — though it's not strictly required since the boundary logic is already validated.


Security ✅

No security implications. This is a peer dependency range widening with no new code paths. The change is purely additive and opt-in.


Performance ✅

No runtime performance impact. Peer dependency ranges have no effect at build or runtime.


Documentation

Changelog, docs/peer-dependencies.md, and docs/dependency-strategy.md are all updated consistently. The CHANGELOG entry is accurate and includes the correct PR link (#1141), the Node.js 22.11.0+ requirement, and the breaking changes in v17 (dropped node-sass and legacy Sass JS API). ✓


Verdict

LGTM. The implementation is correct, the reasoning is well-documented, and the conservative installer default correctly protects Node 20 users. The only optional improvement would be a sass17.test.js integration test for completeness, but the existing coverage is logically sufficient.
| Branch: support-sass-loader-17

@justin808
justin808 merged commit 2030159 into shakacode:main Jun 3, 2026
20 checks passed
@justin808

Copy link
Copy Markdown
Member

Thanks @fukayatsu

@fukayatsu

Copy link
Copy Markdown
Contributor Author

@justin808 Thank you!

justin808 added a commit that referenced this pull request Jun 9, 2026
…nalyze-webpack-output

* origin/main: (164 commits)
  Make Rspack the default bundler for new installs (#1150)
  Add "Why Shakapacker with Rspack" comparison guide (#1155)
  Support sass-loader v17 (#1141)
  [codex] Fix Claude workflow permissions (#1153)
  Fix README CI badges and add prominent docs link (#1152)
  Trim README into a docs-site index; relocate content to docs/ and fix deep links (#1148)
  Tighten helper binstub parity and PATH lookup (#1128)
  Optimize CI: minimal version matrix on PRs, full matrix on main (#1151)
  Fix instance-scoped compiler strategies (#1147)
  Fix Rspack devServer in static watch mode (#1142)
  Add homepage links for supplemental npm packages (#1145)
  Release 10.1.0
  Update CHANGELOG.md for v10.1.0 (#1139)
  Expand prerelease-to-stable changelog coalesce guidance in /update-changelog (#1138)
  Release 10.1.0-rc.2
  [codex] Update changelog for v10.1.0-rc.2 (#1136)
  Teach /update-changelog to drop RC-only regression fixes (#1125)
  Restructure supplemental package dependencies (#1131) (#1133)
  [codex] Add Shakapacker brand assets (#1135)
  [codex] Fix shakapacker config helper binstubs (#1132)
  ...
@G-Rath G-Rath mentioned this pull request Jun 22, 2026
justin808 added a commit that referenced this pull request Jun 29, 2026
* origin/main: (26 commits)
  Adopt agent-workflow binstubs (.agents/bin/ + AGENTS.md pointer) (#1176)
  Fix Ruby 3.1 CI: exclude broken i18n 1.15.0/1.15.1 (Fiber[]) (#1171)
  Add AI analysis prompt generator to config exporter (#695)
  Make Rspack the default bundler for new installs (#1150)
  Add "Why Shakapacker with Rspack" comparison guide (#1155)
  Support sass-loader v17 (#1141)
  [codex] Fix Claude workflow permissions (#1153)
  Fix README CI badges and add prominent docs link (#1152)
  Trim README into a docs-site index; relocate content to docs/ and fix deep links (#1148)
  Tighten helper binstub parity and PATH lookup (#1128)
  Optimize CI: minimal version matrix on PRs, full matrix on main (#1151)
  Fix instance-scoped compiler strategies (#1147)
  Fix Rspack devServer in static watch mode (#1142)
  Add homepage links for supplemental npm packages (#1145)
  Release 10.1.0
  Update CHANGELOG.md for v10.1.0 (#1139)
  Expand prerelease-to-stable changelog coalesce guidance in /update-changelog (#1138)
  Release 10.1.0-rc.2
  [codex] Update changelog for v10.1.0-rc.2 (#1136)
  Teach /update-changelog to drop RC-only regression fixes (#1125)
  ...

# Conflicts:
#	CHANGELOG.md
#	lib/install/bin/diff-bundler-config
#	lib/install/bin/shakapacker-config
#	lib/tasks/shakapacker/export_bundler_config.rake
#	package/configExporter/cli.ts
#	spec/dummy/bin/shakapacker-config
justin808 added a commit that referenced this pull request Jul 4, 2026
## Summary

Stamps the **`v10.2.0`** release section in `CHANGELOG.md` and adds the
user-visible entries that were still missing for PRs merged since
`v10.1.0`.

Header format matches the repo convention (`## [v10.2.0] - July 3,
2026`) and is parseable by `rakelib/release.rake`'s
`extract_changelog_section` (`## [v<npm-version>]`), so `bundle exec
rake release` / `sync_github_release` will pick up the notes
automatically.

### Changelog changes

- **Version header**: inserted `## [v10.2.0] - July 3, 2026` immediately
after `## [Unreleased]`; all accumulated entries now live under it, and
`## [Unreleased]` is empty.
- **Compare links**: `[unreleased]` now compares `v10.2.0...main`; added
`[v10.2.0]: …/compare/v10.1.0...v10.2.0`.

### New entries added (were missing)

| PR | Section | Note |
| --- | --- | --- |
| [#1187](#1187) | Added |
Babel 8 peer dependency support + preset option compatibility |
| [#1184](#1184) | Added |
Folded into the #695 AI-prompt entry (gates the React on Rails section
on app detection) |
| [#1142](#1142) | Fixed |
Rspack dev-server config no longer loads in static watch mode (fixes
#1137) |

### Already documented (carried into v10.2.0)

`#1180`, `#695`, `#1141`, `#1150`, `#1179`, `#1192`, `#1127`, `#1178`,
`#1161`, `#1147`.

### Reviewed and intentionally excluded (not user-visible)

Docs: `#1145`, `#1148`, `#1152`, `#1155`, `#1183`, `#1188`, `#1189`,
`#1193`.
CI: `#1151`, `#1168`, `#1171`.
Tests / fixtures: `#1128`, `#1154`, `#1167`, `#1186`.
Workflow / agent tooling: `#1153`, `#1176`, `#1182`.

(`#1107` is already documented under `## [v10.1.0]`.)

## Next step

After merge, run the repo's release task (no args) — it reads `v10.2.0`
from the changelog and creates the GitHub release from this section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation p2 Medium: enhancements, docs, quality improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support sass-loader v17

2 participants