Skip to content

Commit d966521

Browse files
committed
Merge branch 'feat/issue-40-esbuild-remaining-test-apps' into 'edge'
Migrate the remaining test_apps to esbuild React 19 (hyperstack-org#40) Closes hyperstack-org#40 See merge request ru/hyperstack!103
2 parents 1d82a0f + 53afe12 commit d966521

18 files changed

Lines changed: 627 additions & 181 deletions

File tree

‎.gitignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@
1616
/ruby/**/spec/test_app/db/schema.rb
1717
# yarn download cache, kept in-project so GitLab CI can cache it (#55)
1818
/.yarn-cache/
19+
# esbuild scaffolding written into a gem's spec/test_app at `rake spec:prepare`
20+
# when the cell selects HYPERSTACK_REACT_SOURCE=npm (#40). The single tracked
21+
# copy lives in ruby/test_app_esbuild; these are placed copies, not sources.
22+
/ruby/**/spec/test_app/app/javascript/
23+
/ruby/**/spec/test_app/esbuild.config.js
24+
# npm-path backup of the files the esbuild wiring rewrites in place (#40); the
25+
# gem path restores from it, so the React source stays a per-run choice locally.
26+
/ruby/**/spec/test_app/.react_source_backup/

‎.gitlab-ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ stages:
214214
# `rake hyperstack:matrix:check` fails if this list and the table disagree. (#51)
215215
parallel:
216216
matrix:
217-
- HYPERSTACK_CELL: [rails61-react16, rails61-react17, rails61-react18, rails72-react16]
217+
- HYPERSTACK_CELL: [rails61-react16, rails61-react17, rails61-react18, rails61-react19, rails72-react16]
218218

219219
before_script:
220220
# - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
@@ -313,7 +313,7 @@ stages:
313313
# `rake hyperstack:matrix:check` fails if this list and the table disagree. (#51)
314314
parallel:
315315
matrix:
316-
- HYPERSTACK_CELL: [rails61-react16, rails61-react17, rails61-react18, rails72-react16]
316+
- HYPERSTACK_CELL: [rails61-react16, rails61-react17, rails61-react18, rails61-react19, rails72-react16]
317317

318318
# language: ruby
319319
# cache:
@@ -552,7 +552,7 @@ build-cell-image:
552552
CELL_IMAGE_PREFIX: $CI_REGISTRY_IMAGE/cell
553553
parallel:
554554
matrix:
555-
- HYPERSTACK_CELL: [rails61-react16, rails61-react17, rails61-react18, rails72-react16]
555+
- HYPERSTACK_CELL: [rails61-react16, rails61-react17, rails61-react18, rails61-react19, rails72-react16]
556556
before_script:
557557
- apk add --no-cache bash git ruby ruby-rake
558558
- docker info # fail fast and legibly if the socket is not mounted

‎ruby/hyper-component/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,18 @@ require "rspec/core/rake_task"
3434

3535
RSpec::Core::RakeTask.new(:spec)
3636

37+
require_relative '../test_app_react_source'
38+
3739
namespace :spec do
3840
task :prepare do
41+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
42+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
43+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
44+
# assets:precompile below link_trees app/assets/builds, which does not exist
45+
# until esbuild has written it.
46+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
47+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
48+
end
3949
end
4050
end
4151

‎ruby/hyper-i18n/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ require "rspec/core/rake_task"
33

44
RSpec::Core::RakeTask.new(:spec)
55

6+
require_relative '../test_app_react_source'
7+
68
namespace :spec do
79
task :prepare do
10+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
11+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
12+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
13+
# assets:precompile below link_trees app/assets/builds, which does not exist
14+
# until esbuild has written it.
15+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
16+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
17+
end
818
end
919
end
1020

‎ruby/hyper-model/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,18 @@ task :spec do
3636
end
3737
end
3838

39+
require_relative '../test_app_react_source'
40+
3941
namespace :spec do
4042
task :prepare do
43+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
44+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
45+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
46+
# assets:precompile below link_trees app/assets/builds, which does not exist
47+
# until esbuild has written it.
48+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
49+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
50+
end
4151
sh %(cd spec/test_app; rm db/schema.rb; RAILS_ENV=test bundle exec rails db:setup; RAILS_ENV=test bundle exec rails db:migrate)
4252
# When PRECOMPILED_ASSETS is set (CI browser jobs), build the static Opal
4353
# bundle once here so the specs run with compile=false (no debug-mode runtime

‎ruby/hyper-operation/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,18 @@ task :part2 do
2727
Rake::Task[parallel_specs? ? 'spec:parallel' : 'part2_serial'].invoke
2828
end
2929

30+
require_relative '../test_app_react_source'
31+
3032
namespace :spec do
3133
task :prepare do
34+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
35+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
36+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
37+
# assets:precompile below link_trees app/assets/builds, which does not exist
38+
# until esbuild has written it.
39+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
40+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
41+
end
3242
sh %(cd spec/test_app; bundle exec rails db:setup)
3343
# When PRECOMPILED_ASSETS is set (CI browser jobs), build the static Opal
3444
# bundle once here so the specs run with compile=false (no debug-mode runtime

‎ruby/hyper-router/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ require "rspec/core/rake_task"
33

44
RSpec::Core::RakeTask.new(:spec)
55

6+
require_relative '../test_app_react_source'
7+
68
namespace :spec do
79
task :prepare do
10+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
11+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
12+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
13+
# assets:precompile below link_trees app/assets/builds, which does not exist
14+
# until esbuild has written it.
15+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
16+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
17+
end
818
end
919
end
1020

‎ruby/hyper-spec/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ require "rspec/core/rake_task"
33

44
RSpec::Core::RakeTask.new(:spec)
55

6+
require_relative '../test_app_react_source'
7+
68
namespace :spec do
79
task :prepare do
10+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
11+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
12+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
13+
# assets:precompile below link_trees app/assets/builds, which does not exist
14+
# until esbuild has written it.
15+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
16+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
17+
end
818
end
919
end
1020

‎ruby/hyper-state/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ require "rspec/core/rake_task"
33

44
RSpec::Core::RakeTask.new(:spec)
55

6+
require_relative '../test_app_react_source'
7+
68
namespace :spec do
79
task :prepare do
10+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
11+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
12+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
13+
# assets:precompile below link_trees app/assets/builds, which does not exist
14+
# until esbuild has written it.
15+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
16+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
17+
end
818
end
919
end
1020

‎ruby/hyper-store/Rakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ require "rspec/core/rake_task"
33

44
RSpec::Core::RakeTask.new(:spec)
55

6+
require_relative '../test_app_react_source'
7+
68
namespace :spec do
79
task :prepare do
10+
# #40: wire this test_app to npm/esbuild React when the cell asks for it
11+
# (HYPERSTACK_REACT_SOURCE=npm). A no-op on the default react-rails/sprockets
12+
# path, so the rails61-react16/17/18 cells are untouched. Runs FIRST: the
13+
# assets:precompile below link_trees app/assets/builds, which does not exist
14+
# until esbuild has written it.
15+
if TestAppReactSource.apply!(File.expand_path('spec/test_app', __dir__))
16+
puts "spec/test_app wired to npm React #{TestAppReactSource.npm_version}"
17+
end
818
end
919
end
1020

0 commit comments

Comments
 (0)