Skip to content

Commit e4bb834

Browse files
committed
Update the optimization opportunity warning
1 parent 86fe5bd commit e4bb834

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Changes since the last non-beta release.
3636
### Changed
3737

3838
- The global context is now accessed using `globalThis`. [PR 1727](https://github.com/shakacode/react_on_rails/pull/1727) by [alexeyr-ci2](https://github.com/alexeyr-ci2).
39+
- The "optimization opportunity" message when importing the server-side `react-on-rails` instead of `react-on-rails/client` in browsers is now a warning for two reasons:
40+
- Make it more prominent
41+
- Include a stack trace when clicked
42+
- [PR 1706](https://github.com/shakacode/react_on_rails/pull/1706) by [alexeyr-ci](https://github.com/alexeyr-ci).
3943

4044
### [15.0.0-alpha.2] - 2025-03-07
4145

node_package/src/ReactOnRails.full.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import type { RenderParams, RenderResult, ErrorOptions } from './types';
55
import Client from './ReactOnRails.client';
66

77
if (typeof window !== 'undefined') {
8-
console.log(
9-
'Optimization opportunity: "react-on-rails" includes ~14KB of server-rendering code. Browsers may not need it. See https://forum.shakacode.com/t/how-to-use-different-versions-of-a-file-for-client-and-server-rendering/1352 (Requires creating a free account)',
8+
// warn to include a collapsed stack trace
9+
console.warn(
10+
'Optimization opportunity: "react-on-rails" includes ~14KB of server-rendering code. Browsers may not need it. See https://forum.shakacode.com/t/how-to-use-different-versions-of-a-file-for-client-and-server-rendering/1352 (Requires creating a free account). Click this for the stack trace.',
1011
);
1112
}
1213

0 commit comments

Comments
 (0)