Skip to content

Fix stale and broken documentation across Shakapacker guides#1023

Merged
justin808 merged 5 commits intomainfrom
jg-codex/docs-review-pass-1
Apr 2, 2026
Merged

Fix stale and broken documentation across Shakapacker guides#1023
justin808 merged 5 commits intomainfrom
jg-codex/docs-review-pass-1

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Mar 26, 2026

Summary

  • fix stale docs across README, API reference, React/setup guides, upgrade guides, and maintainer docs
  • repair broken local markdown links/anchors and replace invalid command examples with current Shakapacker task usage
  • refresh version/support guidance for Node, peer dependencies, React HMR, SWC/esbuild, CDN behavior, and release/setup workflows

Verification

  • git diff --check
  • custom local markdown target check (no missing local file links)
  • custom local anchor check (no broken in-page anchors)
  • yarn prettier --write on changed docs files

Notes

  • Did not run the full test suite because this is a docs-only change set.

Note

Low Risk
Low risk: documentation-only updates, but incorrect guidance could still confuse users if any command/version claims are wrong.

Overview
Documentation overhaul across core guides to align with current Shakapacker behavior and tooling, including updated Node.js baseline (Node 20+) and clearer guidance on optional peer dependencies and installer behavior.

Updates API/reference and migration docs to match current config/return shapes and workflows (e.g., symbol-keyed config data, refreshed manifest/dev-server/compiler examples), and replaces outdated commands with current bundle exec rake / bin/rake task usage.

Fixes broken links/anchors and refreshes several setup guides (React, TypeScript, CDN verification, Heroku deploy, releasing), including simplified React + SWC/Babel notes, TypeScript install/type-check recommendations, and updated peer dependency ranges/examples.

Written by Cursor Bugbot for commit 4bf06f1. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Documentation
    • Bumped Node.js prerequisite to 20 and refreshed README badges/prereqs
    • Updated TypeScript guidance, examples, and type-check recommendations
    • Simplified React examples to use .jsx entries and lighter setup
    • Clarified API, manifest, CDN verification, and compiler/manifest usage
    • Revised testing, contributing, hooks, release, and deployment instructions
    • Streamlined bundler/transpiler migration, peer-dependency guidance, and HMR notes
    • Numerous troubleshooting, precompile hook, CSS Modules, and minor docs edits

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

Walkthrough

This PR makes documentation-only edits across many docs: command examples now favor Bundler/rake, Node and dependency guidance updated, API/config examples switched to symbol-keyed access, bundler/transpiler/React/TypeScript docs revised, and several small formatting and example fixes.

Changes

Cohort / File(s) Summary
Contributor & Local Dev Docs
CLAUDE.md, CONTRIBUTING.md, spec/dummy/README.md
Testing command and git-hook setup updated (bundle exec rake test; yarn install + npx husky); dummy app setup uses local npm linking (yalc) and runs bundle install in spec/dummy.
README & Intro Guidance
README.md
Bumped Node.js prereq to >= 20; reworked peer-deps/install narrative; updated TypeScript install/type-check guidance and View Helpers TOC entry (HTTP 103 Early Hints).
API & Type Examples
docs/api-reference.md, package/types/README.md
Examples changed to symbol-keyed access (config.data[:...]); adjusted example return fields (public_output_path, additional_paths, assets_bundler_config_path), removed some deprecated fields, and formatting/trailing-comma tweaks in type examples.
CDN, Deployment & Releases
docs/cdn_setup.md, docs/deployment.md, docs/releasing.md
CDN verification moved to runtime HTML checks (curl); Heroku push uses HEAD:main; release prerequisites add gem install gem-release; lockfile update adds yarn install in spec/dummy.
Bundler / Transpiler Guides
docs/rspack_migration_guide.md, docs/transpiler-migration.md, docs/using_esbuild_loader.md, docs/using_swc_loader.md
Prefer bin/rake / bundle exec rake with -- passthrough; config lookup/defaults adjusted; SWC/esbuild config shape updates; clobber/compile examples use rake tasks; clarify react-refresh auto-insertion.
CSS Modules & Webpack Overrides
docs/css-modules-export-mode.md, docs/v9_upgrade.md
Examples set exportLocalsConvention"camelCase"; removed alternative environment.js approach and updated guidance for where to place overrides.
React & HMR Docs
docs/react.md
Simplified React integration: .jsx entries/components, minimal dependency list (react, react-dom), updated mount/example, and HMR/react-refresh notes.
Precompile, Build & Troubleshooting
docs/precompile_hook.md, docs/common-upgrades.md, docs/troubleshooting.md
Clarified when precompile_hook runs; replaced direct bin/shakapacker examples with bundle exec rake shakapacker:...; Windows commands adjusted; require matching gem/npm versions in troubleshooting.
Peer Dependencies & Packaging
docs/peer-dependencies.md
Consolidated dependency sections, point to live package.json ranges, added peerDependenciesMeta guidance, adjusted package lists and semver ranges, added TypeScript authoring helpers.
Minor Docs & Links
docs/early_hints.md, docs/typescript-migration.md, docs/common-upgrades.md, docs/cdn_setup.md
Small formatting, heading, and link updates; resource/link replacements and CLI example normalizations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Poem

🐰 Hop, hop — the docs refreshed and bright,
Commands now routed by rake's soft light,
Node twenty marching, types and React in tow,
Bundlers sorted, examples all aglow,
I nibble crumbs of changelog joy and go!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: a documentation refresh addressing stale and broken guides across the Shakapacker project to align with v9 behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg-codex/docs-review-pass-1

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
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 26, 2026

Greptile Summary

This is a docs-only sweep across 22 files that fixes stale commands, broken local links, and outdated version/API guidance accumulated since the Shakapacker v9 release. No source code is changed.\n\nKey corrections made:\n- bin/shakapacker clobber/compile replaced with bundle exec rake shakapacker:clobber/compile throughout (docs/common-upgrades.md, docs/transpiler-migration.md, docs/using_swc_loader.md)\n- Node.js minimum bumped from 14 to 20 in README badge and requirements table\n- docs/react.md simplified from a Babel-only, step-by-step guide to an SWC-first setup with proper HMR instructions for both webpack and rspack\n- docs/rspack_migration_guide.md rake flag syntax corrected with -- separator so CLI args are passed to the task rather than interpreted by rake\n- docs/api-reference.md scrubbed of non-existent methods and updated return-type examples\n- docs/transpiler-migration.md SWC config examples wrapped in the required options: key\n- Husky v9 setup commands in CONTRIBUTING.md updated from deprecated husky install/husky add to npx husky\n- Heroku push command updated from git push heroku master to git push heroku HEAD:main\n- Dead link in docs/typescript-migration.md replaced with a valid absolute GitHub URL

Confidence Score: 5/5

Safe to merge — docs-only change set with no source code modifications and no test-suite impact.

All 22 changed files are documentation. The corrections are accurate and well-scoped. The two P2 comments are non-blocking style suggestions and do not affect correctness of the rest of the PR.

docs/api-reference.md (return-type examples worth a spot-check against source), docs/transpiler-migration.md (active assets_bundler: webpack key in transpiler-selection YAML block)

Important Files Changed

Filename Overview
docs/api-reference.md Multiple API return-value examples corrected to match actual runtime output. Removed non-existent methods; replaced https?/https config with server. Compilation error handling updated to reflect boolean return instead of exception.
docs/react.md Major simplification: removed verbose Babel-only setup; replaced with concise SWC-first instructions and correct HMR setup for both webpack and rspack.
docs/transpiler-migration.md Condensed transpiler YAML snippet; added nested options wrapper to SWC config examples; replaced bin/shakapacker with bundle exec rake commands. The assets_bundler: webpack active key in the transpiler-selection snippet may be misleading.
docs/css-modules-export-mode.md Removed stale environment.js Option 3 example. Changed exportLocalsConvention from "asIs" to "camelCase" in two places — aligns with css-loader v6 default but is a behavioral difference worth documenting.
docs/peer-dependencies.md Major rewrite: replaced outdated v9.0.0 pin notice with pointer to package.json, reorganised into Common/Webpack/Rspack/Babel/SWC/esbuild sections with current semver ranges.
docs/rspack_migration_guide.md Updated flag syntax with -- separator for rake CLI args. Replaced conditional bundler-detection pattern with separate-directories recommendation. bin/rake usage is intentional.
README.md Node.js requirement bumped from 14+ to 20+; peer-dependency notes condensed to link out to dedicated docs; TypeScript instructions updated.
CONTRIBUTING.md Updated ToC anchor, refreshed Husky v9 setup commands from deprecated husky install/husky add to npx husky.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User installs Shakapacker] --> B{Choose bundler}
    B -->|webpack| C[config/webpack/webpack.config.js]
    B -->|rspack| D[config/rspack/rspack.config.js]
    C --> E{Choose transpiler}
    D --> E
    E -->|swc default| F[SWC via swc-loader]
    E -->|babel| G[Babel via babel-loader]
    E -->|esbuild| H[esbuild via esbuild-loader]
    F --> I{HMR enabled?}
    G --> I
    H --> I
    I -->|webpack + HMR| J[react-refresh-webpack-plugin auto-added]
    I -->|rspack + HMR| K[rspack plugin-react-refresh auto-added]
    I -->|no HMR| L[Production build via bundle exec rake]
    J --> M[bin/shakapacker-dev-server]
    K --> M
Loading

Reviews (1): Last reviewed commit: "docs: fix stale and broken guides" | Re-trigger Greptile

Comment thread docs/transpiler-migration.md Outdated
// Override v9 default to use v8-style default exports
cssLoaderUse.options.modules.namedExport = false
cssLoaderUse.options.modules.exportLocalsConvention = "asIs"
cssLoaderUse.options.modules.exportLocalsConvention = "camelCase"
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 Behavioral difference between "asIs" and "camelCase" worth noting

The change from "asIs" to "camelCase" is semantically meaningful:

  • "asIs" → class names are exported exactly as written (.my-classstyles['my-class'])
  • "camelCase" → both the original and a camelCase form are exported (.my-class → both styles['my-class'] and styles.myClass)

If the goal is to restore the css-loader v6 default (which was "camelCase"), this change is correct. However, users who previously adopted the code from this guide using "asIs" to preserve hyphenated class names verbatim will now observe different exports. Updating the inline comment to note this difference would help readers understand the change:

Suggested change
cssLoaderUse.options.modules.exportLocalsConvention = "camelCase"
cssLoaderUse.options.modules.exportLocalsConvention = "camelCase" // exports both original and camelCase forms; matches css-loader v6 default

The same concern applies to the parallel occurrence in the Sass modules example.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 26, 2026

test comment

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 26, 2026

Documentation Review

Overall this is a solid docs pass — most corrections are accurate against the actual source code. Two issues worth addressing before merge, plus one pre-existing bug worth fixing since the surrounding code is being touched.

Comment thread docs/transpiler-migration.md Outdated
Comment thread docs/api-reference.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/cdn_setup.md`:
- Around line 208-210: Replace the weak verification step that uses "grep
/packs/" with a check that searches for the configured CDN hostname or full CDN
URL pattern in the rendered HTML; update the docs text and example command that
currently references "grep /packs/" so it instead greps (or uses a regex) for
your actual CDN host (e.g., the configured CDN domain or
"https://<your-cdn-host>") to ensure asset tags include the CDN host rather than
just matching relative "/packs/" paths.

In `@docs/troubleshooting.md`:
- Around line 257-271: The Gemfile and package.json version specifiers for
shakapacker allow different ranges which can lead to mismatched releases; update
the Gemfile's gem 'shakapacker' specifier and the package.json "shakapacker"
dependency so they express the same compatible range (e.g., change gem
'shakapacker', '~> 9.1' to '~> 9.1.1' and change "shakapacker": "^9.1.1" to a
matching "~9.1.1", or alternatively use a shared broader constraint like '>=
9.1.1, < 9.2.0' in both places) to ensure the gem and npm package stay
synchronized.

In `@docs/v9_upgrade.md`:
- Around line 39-40: The documented NODE_ENV fallback is incorrect: update the
bullet that currently reads "When `RAILS_ENV` is unset or any other custom value
(staging, qa, etc.) → `NODE_ENV` defaults to \"production\"" so it reflects the
actual runtime logic by replacing `"production"` with `"development"` (i.e.,
change that text to indicate NODE_ENV defaults to "development" for unset or
custom RAILS_ENV values).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57a5c6ec-405a-493b-9e8e-b6d81f11cd1f

📥 Commits

Reviewing files that changed from the base of the PR and between fc0f9a2 and e7fd841.

📒 Files selected for processing (22)
  • CLAUDE.md
  • CONTRIBUTING.md
  • README.md
  • docs/api-reference.md
  • docs/cdn_setup.md
  • docs/common-upgrades.md
  • docs/css-modules-export-mode.md
  • docs/deployment.md
  • docs/early_hints.md
  • docs/peer-dependencies.md
  • docs/precompile_hook.md
  • docs/react.md
  • docs/releasing.md
  • docs/rspack_migration_guide.md
  • docs/transpiler-migration.md
  • docs/troubleshooting.md
  • docs/typescript-migration.md
  • docs/using_esbuild_loader.md
  • docs/using_swc_loader.md
  • docs/v9_upgrade.md
  • package/types/README.md
  • spec/dummy/README.md

Comment thread docs/cdn_setup.md Outdated
Comment thread docs/troubleshooting.md
Comment on lines +257 to +271
**Solution:** This was fixed in Shakapacker v9.1.1+. Upgrade both the gem and npm package to the same version:

```ruby
# Gemfile
gem 'shakapacker', '~> 9.1'
```

```json
// package.json
{
"dependencies": {
"shakapacker": "^9.1.1"
}
}
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Version specifier mismatch between gem and npm package.

The documentation states to "upgrade both the gem and npm package to the same version," but the version specifiers allow different version ranges:

  • Gemfile ~> 9.1 allows only 9.1.x (e.g., 9.1.0, 9.1.1, 9.1.5)
  • package.json ^9.1.1 allows any 9.x.x (e.g., 9.1.1, 9.2.0, 9.3.0)

This could result in mismatched versions (e.g., gem at 9.1.5, npm at 9.2.0), defeating the purpose of keeping them synchronized.

🔧 Proposed fix to align version specifiers

Option 1 (Recommended): Use compatible version ranges for both

 ```ruby
 # Gemfile
-gem 'shakapacker', '~> 9.1'
+gem 'shakapacker', '~> 9.1.1'
// package.json
{
  "dependencies": {
-    "shakapacker": "^9.1.1"
+    "shakapacker": "~9.1.1"
  }
}

Option 2: Use broader range for both (if intentional)

```diff
 ```ruby
 # Gemfile
-gem 'shakapacker', '~> 9.1'
+gem 'shakapacker', '~> 9.1', '>= 9.1.1'

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/troubleshooting.md around lines 257 - 271, The Gemfile and package.json
version specifiers for shakapacker allow different ranges which can lead to
mismatched releases; update the Gemfile's gem 'shakapacker' specifier and the
package.json "shakapacker" dependency so they express the same compatible range
(e.g., change gem 'shakapacker', '> 9.1' to '> 9.1.1' and change
"shakapacker": "^9.1.1" to a matching "~9.1.1", or alternatively use a shared
broader constraint like '>= 9.1.1, < 9.2.0' in both places) to ensure the gem
and npm package stay synchronized.


</details>

<!-- fingerprinting:phantom:triton:puma -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment thread docs/v9_upgrade.md
Comment on lines +39 to 40
- When `RAILS_ENV` is unset or any other custom value (staging, qa, etc.) → `NODE_ENV` defaults to `"production"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

NODE_ENV fallback behavior is documented incorrectly here.

For unset or custom RAILS_ENV values, current logic defaults NODE_ENV to "development", not "production". Please fix this bullet to match runtime behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/v9_upgrade.md` around lines 39 - 40, The documented NODE_ENV fallback is
incorrect: update the bullet that currently reads "When `RAILS_ENV` is unset or
any other custom value (staging, qa, etc.) → `NODE_ENV` defaults to
\"production\"" so it reflects the actual runtime logic by replacing
`"production"` with `"development"` (i.e., change that text to indicate NODE_ENV
defaults to "development" for unset or custom RAILS_ENV values).

Comment thread docs/api-reference.md
rescue Shakapacker::Configuration::InvalidConfigurationError => e
Rails.logger.error "Invalid config: #{e.message}"
Shakapacker.config.fetch(:unknown_key)
rescue KeyError => e
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.

Bug: config.fetch won't raise KeyError for unknown keys.

Shakapacker::Configuration#fetch is implemented as:

def fetch(key)
  data.fetch(key, defaults[key])
end

defaults is a HashWithIndifferentAccess — accessing an unknown key on it returns nil, not a KeyError. So config.fetch(:unknown_key) returns nil silently rather than raising. The original example was also wrong (InvalidConfigurationError doesn't exist in the codebase), but the replacement is equally incorrect. Consider removing this example or replacing it with an error condition that actually occurs.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 26, 2026

Overall this PR is a solid docs cleanup. One factual error is flagged inline on docs/api-reference.md line 460. Positive callouts: swc.config.js options wrapper fix aligns with using_swc_loader.md; symbol key corrections for config.data are accurate; removing non-existent API methods (status_url, asset_url, last_compilation_digest, CompilationError etc) is good cleanup; manifest.refresh return value is correctly documented; CDN manifest clarification is accurate; NODE_ENV behaviour fix in v9_upgrade.md matches the actual source code; rake task -- separator matches the task documented usage.

@justin808 justin808 force-pushed the jg-codex/docs-review-pass-1 branch from e7fd841 to 88c4464 Compare March 31, 2026 08:46
Comment thread docs/troubleshooting.md
**Solution:** This was fixed in Shakapacker v9.1.1+. Upgrade to the latest version:
**Solution:** This was fixed in Shakapacker v9.1.1+. Upgrade both the gem and npm package to the same version:

```ruby
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.

The Gemfile specifier ~> 9.1 expands to >= 9.1.0, < 10, so it would allow installing 9.1.0 — which is the version that doesn't have the fix. Since the section heading says "fixed in v9.1.1+", the minimum should be pinned to 9.1.1:

Suggested change
```ruby
gem 'shakapacker', '~> 9.1', '>= 9.1.1'

Or if a tighter patch pin is preferred:

Suggested change
```ruby
gem 'shakapacker', '~> 9.1.1'

Either way the intent should match the ^9.1.1 floor used in the package.json example below.

Comment thread docs/cdn_setup.md
2. Clear Rails cache: `bundle exec rake tmp:cache:clear`
3. Check the manifest.json file includes CDN URLs:
3. Check your rendered asset tags use the CDN host. The manifest intentionally stores pack paths without the CDN host:
```bash
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.

The new command still greps for /packs/, which will match whether or not the CDN is in use (every app will have /packs/ paths). This doesn't verify that the CDN host appears in the rendered HTML.

A more meaningful check would grep for the configured CDN hostname:

Suggested change
```bash
curl -s https://your-app.example.com | grep "your-cdn-host.example.com"

Replace your-cdn-host.example.com with the actual value of SHAKAPACKER_ASSET_HOST / config.action_controller.asset_host. This fails loudly if the CDN host is absent from the rendered asset tags, which is exactly what the troubleshooting step is meant to catch.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
docs/troubleshooting.md (1)

257-269: ⚠️ Potential issue | 🟠 Major

Version constraints still contradict the “same version” guidance.

Line 257 says both dependencies should be the same version, but Line 261 (~> 9.1) and Line 268 (^9.1.1) allow different ranges and can drift.

🔧 Suggested doc fix
 # Gemfile
-gem 'shakapacker', '~> 9.1'
+gem 'shakapacker', '~> 9.1.1'
 {
   "dependencies": {
-    "shakapacker": "^9.1.1"
+    "shakapacker": "~9.1.1"
   }
 }

Based on learnings: "Be aware of the dual package.json/Gemfile dependency management in Shakapacker".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/troubleshooting.md` around lines 257 - 269, The docs currently recommend
"the same version" but show Gemfile using ~> 9.1 and package.json using ^9.1.1
which allow different ranges; update the example to pin the identical
Shakapacker version in both manifests (replace Gemfile's gem 'shakapacker', '~>
9.1' and package.json's "shakapacker": "^9.1.1" with the same exact version
string, e.g. '9.1.1', so both Gemfile and package.json reference the exact same
release).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/troubleshooting.md`:
- Around line 257-269: The docs currently recommend "the same version" but show
Gemfile using ~> 9.1 and package.json using ^9.1.1 which allow different ranges;
update the example to pin the identical Shakapacker version in both manifests
(replace Gemfile's gem 'shakapacker', '~> 9.1' and package.json's "shakapacker":
"^9.1.1" with the same exact version string, e.g. '9.1.1', so both Gemfile and
package.json reference the exact same release).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 95c14161-d248-41cb-91c2-80c8d9af170a

📥 Commits

Reviewing files that changed from the base of the PR and between e7fd841 and 88c4464.

📒 Files selected for processing (22)
  • CLAUDE.md
  • CONTRIBUTING.md
  • README.md
  • docs/api-reference.md
  • docs/cdn_setup.md
  • docs/common-upgrades.md
  • docs/css-modules-export-mode.md
  • docs/deployment.md
  • docs/early_hints.md
  • docs/peer-dependencies.md
  • docs/precompile_hook.md
  • docs/react.md
  • docs/releasing.md
  • docs/rspack_migration_guide.md
  • docs/transpiler-migration.md
  • docs/troubleshooting.md
  • docs/typescript-migration.md
  • docs/using_esbuild_loader.md
  • docs/using_swc_loader.md
  • docs/v9_upgrade.md
  • package/types/README.md
  • spec/dummy/README.md
✅ Files skipped from review due to trivial changes (12)
  • docs/early_hints.md
  • docs/typescript-migration.md
  • docs/v9_upgrade.md
  • CLAUDE.md
  • docs/deployment.md
  • docs/using_swc_loader.md
  • package/types/README.md
  • docs/cdn_setup.md
  • docs/css-modules-export-mode.md
  • docs/using_esbuild_loader.md
  • docs/peer-dependencies.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (7)
  • docs/common-upgrades.md
  • spec/dummy/README.md
  • docs/releasing.md
  • docs/precompile_hook.md
  • docs/rspack_migration_guide.md
  • docs/react.md
  • CONTRIBUTING.md

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 31, 2026

Review: Fix stale and broken documentation

Overall this is a well-scoped docs clean-up. Most of the factual corrections are verified against the source code and accurate:

  • symbol-keyed config.data — confirmed by lib/shakapacker/configuration.rb (@return [Hash<Symbol, Object>])
  • public_output_path returns a Pathname — confirmed (public_path.join(...))
  • assets_bundler_config_path returns a String — confirmed
  • additional_paths returns raw strings — confirmed (fetch(:additional_paths))
  • Removed CompilationError / InvalidConfigurationError — neither class exists in the codebase; removal is correct
  • Removed dev_server.asset_url / dev_server.status_url — neither method exists; removal is correct
  • dev_server.protocol / dev_server.host_with_port — both exist in lib/shakapacker/dev_server.rb
  • SWC config options: wrapper — correct per package/swc/index.ts (merge(defaultConfig, customConfig) expects the custom config at the RuleSetRule level, so options.jsc maps cleanly)
  • CSS modules exportLocalsConvention: "camelCase" — matches the actual v8-compat path in package/utils/getStyleRule.ts (line 49–52)
  • NODE_ENV unset → "production" — confirmed by lib/shakapacker.rb:112 (DEV_ENVS.include?(ENV["RAILS_ENV"]) ? "development" : "production"); nil is not in DEV_ENVS, so unset RAILS_ENV correctly maps to production
  • bin/rake shakapacker:switch_bundler -- --init-config — the -- separator is required per the rake task's own usage string (lib/tasks/shakapacker/switch_bundler.rake:22)

Two concrete issues flagged inline:

  1. docs/troubleshooting.md:259gem 'shakapacker', '~> 9.1' permits 9.1.0 (the unfixed version); the minimum should be ~> 9.1.1 to match the stated "v9.1.1+" requirement.
  2. docs/cdn_setup.md:209 — the grep /packs/ check does not verify that asset tags include the CDN host; it passes even when CDN is not configured. Should grep for the CDN hostname instead.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/react.md (1)

19-19: Consider tightening wording in the “manual setup” caveat.

“very simple” is a bit vague; replacing it with “basic” or “minimal” reads more crisply in docs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/react.md` at line 19, Update the caveat sentence that reads "This manual
setup is best for very simple React usage." to use a crisper adjective such as
"basic" or "minimal" (e.g., "This manual setup is best for basic React usage."),
so replace "very simple" with the chosen word in the same sentence in the docs
content.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/react.md`:
- Line 19: Update the caveat sentence that reads "This manual setup is best for
very simple React usage." to use a crisper adjective such as "basic" or
"minimal" (e.g., "This manual setup is best for basic React usage."), so replace
"very simple" with the chosen word in the same sentence in the docs content.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6e3cad5f-fefe-4901-9137-2b6a7c3d9056

📥 Commits

Reviewing files that changed from the base of the PR and between 88c4464 and 208fd47.

📒 Files selected for processing (1)
  • docs/react.md

…pass-1

* origin/main:
  Allow webpack-cli v7 in peer dependencies (#1021)

# Conflicts:
#	docs/peer-dependencies.md
Comment thread docs/troubleshooting.md
```ruby
# Gemfile
gem 'shakapacker', '~> 9.1'
gem 'shakapacker', '~> 9.1.1'
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.

The surrounding text says "This was fixed in Shakapacker v9.1.1+", but ~> 9.1 allows 9.1.0 (the unfixed release) — it's equivalent to >= 9.1.0, < 10.0. The npm side correctly uses ^9.1.1.

Suggested change
gem 'shakapacker', '~> 9.1.1'
gem 'shakapacker', '~> 9.1.1'

Comment thread docs/cdn_setup.md
3. Check your rendered asset tags use the CDN host. The manifest intentionally stores pack paths without the CDN host:
```bash
cat public/packs/manifest.json
curl -s https://your-app.example.com | grep cdn.example.com
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.

This check is misleading. grep /packs/ matches whether CDN is configured or not — assets always reference /packs/ paths in the manifest (as the docs note, the manifest stores paths without the CDN host). The grep will pass even when CDN is not working.

To actually verify CDN is in use, grep for the CDN host in rendered <script>/<link> tags:

Suggested change
curl -s https://your-app.example.com | grep cdn.example.com
curl -s https://your-app.example.com | grep 'your-cdn-host.example.com'

Replace your-cdn-host.example.com with the configured SHAKAPACKER_ASSET_HOST value.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 2, 2026

Review posted with 2 inline comments. Summary: docs/troubleshooting.md:261 needs tilde constraint fixed (~> 9.1 -> ~> 9.1.1), and docs/cdn_setup.md:210 grep command needs to check CDN hostname not /packs/ path. NODE_ENV claim in v9_upgrade.md is correct (CodeRabbit was wrong).

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 2, 2026

Documentation Review

Verified all API examples against the current source code. The corrections are accurate and the overall quality is high.

Verified correct:

  • config.data symbol keys — configuration.rb confirms @return [Hash<Symbol, Object>] and deep_symbolize_keys on load
  • public_output_path return type — public_path.join(...) returns a Pathname, not a bare string
  • additional_paths return type — fetch(:additional_paths) returns strings, not Pathnames
  • assets_bundler_config_path return type — returns a plain string (e.g. "config/webpack")
  • dev_server[:server]dev_server.rb has def server (not https?); removed status_url / asset_url which do not exist
  • compiler.fresh? / compiler.stale? — both are delegated via delegate :fresh?, :stale?, to: :strategy in compiler.rb
  • manifest.refresh return value — correctly returns the manifest hash; manifest.data correctly removed (it is private)
  • Removed CompilationError / InvalidConfigurationError — neither class exists in the codebase
  • Removed last_compilation_digest, watched_paths, config_files — none exist on Compiler
  • Fixed broken link — webpack-configuration.md does not exist; configuration.md does
  • Node 20+ — confirmed by package.json engines field
  • bundle exec rake test — correct; the Rakefile runs run_spec:all_specs (more comprehensive than bare rspec)
  • bin/shakapacker clobber/compile replaced with rake shakapacker:clobber/compile — correct, Runner has no such subcommands
  • Peer dependency ranges in docs/peer-dependencies.md — all match package.json
  • Husky v9 commands — npx husky is correct for ^9.1.7

One behavioral change to be aware of:

docs/css-modules-export-mode.md Option 2 changes exportLocalsConvention from "asIs" to "camelCase". With namedExport: false, "asIs" exports only the literal class name (styles["my-button"]), while "camelCase" also adds a camelCase alias (styles.myButton). This change makes Option 2 consistent with what Option 1 (css_modules_export_mode: default) does internally — Shakapacker sets camelCase in its built-in default mode, not asIs. So the original example was the inconsistency. Left an inline note since it is a real behavioral difference for anyone relying on the old example to avoid camelCase aliasing.

Minor nit:

docs/api-reference.md removes the manifest.data example without any note. Since manifest.data is private this is the right call, but a brief comment pointing to manifest.refresh might help readers who expected a read-only accessor.

// Override v9 default to use v8-style default exports
cssLoaderUse.options.modules.namedExport = false
cssLoaderUse.options.modules.exportLocalsConvention = "asIs"
cssLoaderUse.options.modules.exportLocalsConvention = "camelCase"
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.

This change from "asIs""camelCase" is actually correct — Shakapacker's built-in css_modules_export_mode: default (Option 1) sets exportLocalsConvention: 'camelCase', so this makes Option 2 consistent with it.

Worth noting the behavioral difference for anyone reading this: with "asIs", only the literal class name is exported (styles["my-button"]), while "camelCase" also adds a camelCase alias (styles.myButton). Users who were relying on the old Option 2 example specifically to suppress camelCase aliasing should use "asIs" instead.

Consider adding a one-line note to the section, e.g.:

Use "asIs" instead if you want class names exported exactly as written with no camelCase aliases.

@justin808 justin808 merged commit 5ac0956 into main Apr 2, 2026
13 checks passed
@justin808 justin808 deleted the jg-codex/docs-review-pass-1 branch April 2, 2026 02:38
justin808 added a commit that referenced this pull request Apr 30, 2026
* origin/main: (22 commits)
  docs: add Dependabot configuration guide (#1094)
  Sync address-review prompt with upstream PR #16 (#1098)
  Supersede #910: entry shape test with lint unblock (#919)
  fix: align rspack v2 peer deps and installer defaults (#1091)
  docs: update README and guides for Shakapacker v10 (#1092)
  Release 10.0.0
  Update CHANGELOG.md for v10.0.0 (#1089)
  Release 10.0.0-rc.1
  Update CHANGELOG.md for v10.0.0-rc.1 (#1087)
  Supersede #961 by using pack-config-diff (#973)
  Add final summary output to rake release (#1041)
  Add bin/setup to install development deps (#1039)
  Release 10.0.0-rc.0
  Use npx release-it to avoid mise shim failures (#1040)
  Fix Nokogiri build failure on Ruby 3.4.6 (#1038)
  Update CHANGELOG.md for v10.0.0-rc.0 (#1037)
  Update rspack dev deps to 2.0.0-rc.0 (#1036)
  Fix stale and broken documentation across Shakapacker guides (#1023)
  Allow webpack-cli v7 in peer dependencies (#1021)
  refactor: simplify resolving js peer versions when installing (#1034)
  ...

# Conflicts:
#	package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant