You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrade Shakapacker from 9.0.0 to 9.1.0 (#1921)
Why
Shakapacker 9.0.0 had compatibility issues with CSS Modules.
Summary
Updated Shakapacker to 9.1.0 across all dummy apps and fixed CSS
Modules configuration for backward compatibility.
Key improvements
- Fixed CSS Modules to support default imports (not named exports)
- Enhanced pre-commit hooks to lint Pro directory separately
- Added webpack config debugging documentation
Impact
Existing: CSS Modules continue working with default import syntax
New: Shakapacker 9.1.0 with improved stability
Risks
Breaking: CSS Modules namedExport override required for compatibility
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,12 +34,15 @@ Changes since the last non-beta release.
34
34
#### Changed
35
35
36
36
-**Shakapacker 9.0.0 Upgrade**: Upgraded Shakapacker from 8.2.0 to 9.0.0 with Babel transpiler configuration for compatibility. Key changes include:
37
+
37
38
- Configured `javascript_transpiler: babel` in shakapacker.yml (Shakapacker 9.0 defaults to SWC which has PropTypes handling issues)
38
39
- Added precompile hook support via `bin/shakapacker-precompile-hook` for ReScript builds and pack generation
39
40
- Configured CSS Modules to use default exports (`namedExport: false`) for backward compatibility with existing `import styles from` syntax
40
41
- Fixed webpack configuration to process SCSS rules and CSS loaders in a single pass for better performance
41
42
[PR 1904](https://github.com/shakacode/react_on_rails/pull/1904) by [justin808](https://github.com/justin808).
42
43
44
+
-**Shakapacker 9.1.0 Upgrade**: Upgraded Shakapacker from 9.0.0 to 9.1.0. This minor version update includes bug fixes and improvements. Updated webpack configuration in Pro dummy apps to use forEach pattern for better compatibility with multiple SCSS rules. [PR 1921](https://github.com/shakacode/react_on_rails/pull/1921) by [justin808](https://github.com/justin808).
45
+
43
46
#### Bug Fixes
44
47
45
48
-**Use as Git dependency**: All packages can now be installed as Git dependencies. This is useful for development and testing purposes. See [CONTRIBUTING.md](./CONTRIBUTING.md#git-dependencies) for documentation. [PR #1873](https://github.com/shakacode/react_on_rails/pull/1873) by [alexeyr-ci2](https://github.com/alexeyr-ci2).
Copy file name to clipboardExpand all lines: CLAUDE.md
+100-2Lines changed: 100 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,12 @@ These requirements are non-negotiable. CI will fail if not followed.
17
17
18
18
Git hooks will automatically run linting on **all changed files (staged + unstaged + untracked)** before each commit - making it fast while preventing CI failures!
19
19
20
+
Pre-commit hooks automatically run:
21
+
-**RuboCop** (auto-fix Ruby code style)
22
+
-**ESLint** (auto-fix JS/TS code style)
23
+
-**Prettier** (auto-format all supported files)
24
+
-**Trailing newline checks** (ensure all files end with newlines)
25
+
20
26
**Note:** Git hooks are for React on Rails gem developers only, not for users who install the gem.
21
27
22
28
## Development Commands
@@ -90,13 +96,17 @@ Git hooks will automatically run linting on **all changed files (staged + unstag
90
96
91
97
## Project Architecture
92
98
93
-
### Dual Package Structure
99
+
### Monorepo Structure
94
100
95
-
This project maintains both a Ruby gem and an NPM package:
101
+
This is a monorepo containing both the open-source package and the Pro package:
96
102
103
+
-**Open Source**: Root directory contains the main React on Rails gem and package
104
+
-**Pro Package**: `react_on_rails_pro/` contains the Pro features (separate linting/formatting config)
97
105
-**Ruby gem**: Located in `lib/`, provides Rails integration and server-side rendering
98
106
-**NPM package**: Located in `packages/react-on-rails/src/`, provides client-side React integration
99
107
108
+
**IMPORTANT**: The `react_on_rails_pro/` directory has its own Prettier/ESLint configuration. When CI runs, it lints both directories separately. The pre-commit hooks will catch issues in both directories.
109
+
100
110
### Core Components
101
111
102
112
#### Ruby Side (`lib/react_on_rails/`)
@@ -127,6 +137,94 @@ This project maintains both a Ruby gem and an NPM package:
127
137
-**Examples**: Generated via rake tasks for different webpack configurations
128
138
-**Rake tasks**: Defined in `rakelib/` for various development operations
129
139
140
+
## Debugging Webpack Configuration Issues
141
+
142
+
When encountering issues with Webpack/Shakapacker configuration (e.g., components not rendering, CSS modules failing), use this debugging approach:
143
+
144
+
### 1. Create Debug Scripts
145
+
146
+
Create temporary debug scripts in the dummy app root to inspect the actual webpack configuration:
147
+
148
+
```javascript
149
+
// debug-webpack-rules.js - Inspect all webpack rules
0 commit comments