Skip to content

Commit 181811a

Browse files
committed
trying to get rails-hyperstack tests to run
1 parent f507808 commit 181811a

File tree

96 files changed

+35
-1406
lines changed

Some content is hidden

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

96 files changed

+35
-1406
lines changed

install/rails-webpacker.rb

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,46 @@
99
# ----------------------------------- Add the gems
1010

1111
gem 'webpacker'
12-
gem 'hyperloop', github: 'hyperstack-org/hyperstack', branch: 'edge', glob: 'ruby/*/*.gemspec'
13-
gem 'opal_hot_reloader', github: 'hyperstack-org/opal-hot-reloader'
12+
gem 'rails-hyperstack', github: 'hyperstack-org/hyperstack', branch: 'edge', glob: 'ruby/*/*.gemspec'
1413

1514
gem_group :development do
1615
gem 'foreman'
1716
end
1817

1918
# ----------------------------------- Create the folders
2019

21-
run 'mkdir app/hyperloop'
22-
run 'mkdir app/hyperloop/components'
23-
run 'mkdir app/hyperloop/stores'
24-
run 'mkdir app/hyperloop/models'
25-
run 'mkdir app/hyperloop/operations'
20+
run 'mkdir app/hyperstack'
21+
run 'mkdir app/hyperstack/components'
22+
run 'mkdir app/hyperstack/stores'
23+
run 'mkdir app/hyperstack/models'
24+
run 'mkdir app/hyperstack/operations'
2625

2726
# ----------------------------------- Add .keep files
2827

29-
run 'touch app/hyperloop/components/.keep'
30-
run 'touch app/hyperloop/stores/.keep'
31-
run 'touch app/hyperloop/models/.keep'
32-
run 'touch app/hyperloop/operations/.keep'
28+
run 'touch app/hyperstack/stores/.keep'
29+
run 'touch app/hyperstack/models/.keep'
30+
run 'touch app/hyperstack/operations/.keep'
3331

34-
# ----------------------------------- Create the Hyperloop config
32+
# ----------------------------------- Create the HyperCompnent base class
3533

36-
file 'config/initializers/hyperloop.rb', <<-CODE
37-
Hyperloop.configuration do |config|
34+
file 'app/hyperstack/components/hyper_component.rb', <<-CODE
35+
class HyperComponent
36+
include Hyperstack::Component
37+
include Hyperstack::State::Observer
38+
end
39+
CODE
40+
41+
# ----------------------------------- Create the Hyperstack config
42+
43+
file 'config/initializers/hyperstack.rb', <<-CODE
44+
# config/initializers/hyperstack.rb
45+
# If you are not using ActionCable, see http://hyperstack.orgs/docs/models/configuring-transport/
46+
Hyperstack.configuration do |config|
3847
# config.transport = :action_cable
39-
config.import 'reactrb/auto-import'
40-
config.import 'opal_hot_reloader'
48+
config.prerendering = :off # or :on
4149
config.cancel_import 'react/react-source-browser' # bring your own React and ReactRouter via Yarn/Webpacker
50+
config.import 'hyperstack/component/jquery', client_only: true # remove this line if you don't need jquery
51+
config.import 'hyperstack/hotloader', client_only: true if Rails.env.development?
4252
end
4353
CODE
4454

@@ -55,7 +65,7 @@
5565
import React from 'react';
5666
import ReactDOM from 'react-dom';
5767
58-
// for opal/hyperloop modules to find React and others they must explicitly be saved
68+
// for opal/hyperstack modules to find React and others they must explicitly be saved
5969
// to the global space, otherwise webpack will encapsulate them locally here
6070
global.React = React;
6171
global.ReactDOM = ReactDOM;
@@ -75,40 +85,33 @@
7585
<<-CODE
7686
//= require jquery
7787
//= require jquery_ujs
78-
//= require hyperloop-loader
88+
//= require hyperstack-loader
7989
CODE
8090
end
8191

8292
# ----------------------------------- Procfile
8393

8494
file 'Procfile', <<-CODE
8595
web: bundle exec puma
86-
hot: opal-hot-reloader -p 25222 -d app/hyperloop/
87-
CODE
88-
89-
# ----------------------------------- OpalHotReloader client
90-
91-
file 'app/hyperloop/components/hot_loader.rb', <<-CODE
92-
require 'opal_hot_reloader'
93-
OpalHotReloader.listen(25222, false)
96+
hot: hyperstack-hotloader -p 25222 -d app/hyperstack/
9497
CODE
9598

9699
# ----------------------------------- Mount point
97100

98-
route "mount Hyperloop::Engine => '/hyperloop'"
101+
route "mount Hyperstack::Engine => '/hyperstack'"
99102

100103
# ----------------------------------- Hello World
101104

102-
route "root 'hyperloop#HelloWorld'"
103-
file 'app/hyperloop/components/hello_world.rb', <<-CODE
104-
class HelloWorld < Hyperloop::Component
105+
route "root 'hyperstack#HelloWorld'"
106+
file 'app/hyperstack/components/hello_world.rb', <<-CODE
107+
class HelloWorld < HyperComponent
105108
render do
106109
H1 { "Hello world from Hyperstack edge!" }
107110
end
108111
end
109112
CODE
110113

111-
# ----------------------------------- Commit Hyperloop setup
114+
# ----------------------------------- Commit Hyperstack setup
112115

113116
after_bundle do
114117
run 'bundle exec rails webpacker:install'

ruby/rails-hyperstack/spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
require 'hyper-spec'
1010
require 'rails-hyperstack'
1111
require 'puma'
12+
require 'turbolinks'
1213

1314
Capybara.server = :puma
1415

ruby/rails-hyperstack/spec/test_app/.gitignore

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

ruby/rails-hyperstack/spec/test_app/.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

ruby/rails-hyperstack/spec/test_app/Gemfile.lock

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

ruby/rails-hyperstack/spec/test_app/Procfile

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

0 commit comments

Comments
 (0)