Install react-rails #31
3
.gitignore
vendored
3
.gitignore
vendored
@ -33,3 +33,6 @@
|
|||||||
|
|
||||||
# Ignore master key for decrypting credentials and more.
|
# Ignore master key for decrypting credentials and more.
|
||||||
/config/master.key
|
/config/master.key
|
||||||
|
|
||||||
|
/node_modules
|
||||||
|
/public/packs
|
1
Gemfile
1
Gemfile
@ -68,3 +68,4 @@ gem "money"
|
|||||||
gem 'acts-as-taggable-on'
|
gem 'acts-as-taggable-on'
|
||||||
|
|
||||||
gem "rubytree"
|
gem "rubytree"
|
||||||
|
gem 'react-rails'
|
13
Gemfile.lock
13
Gemfile.lock
@ -77,6 +77,10 @@ GEM
|
|||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
acts-as-taggable-on (10.0.0)
|
acts-as-taggable-on (10.0.0)
|
||||||
activerecord (>= 6.1, < 7.2)
|
activerecord (>= 6.1, < 7.2)
|
||||||
|
babel-source (5.8.35)
|
||||||
|
babel-transpiler (0.7.0)
|
||||||
|
babel-source (>= 4.0, < 6)
|
||||||
|
execjs (~> 2.0)
|
||||||
base64 (0.2.0)
|
base64 (0.2.0)
|
||||||
bigdecimal (3.1.8)
|
bigdecimal (3.1.8)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
@ -94,6 +98,7 @@ GEM
|
|||||||
diff-lcs (1.5.1)
|
diff-lcs (1.5.1)
|
||||||
drb (2.2.1)
|
drb (2.2.1)
|
||||||
erubi (1.13.0)
|
erubi (1.13.0)
|
||||||
|
execjs (2.9.1)
|
||||||
factory_bot (6.4.6)
|
factory_bot (6.4.6)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
factory_bot_rails (6.4.3)
|
factory_bot_rails (6.4.3)
|
||||||
@ -204,6 +209,12 @@ GEM
|
|||||||
rake (13.2.1)
|
rake (13.2.1)
|
||||||
rdoc (6.7.0)
|
rdoc (6.7.0)
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
|
react-rails (3.2.1)
|
||||||
|
babel-transpiler (>= 0.7.0)
|
||||||
|
connection_pool
|
||||||
|
execjs
|
||||||
|
railties (>= 3.2)
|
||||||
|
tilt
|
||||||
redis (5.2.0)
|
redis (5.2.0)
|
||||||
redis-client (>= 0.22.0)
|
redis-client (>= 0.22.0)
|
||||||
redis-client (0.22.2)
|
redis-client (0.22.2)
|
||||||
@ -240,6 +251,7 @@ GEM
|
|||||||
railties (>= 6.0.0)
|
railties (>= 6.0.0)
|
||||||
stringio (3.1.1)
|
stringio (3.1.1)
|
||||||
thor (1.3.1)
|
thor (1.3.1)
|
||||||
|
tilt (2.4.0)
|
||||||
timeout (0.4.1)
|
timeout (0.4.1)
|
||||||
turbo-rails (2.0.6)
|
turbo-rails (2.0.6)
|
||||||
actionpack (>= 6.0.0)
|
actionpack (>= 6.0.0)
|
||||||
@ -279,6 +291,7 @@ DEPENDENCIES
|
|||||||
pry
|
pry
|
||||||
puma (>= 5.0)
|
puma (>= 5.0)
|
||||||
rails (~> 7.1.3, >= 7.1.3.2)
|
rails (~> 7.1.3, >= 7.1.3.2)
|
||||||
|
react-rails
|
||||||
redis (>= 4.0.1)
|
redis (>= 4.0.1)
|
||||||
rspec-rails (~> 6.1.0)
|
rspec-rails (~> 6.1.0)
|
||||||
rubytree
|
rubytree
|
||||||
|
3
app/assets/javascripts/application.js
Normal file
3
app/assets/javascripts/application.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
//= require react
|
||||||
|
//= require react_ujs
|
||||||
|
//= require components
|
1
app/assets/javascripts/components.js
Normal file
1
app/assets/javascripts/components.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
//= require_tree ./components
|
0
app/assets/javascripts/components/.keep
Normal file
0
app/assets/javascripts/components/.keep
Normal file
6
app/assets/javascripts/server_rendering.js
Normal file
6
app/assets/javascripts/server_rendering.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
//= require react-server
|
||||||
|
//= require react_ujs
|
||||||
|
//= require ./components
|
||||||
|
//
|
||||||
|
// By default, this file is loaded for server-side rendering.
|
||||||
|
// It should require your components and any dependencies.
|
4
config/initializers/react_server_rendering.rb
Normal file
4
config/initializers/react_server_rendering.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# To render React components in production, precompile the server rendering manifest:
|
||||||
|
Rails.application.config.assets.precompile += ["server_rendering.js"]
|
Loading…
x
Reference in New Issue
Block a user