Skip to content

Commit 7bce94a

Browse files
PR #4: Split JS Pro Code to Separate Package (#1841)
- Refactored code to move JS Pro-related logic into its own package for better modularity and maintainability. - Updated dependencies and documentation to reflect the new package structure. - Ensured backward compatibility and provided migration instructions where necessary.
1 parent c3ad7a9 commit 7bce94a

File tree

99 files changed

+2533
-650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2533
-650
lines changed

.github/workflows/lint-js-and-ruby.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ jobs:
8484
run: cd packages/react-on-rails && yarn pack -f react-on-rails.tgz
8585
- name: Lint package types
8686
# our package is ESM-only
87-
run: yarn run attw packages/react-on-rails/react-on-rails.tgz --profile esm-only
87+
# Exclude internal exports used for react-on-rails-pro communication
88+
run: yarn run attw packages/react-on-rails/react-on-rails.tgz --profile esm-only --exclude-entrypoints reactApis ReactDOMServer
8889
- name: Lint package publishing
8990
run: yarn run publint --strict packages/react-on-rails/react-on-rails.tgz
9091
# We only download and run Actionlint if there is any difference in GitHub Action workflows

.github/workflows/package-js-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@ jobs:
3636
run: |
3737
yarn install --no-progress --no-emoji ${{ matrix.node-version == '22' && '--frozen-lockfile' || '' }}
3838
sudo yarn global add yalc
39+
- name: Build Renderer package
40+
run: yarn build
3941
- name: Run JS unit tests for Renderer package
4042
run: yarn test

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ node_modules
2222

2323
/packages/*/lib
2424

25+
# TypeScript build artifacts in src (shouldn't be there, but just in case)
26+
/packages/*/src/**/*.js
27+
/packages/*/src/**/*.d.ts
28+
/packages/*/src/**/*.d.cts
29+
/packages/*/src/**/*.cjs
30+
/packages/*/src/**/*.map
31+
!/packages/*/src/**/*.test.js
32+
!/packages/*/src/**/*.spec.js
33+
2534
yarn-debug.*
2635
yarn-error.*
2736
npm-debug.*

CHANGELOG.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,52 @@ After a release, please make sure to run `bundle exec rake update_changelog`. Th
2323

2424
Changes since the last non-beta release.
2525

26+
#### Breaking Changes
27+
28+
- **React on Rails Core Package**: Several Pro-only methods have been removed from the core package and are now exclusively available in the `react-on-rails-pro` package. If you're using any of the following methods, you'll need to migrate to React on Rails Pro:
29+
- `getOrWaitForComponent()`
30+
- `getOrWaitForStore()`
31+
- `getOrWaitForStoreGenerator()`
32+
- `reactOnRailsStoreLoaded()`
33+
- `streamServerRenderedReactComponent()`
34+
- `serverRenderRSCReactComponent()`
35+
36+
**Migration Guide:**
37+
38+
To migrate to React on Rails Pro:
39+
40+
1. Install the Pro package:
41+
42+
```bash
43+
yarn add react-on-rails-pro
44+
# or
45+
npm install react-on-rails-pro
46+
```
47+
48+
2. Update your imports from `react-on-rails` to `react-on-rails-pro`:
49+
50+
```javascript
51+
// Before
52+
import ReactOnRails from 'react-on-rails';
53+
54+
// After
55+
import ReactOnRails from 'react-on-rails-pro';
56+
```
57+
58+
3. For server-side rendering, update your import paths:
59+
60+
```javascript
61+
// Before
62+
import ReactOnRails from 'react-on-rails';
63+
64+
// After
65+
import ReactOnRails from 'react-on-rails-pro';
66+
```
67+
68+
4. If you're using a free license for personal (non-production) use, you can obtain one at [React on Rails Pro License](https://www.shakacode.com/react-on-rails-pro). The Pro package is free for personal, educational, and non-production usage.
69+
70+
**Note:** If you're not using any of the Pro-only methods listed above, no changes are required.
71+
2672
### [16.1.1] - 2025-09-24
2773

2874
#### Bug Fixes
@@ -71,7 +117,7 @@ Changes since the last non-beta release.
71117

72118
#### Pro License Features
73119

74-
- **Core/Pro separation**: Moved Pro features into dedicated `lib/react_on_rails/pro/` and `node_package/src/pro/` directories with clear licensing boundaries (now located at `packages/react-on-rails/src/pro/`) [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
120+
- **Core/Pro separation**: Moved Pro features into dedicated `lib/react_on_rails/pro/` and `node_package/src/pro/` directories with clear licensing boundaries (now separated into `packages/react-on-rails-pro/` package) [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
75121
- **Runtime license validation**: Implemented Pro license gating with graceful fallback to core functionality when Pro license unavailable [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
76122
- **Enhanced immediate hydration**: Improved immediate hydration functionality with Pro license validation and warning badges [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)
77123
- **License documentation**: Added NOTICE files in Pro directories referencing canonical `REACT-ON-RAILS-PRO-LICENSE.md` [PR 1791](https://github.com/shakacode/react_on_rails/pull/1791) by [AbanoubGhadban](https://github.com/AbanoubGhadban)

LICENSE.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ This repository contains code under two different licenses:
1212
The following directories and all their contents are licensed under the **MIT License** (see full text below):
1313

1414
- `lib/react_on_rails/` (excluding `lib/react_on_rails/pro/`)
15-
- `packages/react-on-rails/` (excluding `packages/react-on-rails/src/pro/`)
16-
- `packages/react-on-rails/lib/` (excluding `packages/react-on-rails/lib/pro/`)
15+
- `packages/react-on-rails/` (entire package)
1716
- All other directories in this repository not explicitly listed as Pro-licensed
1817

1918
### Pro Licensed Code
2019

2120
The following directories and all their contents are licensed under the **React on Rails Pro License**:
2221

2322
- `lib/react_on_rails/pro/`
24-
- `packages/react-on-rails/src/pro/`
25-
- `packages/react-on-rails/lib/pro/`
23+
- `packages/react-on-rails-pro/` (entire package)
2624
- `react_on_rails_pro/` (entire directory)
2725

2826
See [REACT-ON-RAILS-PRO-LICENSE.md](./REACT-ON-RAILS-PRO-LICENSE.md) for complete Pro license terms.

0 commit comments

Comments
 (0)