Skip to content

Commit 72b4250

Browse files
justin808claude
andcommitted
Migrate react_on_rails_pro to regular RubyGems and npm
React on Rails Pro is now available on regular package registries: - Ruby gem from rubygems.org (no longer GitHub Packages) - npm package from npmjs.org (no longer @shakacode-tools scope) Changes: - Update Gemfile to use regular gem source - Update react-on-rails-pro/package.json for regular npm - Remove .npmrc.example (no auth needed) - Simplify documentation to remove GitHub Packages auth setup - Update README with clearer setup instructions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b6178b8 commit 72b4250

7 files changed

Lines changed: 999 additions & 164 deletions

File tree

demos/basic-v16-rspack-tanstack/Gemfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ gem "react_on_rails", "16.2.0.rc1"
2929
# React on Rails Pro - Node Renderer for production-grade SSR (REQUIRED)
3030
# TanStack Router requires Node.js APIs (setTimeout, clearTimeout, etc.)
3131
# that are not available in the default ExecJS environment.
32-
#
33-
# Setup instructions: See docs/react-on-rails-pro-setup.md
34-
# Free license: Contact team@shakacode.com or justin@shakacode.com
35-
source "https://rubygems.pkg.github.com/shakacode-tools" do
36-
gem "react_on_rails_pro", "~> 4.0"
37-
end
32+
gem "react_on_rails_pro"
3833

3934
# Colored terminal output for build scripts
4035
gem "rainbow"

demos/basic-v16-rspack-tanstack/Gemfile.lock

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ GEM
7575
addressable (2.8.8)
7676
public_suffix (>= 2.0.2, < 8.0)
7777
ast (2.4.3)
78+
async (2.35.2)
79+
console (~> 1.29)
80+
fiber-annotation
81+
io-event (~> 1.11)
82+
metrics (~> 0.12)
83+
traces (~> 0.18)
7884
base64 (0.3.0)
7985
benchmark (0.5.0)
8086
bigdecimal (4.0.1)
@@ -86,6 +92,10 @@ GEM
8692
builder (3.3.0)
8793
concurrent-ruby (1.3.6)
8894
connection_pool (3.0.2)
95+
console (1.34.2)
96+
fiber-annotation
97+
fiber-local (~> 1.1)
98+
json
8999
crass (1.0.6)
90100
date (3.5.1)
91101
debug (1.11.1)
@@ -95,11 +105,19 @@ GEM
95105
erb (6.0.1)
96106
erubi (1.13.1)
97107
execjs (2.10.0)
108+
fiber-annotation (0.2.0)
109+
fiber-local (1.1.0)
110+
fiber-storage
111+
fiber-storage (1.0.1)
98112
globalid (1.3.0)
99113
activesupport (>= 6.1)
114+
http-2 (1.1.1)
115+
httpx (1.7.0)
116+
http-2 (>= 1.0.0)
100117
i18n (1.14.8)
101118
concurrent-ruby (~> 1.0)
102119
io-console (0.8.2)
120+
io-event (1.14.2)
103121
irb (1.16.0)
104122
pp (>= 0.6.0)
105123
rdoc (>= 4.0.0)
@@ -108,6 +126,8 @@ GEM
108126
actionview (>= 7.0.0)
109127
activesupport (>= 7.0.0)
110128
json (2.18.0)
129+
jwt (2.10.2)
130+
base64
111131
language_server-protocol (3.17.0.5)
112132
lint_roller (1.1.0)
113133
logger (1.7.0)
@@ -121,6 +141,7 @@ GEM
121141
net-pop
122142
net-smtp
123143
marcel (1.1.0)
144+
metrics (0.15.0)
124145
mini_mime (1.1.5)
125146
minitest (6.0.1)
126147
prism (~> 1.5)
@@ -231,6 +252,16 @@ GEM
231252
rails (>= 5.2)
232253
rainbow (~> 3.0)
233254
shakapacker (>= 6.0)
255+
react_on_rails_pro (16.2.0.rc.1)
256+
addressable
257+
async (>= 2.6)
258+
connection_pool
259+
execjs (~> 2.9)
260+
http-2 (>= 1.1.1)
261+
httpx (~> 1.5)
262+
jwt (~> 2.7)
263+
rainbow
264+
react_on_rails (= 16.2.0.rc.1)
234265
regexp_parser (2.11.3)
235266
reline (0.6.3)
236267
io-console (~> 0.5)
@@ -279,6 +310,7 @@ GEM
279310
thruster (0.1.17-x86_64-darwin)
280311
thruster (0.1.17-x86_64-linux)
281312
timeout (0.6.0)
313+
traces (0.18.2)
282314
tsort (0.2.0)
283315
tzinfo (2.0.6)
284316
concurrent-ruby (~> 1.0)
@@ -321,6 +353,7 @@ DEPENDENCIES
321353
rails (~> 8.0.3)
322354
rainbow
323355
react_on_rails (= 16.2.0.rc1)
356+
react_on_rails_pro
324357
rubocop-rails-omakase
325358
shakapacker (~> 9.3.0)
326359
thruster

demos/basic-v16-rspack-tanstack/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ Created: 2025-01-13
2828
## Setup
2929

3030
```bash
31-
# Install dependencies
31+
# Install Ruby dependencies
3232
bundle install
33+
34+
# Install JavaScript dependencies
3335
npm install
3436

37+
# Install Node Renderer for SSR
38+
cd react-on-rails-pro && npm install && cd ..
39+
3540
# Setup database
3641
bin/rails db:create
3742
bin/rails db:migrate

demos/basic-v16-rspack-tanstack/docs/react-on-rails-pro-setup.md

Lines changed: 15 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -19,166 +19,44 @@ This causes issues with modern React libraries like **TanStack Router** that rel
1919
- Hot reload of bundles without server restart
2020
- Support for async operations during SSR
2121

22-
## Getting a Free License
22+
## Installation
2323

24-
React on Rails Pro is a commercial product, but **free licenses are available for open-source projects and evaluation**.
24+
React on Rails Pro is available on RubyGems and npm.
2525

26-
### To request a free license:
27-
28-
1. **Email**: Contact [team@shakacode.com](mailto:team@shakacode.com) or [justin@shakacode.com](mailto:justin@shakacode.com)
29-
2. **Subject**: "React on Rails Pro License Request"
30-
3. **Include**: Your GitHub username and project name
31-
32-
You'll receive:
33-
34-
- Access to the private GitHub Package registry
35-
- Instructions for creating a Personal Access Token
36-
37-
### Creating a GitHub Personal Access Token
38-
39-
Once you have access:
40-
41-
1. Go to [GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)](https://github.com/settings/tokens)
42-
2. Click "Generate new token (classic)"
43-
3. Name it something like "React on Rails Pro"
44-
4. Select the **`read:packages`** scope
45-
5. Click "Generate token"
46-
6. **Copy the token immediately** (you won't see it again)
47-
48-
## Local Development Setup
49-
50-
### Step 1: Configure Environment Variables
51-
52-
Create a `.env` file in the demo root (this file is gitignored):
53-
54-
```bash
55-
# .env (DO NOT COMMIT THIS FILE)
56-
REACT_ON_RAILS_PRO_TOKEN=ghp_your_github_token_here
57-
```
58-
59-
### Step 2: Configure Bundler for GitHub Packages
60-
61-
```bash
62-
bundle config set --local rubygems.pkg.github.com YOUR_GITHUB_USERNAME:ghp_your_token_here
63-
```
64-
65-
Or use environment variable (recommended):
66-
67-
```bash
68-
bundle config set --local rubygems.pkg.github.com ${GITHUB_ACTOR}:${REACT_ON_RAILS_PRO_TOKEN}
69-
```
70-
71-
### Step 3: Install the Ruby Gem
26+
### Step 1: Install the Ruby Gem
7227

7328
```bash
7429
bundle install
7530
```
7631

77-
### Step 4: Configure npm for Node Renderer
78-
79-
```bash
80-
cd react-on-rails-pro
81-
82-
# Copy the example .npmrc
83-
cp .npmrc.example .npmrc
32+
The Gemfile already includes `gem "react_on_rails_pro"`.
8433

85-
# Edit .npmrc and replace YOUR_GITHUB_TOKEN with your actual token
86-
```
87-
88-
Your `.npmrc` should look like:
89-
90-
```
91-
always-auth=true
92-
//npm.pkg.github.com/:_authToken=ghp_your_token_here
93-
@shakacode-tools:registry=https://npm.pkg.github.com
94-
```
95-
96-
### Step 5: Install Node Renderer
34+
### Step 2: Install Node Renderer
9735

9836
```bash
9937
cd react-on-rails-pro
10038
npm install
10139
```
10240

103-
### Step 6: Start Development Server
41+
### Step 3: Start Development Server
10442

10543
```bash
10644
bin/dev
10745
```
10846

10947
This starts all processes including the Node Renderer on port 3800.
11048

111-
## CI/CD Setup (GitHub Actions)
112-
113-
For public repositories, use GitHub Secrets to store your token securely.
114-
115-
### Step 1: Add Repository Secrets
116-
117-
Go to your repository's **Settings > Secrets and variables > Actions** and add:
118-
119-
| Secret Name | Value |
120-
| -------------------------- | ------------------------------------------ |
121-
| `REACT_ON_RAILS_PRO_TOKEN` | Your GitHub PAT with `read:packages` scope |
122-
123-
### Step 2: Configure GitHub Actions Workflow
124-
125-
```yaml
126-
# .github/workflows/ci.yml
127-
name: CI
128-
129-
on: [push, pull_request]
130-
131-
jobs:
132-
test:
133-
runs-on: ubuntu-latest
134-
135-
env:
136-
REACT_ON_RAILS_PRO_TOKEN: ${{ secrets.REACT_ON_RAILS_PRO_TOKEN }}
137-
138-
steps:
139-
- uses: actions/checkout@v4
140-
141-
- name: Set up Ruby
142-
uses: ruby/setup-ruby@v1
143-
with:
144-
bundler-cache: true
145-
146-
- name: Configure Bundler for GitHub Packages
147-
run: |
148-
bundle config set --local rubygems.pkg.github.com ${{ github.actor }}:${{ secrets.REACT_ON_RAILS_PRO_TOKEN }}
149-
150-
- name: Install dependencies
151-
run: bundle install
152-
153-
- name: Set up Node Renderer
154-
run: |
155-
cd react-on-rails-pro
156-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.REACT_ON_RAILS_PRO_TOKEN }}" > .npmrc
157-
echo "@shakacode-tools:registry=https://npm.pkg.github.com" >> .npmrc
158-
npm install
159-
160-
- name: Start Node Renderer
161-
run: |
162-
cd react-on-rails-pro
163-
npm run node-renderer &
164-
sleep 5 # Wait for renderer to start
165-
166-
- name: Run tests
167-
run: bin/rails test
168-
```
169-
17049
## Configuration Reference
17150

17251
### Environment Variables
17352

174-
| Variable | Default | Description |
175-
| --------------------------- | ------------------------ | ----------------------------- |
176-
| `REACT_ON_RAILS_PRO_TOKEN` | - | GitHub PAT for package access |
177-
| `RENDERER_URL` | `http://localhost:3800` | Node Renderer URL |
178-
| `RENDERER_PASSWORD` | `tanstack-demo-renderer` | Renderer authentication |
179-
| `RENDERER_PORT` | `3800` | Node Renderer port |
180-
| `RENDERER_LOG_LEVEL` | `debug` | Logging verbosity |
181-
| `NODE_RENDERER_CONCURRENCY` | `3` | Number of worker threads |
53+
| Variable | Default | Description |
54+
| --------------------------- | ------------------------ | ------------------------ |
55+
| `RENDERER_URL` | `http://localhost:3800` | Node Renderer URL |
56+
| `RENDERER_PASSWORD` | `tanstack-demo-renderer` | Renderer authentication |
57+
| `RENDERER_PORT` | `3800` | Node Renderer port |
58+
| `RENDERER_LOG_LEVEL` | `debug` | Logging verbosity |
59+
| `NODE_RENDERER_CONCURRENCY` | `3` | Number of worker threads |
18260

18361
### Rails Configuration
18462

@@ -194,17 +72,12 @@ end
19472

19573
## Troubleshooting
19674

197-
### "Package not found" errors
198-
199-
Ensure your token has the `read:packages` scope and you have access to the shakacode-tools organization.
200-
20175
### Node Renderer won't start
20276

20377
Check that:
20478

205-
1. `.npmrc` has the correct token
206-
2. `npm install` completed successfully in `react-on-rails-pro/`
207-
3. Port 3800 is not already in use
79+
1. `npm install` completed successfully in `react-on-rails-pro/`
80+
2. Port 3800 is not already in use
20881

20982
### SSR returns errors
21083

@@ -217,4 +90,3 @@ Check the Node Renderer logs. Common issues:
21790

21891
- [React on Rails Pro Documentation](https://www.shakacode.com/react-on-rails-pro/)
21992
- [ShakaCode Support](mailto:team@shakacode.com)
220-
- [GitHub Issue: SSR Timer Limitations](https://github.com/shakacode/react_on_rails/issues/2299)

demos/basic-v16-rspack-tanstack/react-on-rails-pro/.npmrc.example

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)