Skip to content

Commit b97c854

Browse files
authored
Fix prettier formatting issues from PR #1769 (#1774)
- Fix formatting in CHANGELOG.md - Fix formatting in CODING_AGENTS.md - Fix formatting in docs files - Fix formatting in CSS module test fixtures These formatting issues were introduced in the merged PR #1769 and are causing CI failures.
1 parent 52a1855 commit b97c854

File tree

9 files changed

+21
-2
lines changed

9 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ for details.
442442
- Removal of config.symlink_non_digested_assets_regex as it's no longer needed with rails/webpacker.
443443
If any business needs this, we can move the code to a separate gem.
444444
- Added configuration option `same_bundle_for_client_and_server` with default `false` because
445+
445446
1. Production applications would typically have a server bundle that differs from the client bundle
446447
2. This change only affects trying to use HMR with react_on_rails with rails/webpacker.
447448

@@ -1159,11 +1160,13 @@ No changes.
11591160
- 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.
11601161
[#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).
11611162
- **Migration to v6**
1163+
11621164
- Do not run the generator again if you've already run it.
11631165

11641166
- 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.
11651167

11661168
- To configure the asset compilation you can either
1169+
11671170
1. Specify a `config/react_on_rails` setting for `build_production_command` to be nil to turn this feature off.
11681171
2. Specify the script command you want to run to build your production assets, and remove your `assets.rake` file.
11691172

CODING_AGENTS.md

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

261261
1. **Understand the Problem**
262+
262263
- Read the issue carefully
263264
- Reproduce the bug if possible
264265
- Identify root cause
265266

266267
2. **Create Minimal Test Case**
268+
267269
- Write failing test that demonstrates issue
268270
- Keep it focused and minimal
269271

270272
3. **Implement Fix**
273+
271274
- Make smallest change possible
272275
- Ensure fix doesn't break existing functionality
273276
- Follow existing code patterns

docs/additional-details/migrating-from-react-rails.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
In this guide, it is assumed that you have upgraded the `react-rails` project to use `shakapacker` version 7. To this end, check out [Shakapacker v7 upgrade guide](https://github.com/shakacode/shakapacker/tree/master/docs/v7_upgrade.md). Upgrading `react-rails` to version 3 can make the migration smoother but it is not required.
44

55
1. Update Deps
6+
67
1. Replace `react-rails` in `Gemfile` with the latest version of `react_on_rails` and run `bundle install`.
78
2. Remove `react_ujs` from `package.json` and run `yarn install`.
89
3. Commit changes!
910

1011
2. Run `rails g react_on_rails:install` but do not commit the change. `react_on_rails` installs node dependencies and also creates sample React component, Rails view/controller, and updates `config/routes.rb`.
1112

1213
3. Adapt the project: Check the changes and carefully accept, reject, or modify them as per your project's needs. Besides changes in `config/shakapacker` or `babel.config` which are project-specific, here are the most noticeable changes to address:
14+
1315
1. Check Webpack config files at `config/webpack/*`. If coming from `react-rails` v3, the changes are minor since you have already made separate configurations for client and server bundles. The most important change here is to notice the different names for the server bundle entry file. You may choose to stick with `server_rendering.js` or use `server-bundle.js` which is the default name in `react_on_rails`. The decision made here affects the other steps.
1416

1517
2. In `app/javascript` directory you may notice some changes.
18+
1619
1. `react_on_rails` by default uses `bundles` directory for the React components. You may choose to rename `components` into `bundles` to follow the convention.
1720

1821
2. `react_on_rails` uses `client-bundle.js` and `server-bundle.js` instead of `application.js` and `server_rendering.js`. There is nothing special about these names. It can be set to use any other name (as mentioned above). If you too choose to follow the new names, consider updating the relevant `javascript_pack_tag` in your Rails views.

docs/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ You may need to check [the instructions for installing into an existing Rails ap
3838
```
3939

4040
3. Start the app:
41+
4142
- Run `./bin/dev` for HMR
4243
- Run `./bin/dev static` for statically created bundles (no HMR)
4344

docs/guides/streaming-server-rendering.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ You can test your application by running `rails server` and navigating to the ap
119119
When a user visits the page, they'll experience the following sequence:
120120

121121
1. The initial HTML shell is sent immediately, including:
122+
122123
- The page layout
123124
- Any static content (like the `<h1>` and footer)
124125
- Placeholder content for the React component (typically a loading state)
@@ -164,11 +165,13 @@ Streaming SSR is particularly valuable in specific scenarios. Here's when to con
164165
### Ideal Use Cases
165166

166167
1. **Data-Heavy Pages**
168+
167169
- Pages that fetch data from multiple sources
168170
- Dashboard-style layouts where different sections can load independently
169171
- Content that requires heavy processing or computation
170172

171173
2. **Progressive Enhancement**
174+
172175
- When you want users to see and interact with parts of the page while others load
173176
- For improving perceived performance on slower connections
174177
- When different parts of your page have different priority levels

docs/guides/upgrading-react-on-rails.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ const { output } = webpackConfigLoader(configPath);
238238
For an example of upgrading, see [react-webpack-rails-tutorial/pull/416](https://github.com/shakacode/react-webpack-rails-tutorial/pull/416).
239239

240240
- Breaking Configuration Changes
241+
241242
1. Added `config.node_modules_location` which defaults to `""` if Webpacker is installed. You may want to set this to `'client'` in `config/initializers/react_on_rails.rb` to keep your `node_modules` inside the `/client` directory.
242243
2. Renamed
243244
- config.npm_build_test_command ==> config.build_test_command
@@ -251,6 +252,7 @@ gem "webpacker"
251252

252253
- Update for the renaming in the `WebpackConfigLoader` in your Webpack configuration.
253254
You will need to rename the following object properties:
255+
254256
- webpackOutputPath ==> output.path
255257
- webpackPublicOutputDir ==> output.publicPath
256258
- hotReloadingUrl ==> output.publicPathWithHost
@@ -262,6 +264,7 @@ gem "webpacker"
262264
- devBuild ==> Use `const devBuild = process.env.NODE_ENV !== 'production';`
263265

264266
- Edit your Webpack.config files:
267+
265268
- Change your Webpack output to be like this. **Be sure to have the hash or chunkhash in the filename,** unless the bundle is server side.:
266269

267270
```
@@ -291,6 +294,7 @@ gem "webpacker"
291294
```
292295
293296
- Find your `webpacker_lite.yml` and rename it to `webpacker.yml`
297+
294298
- Consider copying a default webpacker.yml setup such as https://github.com/shakacode/react-on-rails-v9-rc-generator/blob/master/config/webpacker.yml
295299
- If you are not using the webpacker Webpack setup, be sure to put in `compile: false` in the `default` section.
296300
- Alternately, if you are updating from webpacker_lite, you can manually change these:

docs/release-notes/15.0.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ _The image above demonstrates the dramatic performance improvement:_
5757
- The `generated_component_packs_loading_strategy` defaults to `:async` for Shakapacker ≥ 8.2.0 and `:sync` for Shakapacker < 8.2.0.
5858
- The `force_load` configuration now defaults to `true`.
5959
- The new default values of `generated_component_packs_loading_strategy: :async` and `force_load: true` work together to optimize component hydration. Components now hydrate as soon as their code and server-rendered HTML are available, without waiting for the full page to load. This parallel processing significantly improves time-to-interactive by eliminating the traditional waterfall of waiting for page load before beginning hydration (It's critical for streamed HTML).
60+
6061
- The previous need for deferring scripts to prevent race conditions has been eliminated due to improved hydration handling. Making scripts not defer is critical to execute the hydration scripts early before the page is fully loaded.
6162
- The `force_load` configuration makes `react-on-rails` hydrate components immediately as soon as their server-rendered HTML reaches the client, without waiting for the full page load.
6263
- If you want to keep the previous behavior, you can set `generated_component_packs_loading_strategy: :defer` or `force_load: false` in your `config/initializers/react_on_rails.rb` file.
@@ -65,6 +66,7 @@ _The image above demonstrates the dramatic performance improvement:_
6566
- You can override this behavior for individual Redux stores by calling the `redux_store` helper with `force_load: false`, same as `react_component`.
6667

6768
- `ReactOnRails.reactOnRailsPageLoaded()` is now an async function:
69+
6870
- If you manually call this function to ensure components are hydrated (e.g., with async script loading), you must now await the promise it returns:
6971

7072
```js

spec/dummy/spec/fixtures/automated_packs_generation/components/ComponentWithCSSModule/ror_components/ComponentWithCSSModule.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ const ComponentWithCSSModule = () => {
99
);
1010
};
1111

12-
export default ComponentWithCSSModule;
12+
export default ComponentWithCSSModule;

spec/dummy/spec/fixtures/automated_packs_generation/components/ComponentWithCSSModule/ror_components/ComponentWithCSSModule.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
.title {
77
font-size: 2rem;
88
font-weight: bold;
9-
}
9+
}

0 commit comments

Comments
 (0)