-
-
Notifications
You must be signed in to change notification settings - Fork 638
π React on Rails v15 Generator Overhaul & Developer Experience Enhancement for v16 #1770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 157 commits
e9d84e6
283c1a3
6fa7185
d8b725a
e0a5efc
e47ed9d
a6dba4a
827aade
bbb9d7e
56bf816
999cbdc
061c383
b83ce88
966a14b
9c21731
814ad1b
4b39590
32d8ead
e9b808e
3c3d3d5
c1bd223
19d4d43
047583a
7df07c2
933f988
b4dec75
0ed2e37
763638d
f27559b
3b7054f
0ccd1dc
5ba84c4
8944925
15ae5ff
2518d05
00db160
2e4205b
5c45269
57e0918
d88904b
26a7ddd
26cc1cf
1bafcc8
8562962
81c57eb
3ff5b8b
7ff75b9
b57cbb8
cc117ad
b8b8b6b
81150b0
e8bf5ed
d738877
fdfa18b
6b4668e
ac1bd43
dd892bf
ada8f37
0c5552b
575f98a
2eb42f7
cc61a09
de14a6b
cbb1698
6f95bd6
2ed3b21
87f6a39
f4785ec
9e3d736
60d39a6
9d1ee53
6d2d01e
4fe3b11
943b74d
88f88e0
bcd05e4
a07a626
1d39ee5
bd37d16
9302d01
89946d6
fa9ee38
98a136b
608e13a
bcc4907
3451c4b
55ba46b
6c5b1eb
9fa7a3d
0d53442
80cc5fe
72a9017
6deaa58
1f4151d
76d75db
666fcff
ddd3c6a
a50ea3d
06b7a5a
57fd464
c297c3c
cc38e5d
b2bf2b5
29e4637
de09508
91c0ebb
31199d3
9f6f6fd
cfc9f5b
44749ad
a7a377b
604673a
c9c5a42
62e9e56
24af064
9de81a7
e1b0e79
0488119
b99e74d
ab12753
580d65a
8b12230
35db1cb
6436c4e
dbe1f64
364fbfd
612e2b0
c8e3086
095f3ae
1258eae
2fbbaa4
4cbbc26
a2c19eb
b1427a1
702d54a
05ff132
9cc0847
8f4e895
e53e50c
33d74e5
e9487ba
7f7d497
c261b81
dadd3df
9329d30
eaaf0eb
75c3361
bd4210b
171b9e8
3750762
bc69dcd
3974fc2
6e8d443
f36e40d
a9a7732
ed3bda3
37917e5
a05c43f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,20 @@ jobs: | |
| build-dummy-app-webpack-test-bundles: | ||
| strategy: | ||
| matrix: | ||
| versions: ['oldest', 'newest'] | ||
| ruby-version: ['3.2', '3.4'] | ||
| node-version: ['20', '22'] | ||
| include: | ||
| - ruby-version: '3.2' | ||
| node-version: '20' | ||
| dependency-level: 'minimum' | ||
| - ruby-version: '3.4' | ||
| node-version: '22' | ||
| dependency-level: 'latest' | ||
| exclude: | ||
| - ruby-version: '3.2' | ||
| node-version: '22' | ||
| - ruby-version: '3.4' | ||
| node-version: '20' | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
@@ -19,7 +32,7 @@ jobs: | |
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }} | ||
| ruby-version: ${{ matrix.ruby-version }} | ||
| bundler: 2.5.9 | ||
| # libyaml-dev is needed for psych v5 | ||
| # this gem depends on sdoc which depends on rdoc which depends on psych | ||
|
|
@@ -28,7 +41,7 @@ jobs: | |
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }} | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: yarn | ||
| cache-dependency-path: '**/yarn.lock' | ||
| - name: Print system information | ||
|
|
@@ -41,23 +54,23 @@ jobs: | |
| echo "Yarn version: "; yarn --version | ||
| echo "Bundler version: "; bundle --version | ||
| - name: run conversion script to support shakapacker v6 | ||
| if: matrix.versions == 'oldest' | ||
| if: matrix.dependency-level == 'minimum' | ||
| run: script/convert | ||
| - name: Install Node modules with Yarn for renderer package | ||
| run: | | ||
| yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} | ||
| yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} | ||
| sudo yarn global add yalc | ||
| - name: yalc publish for react-on-rails | ||
| run: yalc publish | ||
| - name: yalc add react-on-rails | ||
| run: cd spec/dummy && yalc add react-on-rails | ||
| - name: Install Node modules with Yarn for dummy app | ||
| run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} | ||
| run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} | ||
| - name: Save dummy app ruby gems to cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: spec/dummy/vendor/bundle | ||
| key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-${{ matrix.versions }} | ||
| key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| - name: Install Ruby Gems for dummy app | ||
| run: | | ||
| cd spec/dummy | ||
|
|
@@ -68,21 +81,34 @@ jobs: | |
| - name: generate file system-based packs | ||
| run: cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs | ||
| - name: Build test bundles for dummy app | ||
| run: cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/${{ matrix.versions == 'oldest' && 'web' || 'shaka' }}packer | ||
| run: cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/shakapacker | ||
| - id: get-sha | ||
| run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" | ||
| - name: Save test Webpack bundles to cache (for build number checksum used by RSpec job) | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: spec/dummy/public/webpack | ||
| key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }} | ||
| key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
|
|
||
| dummy-app-integration-tests: | ||
| needs: build-dummy-app-webpack-test-bundles | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| versions: ['oldest', 'newest'] | ||
| ruby-version: ['3.2', '3.4'] | ||
| node-version: ['20', '22'] | ||
| include: | ||
| - ruby-version: '3.2' | ||
| node-version: '20' | ||
| dependency-level: 'minimum' | ||
| - ruby-version: '3.4' | ||
| node-version: '22' | ||
| dependency-level: 'latest' | ||
| exclude: | ||
| - ruby-version: '3.2' | ||
| node-version: '22' | ||
| - ruby-version: '3.4' | ||
| node-version: '20' | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
@@ -91,12 +117,12 @@ jobs: | |
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }} | ||
| ruby-version: ${{ matrix.ruby-version }} | ||
| bundler: 2.5.9 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }} | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: yarn | ||
| cache-dependency-path: '**/yarn.lock' | ||
| - name: Print system information | ||
|
|
@@ -109,35 +135,35 @@ jobs: | |
| echo "Yarn version: "; yarn --version | ||
| echo "Bundler version: "; bundle --version | ||
| - name: run conversion script to support shakapacker v6 | ||
| if: matrix.versions == 'oldest' | ||
| if: matrix.dependency-level == 'minimum' | ||
| run: script/convert | ||
| - name: Save root ruby gems to cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: vendor/bundle | ||
| key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }} | ||
| key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| - name: Save dummy app ruby gems to cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: spec/dummy/vendor/bundle | ||
| key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-${{ matrix.versions }} | ||
| key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| - id: get-sha | ||
| run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" | ||
| - name: Save test Webpack bundles to cache (for build number checksum used by RSpec job) | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: spec/dummy/public/webpack | ||
| key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }} | ||
| key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| - name: Install Node modules with Yarn | ||
| run: | | ||
| yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} | ||
| yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} | ||
| sudo yarn global add yalc | ||
| - name: yalc publish for react-on-rails | ||
|
Comment on lines
158
to
161
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Integration job: update JS steps to npm as well. Mirror the Yarnβnpm changes here for consistency. Proposed diffs: Root install: - yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
- sudo yarn global add yalc
+ npm ci --no-audit --no-fund
+ sudo npm i -g yalcDummy app install: - run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
+ run: cd spec/dummy && npm ci --no-audit --no-fundDummy JS tests: - yarn run test:js
+ npm run test:jsUpdate setup-node cache in this job similarly to npm and package-lock.json. Also applies to: 166-167, 170-170 π€ Prompt for AI Agents |
||
| run: yalc publish | ||
| - name: yalc add react-on-rails | ||
| run: cd spec/dummy && yalc add react-on-rails | ||
| - name: Install Node modules with Yarn for dummy app | ||
| run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} | ||
| run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} | ||
| - name: Dummy JS tests | ||
| run: | | ||
| cd spec/dummy | ||
|
|
@@ -172,34 +198,34 @@ jobs: | |
| - name: generate file system-based packs | ||
| run: cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs | ||
| - name: Git Stuff | ||
| if: matrix.versions == 'oldest' | ||
| if: matrix.dependency-level == 'minimum' | ||
| run: | | ||
| git config user.email "[email protected]" | ||
| git config user.name "Your Name" | ||
| git commit -am "stop generators from complaining about uncommitted code" | ||
| - run: cd spec/dummy && bundle info shakapacker | ||
| - name: Set packer version environment variable | ||
| run: | | ||
| echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV | ||
| echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV | ||
| - name: Main CI | ||
| run: bundle exec rake run_rspec:all_dummy | ||
| - name: Store test results | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: main-rspec-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }} | ||
| name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| path: ~/rspec | ||
| - name: Store artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }} | ||
| name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| path: spec/dummy/tmp/capybara | ||
| - name: Store artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }} | ||
| name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| path: spec/dummy/log/test.log | ||
| - name: Store artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }} | ||
| name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| path: spec/dummy/yarn-error.log | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,9 +11,10 @@ jobs: | |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| versions: ['oldest', 'newest'] | ||
| ruby-version: ['3.2', '3.4'] | ||
| dependency-level: ['minimum', 'latest'] | ||
| env: | ||
| BUNDLE_FROZEN: ${{ matrix.versions == 'oldest' && 'false' || 'true' }} | ||
| BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
@@ -22,7 +23,7 @@ jobs: | |
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }} | ||
| ruby-version: ${{ matrix.ruby-version }} | ||
| bundler: 2.5.9 | ||
| - name: Print system information | ||
| run: | | ||
|
|
@@ -33,34 +34,34 @@ jobs: | |
| echo "Node version: "; node -v | ||
| echo "Yarn version: "; yarn --version | ||
| echo "Bundler version: "; bundle --version | ||
| - name: run conversion script to support shakapacker v6 | ||
| if: matrix.versions == 'oldest' | ||
| - name: run conversion script to use minimum supported dependency versions | ||
| if: matrix.dependency-level == 'minimum' | ||
| run: script/convert | ||
| - name: Save root ruby gems to cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: vendor/bundle | ||
| key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }} | ||
| key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| - name: Install Ruby Gems for package | ||
| run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3 | ||
| - name: Git Stuff | ||
| if: matrix.versions == 'oldest' | ||
| if: matrix.dependency-level == 'minimum' | ||
| run: | | ||
| git config user.email "[email protected]" | ||
| git config user.name "Your Name" | ||
| git commit -am "stop generators from complaining about uncommitted code" | ||
| - name: Set packer version environment variable | ||
| - name: Set dependency level environment variable | ||
| run: | | ||
| echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV | ||
| echo "CI_DEPENDENCY_LEVEL=${{ matrix.dependency-level }}" >> $GITHUB_ENV | ||
| - name: Run rspec tests | ||
| run: bundle exec rspec spec/react_on_rails | ||
| - name: Store test results | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: main-rspec-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }} | ||
| name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| path: ~/rspec | ||
| - name: Store artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: main-test-log-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }} | ||
| name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} | ||
| path: log/test.log | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dummy app still uses Yarn; migrate these steps to npm to meet PR objective.
The PR description says: βSwitch generator and dummy app to use npm (remove Yarn requirement).β These steps keep a hard Yarn dependency.
Proposed diffs:
Renderer/package install step:
Dummy app install step:
Build step:
Also change setup-node cache to npm (see previous comment) and artifact naming that references Yarn logs (see below).
Also applies to: 68-68, 84-84
π€ Prompt for AI Agents