react_on_rails 10.1.3 → 10.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: fb302b8350ede38683a4c47aa93ba4d370190d0e051fc03646fab235b7bfc8de
4
- data.tar.gz: 5bb9691c1a9814d9e17e7d99ca75a471bdb43fd1e53373d2f315f2d15c94d81f
2
+ SHA1:
3
+ metadata.gz: cf2961b3168fa3053ed43d36eda3e644c37ec679
4
+ data.tar.gz: 4e6aa1237e92667735efeb47092b58466e93b040
5
5
  SHA512:
6
- metadata.gz: 3a294a9d796137ea9bb5dde298dc80c29b925989103bc65f7114993353bbc6f0dfa55cdb4cc51ae0d656e518d917ecae1d95af41996d328c6c72986f7877dc5c
7
- data.tar.gz: 8b3d11cc0172eb5d1a721c8c9e130c51085a7cf2f7fd0ffeacd56a3dea0a4875414e8e2026845c42ee73aeacf0da2633e0c5acaa810716ad96d6b9dbd6558702
6
+ metadata.gz: 9d1ed494bfb5f01d3cfec7946459070145543104b483ee35612d683031e4027e89d8d47e64811a40a29d321d22985c4da5a7741375198a53dc0c3cd3be8308b9
7
+ data.tar.gz: 9cd73592f960f72e22d0318daa3c87d8f22d07513d0121997467140f854b43da062e1f03da10fdadec8c6b503d997421ad6d0bae2e8a83819f7ffb75ad707995
@@ -6,6 +6,15 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
6
6
  ## [Unreleased]
7
7
  Changes since last non-beta release.
8
8
 
9
+ ### [10.1.4] - 2018-04-11
10
+
11
+ #### Fixed
12
+ - Changed i18n parsing to convert ruby i18n argument syntax into FormatJS argument syntax. [PR 1046](https://github.com/shakacode/react_on_rails/pull/1046) by [sepehr500](https://github.com/sepehr500).
13
+
14
+ - Fixed an issue where the spec compiler check would fail if the project path contained spaces. [PR 1045](https://github.com/shakacode/react_on_rails/pull/1045) by [andrewmarkle](https://github.com/andrewmarkle).
15
+
16
+ - Updated the default `build_production_command` that caused production assets to be built with development settings. [PR 1053](https://github.com/shakacode/react_on_rails/pull/1053) by [Roman Kushnir](https://github.com/RKushnir).
17
+
9
18
  *Please add entries here for your pull requests that are not yet released.*
10
19
 
11
20
  ### [10.1.3] - 2018-02-28
@@ -691,7 +700,8 @@ Best done with Object destructing:
691
700
  ##### Fixed
692
701
  - Fix several generator related issues.
693
702
 
694
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/10.1.3...master
703
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/10.1.4...master
704
+ [10.1.4]: https://github.com/shakacode/react_on_rails/compare/10.1.3...10.1.4
695
705
  [10.1.3]: https://github.com/shakacode/react_on_rails/compare/10.1.2...10.1.3
696
706
  [10.1.2]: https://github.com/shakacode/react_on_rails/compare/10.1.1...10.1.2
697
707
  [10.1.1]: https://github.com/shakacode/react_on_rails/compare/10.1.0...10.1.1
@@ -1,9 +1,16 @@
1
1
  # Projects using React on Rails
2
2
 
3
+ [Click here](https://publicwww.com/websites/%22react-on-rails%22++-undeveloped.com/) for a search for public sites using React on Rails.
4
+
5
+ Public Sites Using React on Rails:
6
+
7
+ March 27, 2018: 2126<br>
8
+ April 11, 2018: 2138
9
+
3
10
  *Please support the project by [emailing Justin Gordon](mailto:justin@shakacode.com) of any projects, yours or others, that use React on Rails. You can confirm a project uses React on Rails as the source will contain **`js-react-on-rails`**.*
4
11
 
5
12
  ## Commercial Products Live
6
- * **[Friends and Guests](https://www.friendsandguests.com/)**, the signature product of [ShakaCode](http://www.shakacode.com), which is a "Network Connecting Hosts and Guests".
13
+ * **[Hawaii Chee](https://www.hawaiichee.com/)**, the signature product of [ShakaCode](http://www.shakacode.com), which is a vacation rental site focusing on Hawaii.
7
14
  * **[KissKissBankBank](https://www.kisskissbankbank.com/)**, large French crowdfunding platform.
8
15
  * **[HVMN](https://hvmn.com)**: Web ecommerce site for "biohacking" products.
9
16
  * **[GuavaPass](https://guavapass.com/)**: Coaching client of [ShakaCode](http://www.shakacode.com) and React on Rails fan!
data/README.md CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  *If this projects helps you, please give us a star!*
4
4
 
5
- [The ShakaCode team has availability to help your project](http://www.shakacode.com/work). If your team might need my help, please [email me](mailto:justin@shakacode.com) for a free half-hour project consultation, on anything from React on Rails to any aspect of web or mobile application development for both consumer and enterprise products.
5
+ # [The ShakaCode team has availability to help your project as of 2018-03-27](http://www.shakacode.com/services).
6
6
 
7
- # React on Rails v10 is based on Webpacker 3.0!
7
+ If your team might need my help, please [email me](mailto:justin@shakacode.com) for a free half-hour project consultation, on anything from React on Rails to any aspect of web or mobile application development for both consumer and enterprise products.
8
+
9
+ ## React on Rails v10 is based on Webpacker 3.0!
8
10
 
9
11
  * See the article [Introducing React on Rails v9 with Webpacker Support](https://blog.shakacode.com/introducing-react-on-rails-v9-with-webpacker-support-f2584c6c8fa4) for an overview of the integration of React on Rails with Webpacker.
10
12
  * [Video of running the v9 installer with Webpacker v3](https://youtu.be/M0WUM_XPaII).
@@ -31,9 +33,10 @@ First be sure to run `rails -v` and check that you are using Rails 5.1.3 or abov
31
33
 
32
34
  1. New Rails app: `rails new my-app --webpack=react`. `cd` into the directory.
33
35
  2. Add gem version: `gem 'react_on_rails', '10.0.2' # prefer exact gem version to match npm version`
34
- 3. Run the generator: `rails generate react_on_rails:install`
35
- 4. Start the app: `rails s`
36
- 5. Visit http://localhost:3000/hello_world
36
+ 3. `bundle install`
37
+ 4. Run the generator: `rails generate react_on_rails:install`
38
+ 5. Start the app: `rails s`
39
+ 6. Visit http://localhost:3000/hello_world
37
40
 
38
41
  ### Turn on server rendering
39
42
 
@@ -133,7 +136,7 @@ For more testimonials, see [Live Projects](PROJECTS.md) and [Kudos](./KUDOS.md).
133
136
 
134
137
  **Project Objective**: To provide an opinionated and optimal framework for integrating Ruby on Rails with React via the [**Webpacker**](https://github.com/rails/webpacker) gem.
135
138
 
136
- React on Rails integrates Facebook's [React](https://github.com/facebook/react) front-end framework with Rails. React v0.14.x and greater is supported, with server rendering. [Redux](https://github.com/reactjs/redux) and [React-Router](https://github.com/reactjs/react-redux) are supported as well, also with server rendering, using **execJS**.
139
+ React on Rails integrates Facebook's [React](https://github.com/facebook/react) front-end framework with Rails. React v0.14.x and greater is supported, with server rendering. [Redux](https://github.com/reactjs/redux) and [React-Router](https://github.com/reactjs/react-router) are supported as well, also with server rendering, using **execJS**.
137
140
 
138
141
  ## Table of Contents
139
142
 
@@ -305,9 +305,9 @@ module ReactOnRailsHelper
305
305
  # IMPORTANT: Ensure that we mark string as html_safe to avoid escaping.
306
306
  # rubocop:disable Layout/IndentHeredoc
307
307
  <<-HTML.html_safe
308
+ #{rendered_output}
308
309
  #{component_specification_tag}
309
- #{rendered_output}
310
- #{console_script}
310
+ #{console_script}
311
311
  HTML
312
312
  # rubocop:enable Layout/IndentHeredoc
313
313
  end
@@ -3,41 +3,61 @@
3
3
  In order to deploy a React on Rails app to elastic beanstalk, you must install yarn on each instance.
4
4
  If yarn is not installed, asset compilation will fail on the elastic beanstalk instance.
5
5
 
6
- You can install yarn by adding a `yarn.config` file to your `.ebextensions` folder which contains these commands.
6
+ You can install `yarn` by adding a `0x_install_yarn.config` file to your `.ebextensions` folder which contains these commands.
7
7
 
8
8
  ```
9
- commands:
10
-
11
- 01_node_get:
12
- cwd: /tmp
13
- command: 'sudo curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -'
14
-
15
- 02_node_install:
16
- cwd: /tmp
17
- command: 'sudo yum -y install nodejs'
18
-
19
- 03_yarn_get:
20
- cwd: /tmp
21
- # don't run the command if yarn is already installed (file /usr/bin/yarn exists)
22
- test: '[ ! -f /usr/bin/yarn ] && echo "yarn not installed"'
23
- command: 'sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo'
24
-
25
- 04_yarn_install:
26
- cwd: /tmp
27
- test: '[ ! -f /usr/bin/yarn ] && echo "yarn not installed"'
28
- command: 'sudo yum -y install yarn'
29
-
30
- 05_mkdir_webapp_dir:
31
- command: mkdir /home/webapp
32
- ignoreErrors: true
33
-
34
- 06_chown_webapp_dir:
35
- command: chown webapp:webapp /home/webapp
36
- ignoreErrors: true
37
-
38
- 07_chmod_webapp_dir:
39
- command: chmod 700 /home/webapp
40
- ignoreErrors: true
9
+ files:
10
+ "/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn.sh" :
11
+ mode: "000755"
12
+ owner: root
13
+ group: root
14
+ content: |
15
+ #!/usr/bin/env bash
16
+ set -xe
17
+
18
+ EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
19
+ EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
20
+ EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
21
+ EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
22
+
23
+ . $EB_SUPPORT_DIR/envvars
24
+ . $EB_SCRIPT_DIR/use-app-ruby.sh
25
+
26
+ # Install nodejs
27
+ echo "install nodejs"
28
+ curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
29
+ yum -y install nodejs
30
+ echo "install yarn"
31
+ # install yarn
32
+ wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo;
33
+ yum -y install yarn;
34
+
35
+ # yarn install
36
+ cd $EB_APP_STAGING_DIR
37
+ yarn
38
+
39
+ # mkdir /home/webapp
40
+ mkdir -p /home/webapp
41
+ chown webapp:webapp /home/webapp
42
+ chmod 700 /home/webapp
43
+ ```
44
+
45
+ This script installs `yarn` and all `node.js` dependencies before the rails do `assets:precompile`. Also, it creates `/home/webapp` directory allowing the precompile task to create temp files.
46
+
47
+ Your app can be deployed to elastic beanstalk successfully. However, the react app javascript files are under `public/packs`. If you are using nginx, you need to let it know the location of `https://yourhost/packs`.
41
48
 
49
+ In your `proxy.conf` setting, please add the following code.
50
+
51
+ ```
52
+ ...
53
+ server{
54
+ ...
55
+ location /packs {
56
+ root /var/app/current/public;
57
+ }
58
+ ...
59
+ }
60
+ ...
42
61
  ```
43
62
 
63
+ You can find an example code here: https://github.com/imgarylai/react_on_rails_with_aws_ebs.
@@ -5,7 +5,7 @@
5
5
  ReactOnRails.configure do |config|
6
6
  # This configures the script to run to build the production assets by webpack. Set this to nil
7
7
  # if you don't want react_on_rails building this file for you.
8
- config.build_production_command = "RAILS_ENV=production bin/webpack"
8
+ config.build_production_command = "RAILS_ENV=production NODE_ENV=production bin/webpack"
9
9
 
10
10
  ################################################################################
11
11
  ################################################################################
@@ -108,7 +108,7 @@ module ReactOnRails
108
108
  if v.is_a? Hash
109
109
  flatten(v).map { |hk, hv| h["#{k}.#{hk}".to_sym] = hv }
110
110
  else
111
- h[k] = v
111
+ h[k] = v.gsub("%{", "{")
112
112
  end
113
113
  end
114
114
  end
@@ -146,7 +146,7 @@ exitstatus: #{status.exitstatus}#{stdout_msg}#{stderr_msg}
146
146
  end
147
147
 
148
148
  def self.prepend_cd_node_modules_directory(cmd)
149
- "cd #{ReactOnRails.configuration.node_modules_location} && #{cmd}"
149
+ "cd \"#{ReactOnRails.configuration.node_modules_location}\" && #{cmd}"
150
150
  end
151
151
 
152
152
  def self.source_path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "10.1.3".freeze
4
+ VERSION = "10.1.4".freeze
5
5
  end
@@ -82,9 +82,7 @@ module ReactOnRails
82
82
  def major_minor_patch
83
83
  return if relative_path?
84
84
  match = raw.match(MAJOR_MINOR_PATCH_VERSION_REGEX)
85
- unless match
86
- raise "Cannot parse version number '#{raw}' (wildcard versions are not supported)"
87
- end
85
+ raise "Cannot parse version number '#{raw}' (wildcard versions are not supported)" unless match
88
86
  [match[1], match[2], match[3]]
89
87
  end
90
88
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "10.1.3",
3
+ "version": "10.1.4",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
@@ -47,5 +47,11 @@ Gem::Specification.new do |s|
47
47
  s.add_development_dependency "rails", "~> 5.1.2"
48
48
  s.add_development_dependency "rake", "~> 10.0"
49
49
  s.add_development_dependency "rspec"
50
+
51
+ s.post_install_message = <<~MSG
52
+ Email contact@shakacode.com for access to our slack room and information about our "pro support plan"
53
+ which supports better performance, via caching helpers and our node rendering server.
54
+
55
+ MSG
50
56
  end
51
57
  # rubocop:enable Metrics/BlockLength
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.1.3
4
+ version: 10.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -459,7 +459,10 @@ homepage: https://github.com/shakacode/react_on_rails
459
459
  licenses:
460
460
  - MIT
461
461
  metadata: {}
462
- post_install_message:
462
+ post_install_message: |+
463
+ Email contact@shakacode.com for access to our slack room and information about our "pro support plan"
464
+ which supports better performance, via caching helpers and our node rendering server.
465
+
463
466
  rdoc_options: []
464
467
  require_paths:
465
468
  - lib
@@ -475,7 +478,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
475
478
  version: '0'
476
479
  requirements: []
477
480
  rubyforge_project:
478
- rubygems_version: 2.7.2
481
+ rubygems_version: 2.6.14
479
482
  signing_key:
480
483
  specification_version: 4
481
484
  summary: Rails with react server rendering with webpack.