Skip to content

Commit fba00f9

Browse files
justin808claude
andcommitted
Fix default loading strategy tests and run Prettier formatting
The default generated_component_packs_loading_strategy was changed to :defer in commit 4faf810 to avoid race conditions with async loading. This commit updates the tests to reflect the new default behavior. Changes: - Update test for Shakapacker >= 8.2.0 to expect :defer instead of :async - Update test for Shakapacker < 8.2.0 to expect :defer instead of :sync - Remove outdated warning expectation since :defer works on all versions - Suppress ESLint deprecation warning for tsEslint.config - Auto-format markdown files with Prettier All 433 gem specs now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ed64bc7 commit fba00f9

File tree

22 files changed

+292
-122
lines changed

22 files changed

+292
-122
lines changed

.claude/commands/update-changelog.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ You are helping to add an entry to the CHANGELOG.md file for the React on Rails
55
## Critical Requirements
66

77
1. **User-visible changes only**: Only add changelog entries for user-visible changes:
8-
98
- New features
109
- Bug fixes
1110
- Breaking changes
@@ -118,21 +117,18 @@ When a new version is released:
118117
### For Regular Changelog Updates
119118

120119
1. **ALWAYS fetch latest changes first**:
121-
122120
- **CRITICAL**: Run `git fetch origin master` to ensure you have the latest commits
123121
- The workspace may be behind origin/master, causing you to miss recently merged PRs
124122
- After fetching, use `origin/master` for all comparisons, NOT local `master` branch
125123

126124
2. **Determine the correct version tag to compare against**:
127-
128125
- First, check the tag dates: `git log --tags --simplify-by-decoration --pretty="format:%ai %d" | head -10`
129126
- Find the latest version tag and its date
130127
- Compare origin/master branch date to the tag date
131128
- If the tag is NEWER than origin/master, it means the branch needs to be updated to include the tag's commits
132129
- **CRITICAL**: Always use `git log TAG..BRANCH` to find commits that are in the tag but not in the branch, as the tag may be ahead
133130

134131
3. **Check commits and version boundaries**:
135-
136132
- **IMPORTANT**: Use `origin/master` in all commands below, not local `master`
137133
- Run `git log --oneline LAST_TAG..origin/master` to see commits since the last release
138134
- Also check `git log --oneline origin/master..LAST_TAG` to see if the tag is ahead of origin/master
@@ -148,20 +144,17 @@ When a new version is released:
148144
5. **Read the current CHANGELOG.md** to understand the existing structure and formatting.
149145

150146
6. **Determine where entries should go**:
151-
152147
- If the latest version tag is NEWER than origin/master branch, move entries from "Unreleased" to that version section
153148
- If origin/master is ahead of the latest tag, add new entries to "Unreleased"
154149
- Always verify the version date in CHANGELOG.md matches the actual tag date
155150

156151
7. **Add or move entries** to the appropriate section under appropriate category headings.
157-
158152
- **CRITICAL**: When moving entries from "Unreleased" to a version section, merge them with existing entries under the same category heading
159153
- **NEVER create duplicate section headings** (e.g., don't create two "### Fixed" sections)
160154
- If the version section already has a category heading (e.g., "### Fixed"), add the moved entries to that existing section
161155
- Maintain the category order as defined above
162156

163157
8. **Verify formatting**:
164-
165158
- Bold description with period
166159
- Proper PR link (NO hash symbol)
167160
- Proper author link
@@ -181,12 +174,10 @@ When a new version is released:
181174
When releasing from beta to a stable version (e.g., v16.1.0-beta.3 → v16.1.0):
182175

183176
1. **Remove all beta version labels** from the changelog:
184-
185177
- Change `### [v16.1.0-beta.1]`, `### [v16.1.0-beta.2]`, etc. to a single `### [v16.1.0]` section
186178
- Combine all beta entries into the stable release section
187179

188180
2. **Consolidate duplicate entries**:
189-
190181
- If bug fixes or changes were made to features introduced in earlier betas, keep only the final state
191182
- Remove redundant changelog entries for fixes to beta features
192183
- Keep the most recent/accurate description of each change

CHANGELOG.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Changes since the last non-beta release.
3838
#### Changed
3939

4040
- **Shakapacker 9.0.0 Upgrade**: Upgraded Shakapacker from 8.2.0 to 9.0.0 with Babel transpiler configuration for compatibility. Key changes include:
41-
4241
- Configured `javascript_transpiler: babel` in shakapacker.yml (Shakapacker 9.0 defaults to SWC which has PropTypes handling issues)
4342
- Added precompile hook support via `bin/shakapacker-precompile-hook` for ReScript builds and pack generation
4443
- Configured CSS Modules to use default exports (`namedExport: false`) for backward compatibility with existing `import styles from` syntax
@@ -100,7 +99,6 @@ To migrate to React on Rails Pro:
10099
**Note:** If you're not using any of the Pro-only methods listed above, no changes are required.
101100

102101
- **Pro-Specific Configurations Moved to Pro Gem**: The following React Server Components (RSC) configurations have been moved from `ReactOnRails.configure` to `ReactOnRailsPro.configure`:
103-
104102
- `rsc_bundle_js_file` - Path to the RSC bundle file
105103
- `react_server_client_manifest_file` - Path to the React server client manifest
106104
- `react_client_manifest_file` - Path to the React client manifest
@@ -126,7 +124,6 @@ To migrate to React on Rails Pro:
126124
See the [React on Rails Pro Configuration docs](https://github.com/shakacode/react_on_rails/blob/master/react_on_rails_pro/docs/configuration.md) for more details.
127125

128126
- **Streaming View Helpers Moved to Pro Gem**: The following view helpers have been removed from the open-source gem and are now only available in React on Rails Pro:
129-
130127
- `stream_react_component` - Progressive SSR using React 18+ streaming
131128
- `rsc_payload_react_component` - RSC payload rendering
132129

@@ -151,12 +148,10 @@ To migrate to React on Rails Pro:
151148
#### New Features
152149

153150
- **Server Bundle Security**: Added new configuration options for enhanced server bundle security and organization:
154-
155151
- `server_bundle_output_path`: Configurable directory (relative to the Rails root) for server bundle output (default: "ssr-generated"). If set to `nil`, the server bundle will be loaded from the same public directory as client bundles. [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
156152
- `enforce_private_server_bundles`: When enabled, ensures server bundles are only loaded from private directories outside the public folder (default: false for backward compatibility) [PR 1798](https://github.com/shakacode/react_on_rails/pull/1798) by [justin808](https://github.com/justin808)
157153

158154
- **Improved Bundle Path Resolution**: Bundle path resolution for server bundles now works as follows:
159-
160155
- If `server_bundle_output_path` is set, the server bundle is loaded from that directory.
161156
- If `server_bundle_output_path` is not set, the server bundle falls back to the client bundle directory (typically the public output path).
162157
- If `enforce_private_server_bundles` is enabled:
@@ -268,7 +263,6 @@ See [Release Notes](docs/release-notes/16.0.0.md) for complete migration guide.
268263

269264
- **`defer_generated_component_packs` deprecated** → use `generated_component_packs_loading_strategy`
270265
- Migration:
271-
272266
- `defer_generated_component_packs: true``generated_component_packs_loading_strategy: :defer`
273267
- `defer_generated_component_packs: false``generated_component_packs_loading_strategy: :sync`
274268
- Recommended: `generated_component_packs_loading_strategy: :async` for best performance
@@ -677,7 +671,6 @@ for details.
677671
- Removal of config.symlink_non_digested_assets_regex as it's no longer needed with rails/webpacker.
678672
If any business needs this, we can move the code to a separate gem.
679673
- Added configuration option `same_bundle_for_client_and_server` with default `false` because
680-
681674
1. Production applications would typically have a server bundle that differs from the client bundle
682675
2. This change only affects trying to use HMR with react_on_rails with rails/webpacker.
683676

@@ -1395,13 +1388,11 @@ No changes.
13951388
- Added automatic compilation of assets at precompile is now done by ReactOnRails. Thus, you don't need to provide your own `assets.rake` file that does the precompilation.
13961389
[#398](https://github.com/shakacode/react_on_rails/pull/398) by [robwise](https://github.com/robwise), [jbhatab](https://github.com/jbhatab), and [justin808](https://github.com/justin808).
13971390
- **Migration to v6**
1398-
13991391
- Do not run the generator again if you've already run it.
14001392

14011393
- See [shakacode/react-webpack-rails-tutorial/pull/287](https://github.com/shakacode/react-webpack-rails-tutorial/pull/287) for an example of upgrading from v5.
14021394

14031395
- To configure the asset compilation you can either
1404-
14051396
1. Specify a `config/react_on_rails` setting for `build_production_command` to be nil to turn this feature off.
14061397
2. Specify the script command you want to run to build your production assets, and remove your `assets.rake` file.
14071398

CODING_AGENTS.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,15 @@ Use `gh pr create` with:
260260
## Debugging Workflow
261261

262262
1. **Understand the Problem**
263-
264263
- Read the issue carefully
265264
- Reproduce the bug if possible
266265
- Identify root cause
267266

268267
2. **Create Minimal Test Case**
269-
270268
- Write failing test that demonstrates issue
271269
- Keep it focused and minimal
272270

273271
3. **Implement Fix**
274-
275272
- Make smallest change possible
276273
- Ensure fix doesn't break existing functionality
277274
- Follow existing code patterns

CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,22 +607,18 @@ This approach:
607607
**Common Issues and Solutions:**
608608

609609
1. **React components not rendering (empty divs)**
610-
611610
- **Cause**: Missing yalc setup for JavaScript package
612611
- **Solution**: Follow yalc setup steps above after running generator
613612

614613
2. **Generator fails with Shakapacker errors**
615-
616614
- **Cause**: Conflicting Shakapacker versions or incomplete installation
617615
- **Solution**: Clean reset and ensure consistent Shakapacker version across tests
618616

619617
3. **Babel configuration conflicts during yalc development**
620-
621618
- **Cause**: Both `babel.config.js` and `package.json` "babel" section defining presets
622619
- **Solution**: Remove "babel" section from `package.json`, keep only `babel.config.js`
623620

624621
4. **"Package.json not found" errors**
625-
626622
- **Cause**: Generator trying to access non-existent package.json files
627623
- **Solution**: Test with commits that fix this specific issue (e.g., bc69dcd0)
628624

TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@
5959
## Developer Experience
6060
6161
- [ ] **bin/dev help command enhancements**
62-
6362
- [x] Add emojis and colors for better readability
6463
- [ ] Add section about component development patterns
6564
- [ ] Include troubleshooting for client/server split issues
6665
6766
- [ ] **Babel Configuration Conflict Detection**
68-
6967
- [ ] Add validation in generator/initializer to detect conflicting Babel configs
7068
- [ ] Improve error messaging for duplicate preset issues
7169
- [ ] Common conflict: babel.config.js + package.json "babel" section

0 commit comments

Comments
 (0)