From 6c492bb202593bfea091e6df69208257fdb754da Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 22 Jun 2020 17:44:19 -0500 Subject: [PATCH] Add react-rails --- Gemfile | 1 + Gemfile.lock | 13 ++ NOTICE-js | 1 + NOTICE-ruby | 151 +++++++++++++++++++++++ app/javascript/components/.keep | 0 app/javascript/packs/application.js | 4 + app/javascript/packs/server_rendering.js | 5 + package.json | 1 + yarn.lock | 7 ++ 9 files changed, 183 insertions(+) create mode 100644 app/javascript/components/.keep create mode 100644 app/javascript/packs/application.js create mode 100644 app/javascript/packs/server_rendering.js diff --git a/Gemfile b/Gemfile index 68047bf3..9bc0cd3f 100755 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ gem 'sassc-rails', '~> 2.1', '>= 2.1.2' gem 'sassc', '~> 2.0', '>= 2.0.1' gem 'stripe', '~> 1.58' # January 19, 2017 version of the Stripe API https://stripe.com/docs/api gem 'webpacker', '~> 5.1.1' +gem 'react-rails' gem 'httparty', '~> 0.17.0' # https://github.com/jnunemaker/httparty gem 'rack-attack', '~> 5.2' # for blocking ip addressses diff --git a/Gemfile.lock b/Gemfile.lock index af46446e..00f9c3a0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,6 +93,10 @@ GEM amq-protocol (2.3.0) andand (1.3.3) ast (2.4.0) + babel-source (5.8.35) + babel-transpiler (0.7.0) + babel-source (>= 4.0, < 6) + execjs (~> 2.0) bcrypt (3.1.13) bootsnap (1.4.4) msgpack (~> 1.0) @@ -104,6 +108,7 @@ GEM coderay (1.1.2) colorize (0.8.1) concurrent-ruby (1.1.6) + connection_pool (2.2.3) countries (3.0.0) i18n_data (~> 0.8.0) sixarm_ruby_unaccent (~> 1.1) @@ -136,6 +141,7 @@ GEM dotenv (= 2.7.5) railties (>= 3.2, < 6.1) erubi (1.9.0) + execjs (2.7.0) factory_bot (5.0.2) activesupport (>= 4.2.0) factory_bot_rails (5.0.2) @@ -287,6 +293,12 @@ GEM rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) + react-rails (2.6.1) + babel-transpiler (>= 0.7.0) + connection_pool + execjs + railties (>= 3.2) + tilt request_store (1.4.1) rack (>= 1.4) require_all (2.0.0) @@ -451,6 +463,7 @@ DEPENDENCIES rails (~> 6.0.3, >= 6.0.3.2) rails-i18n (~> 6.0.0, ~> 6) rake (~> 12.3.2) + react-rails roadie-rails (~> 2.1) rspec (~> 3.9.0) rspec-rails (~> 4.0.0) diff --git a/NOTICE-js b/NOTICE-js index a991b229..514e761a 100644 --- a/NOTICE-js +++ b/NOTICE-js @@ -552,6 +552,7 @@ Copyright 2015-present Facebook, Inc. Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch ** fb-watchman; version 2.0.1 -- https://facebook.github.io/watchman/ Copyright 2014-present Facebook, Inc. +** react_ujs; version 2.6.1 -- https://github.com/reactjs/react-rails#readme ** spdx-correct; version 3.1.1 -- https://github.com/jslicense/spdx-correct.js#readme ** true-case-path; version 1.0.3 -- https://github.com/barsh/true-case-path#readme ** validate-npm-package-license; version 3.0.4 -- https://github.com/kemitchell/validate-npm-package-license.js#readme diff --git a/NOTICE-ruby b/NOTICE-ruby index c4969591..5383bb68 100644 --- a/NOTICE-ruby +++ b/NOTICE-ruby @@ -371,6 +371,30 @@ Copyright (c) 2008-2015 Sadayuki Furuhashi ** addressable; version 2.6.0 -- Copyright (c) Bob Aman +** react-rails; version 2.6.1 -- +(c) Sindre Sorhus +Copyright (c) 2014 Ben Alpert +Copyright 2013 Facebook, Inc. +Copyright 2014 Facebook, Inc. +Copyright 2004-present Facebook. +Copyright 2011 The Closure Compiler +Copyright 2013-2015, Facebook, Inc. +Copyright (c) 2011, The Dojo Foundation +Copyright (c) 2013-present, Facebook, Inc. +Copyright (c) 2014-present, Facebook, Inc. +Copyright (c) Facebook, Inc. and its affiliates. +Copyright 2011 Mozilla Foundation and contributors +Copyright (c) 2012 Mathias Bynens +Copyright Joyent, Inc. and other Node contributors. +Copyright (c) 2012 Kris Kowal +Copyright (c) 2013 Thaddee Tyl +Copyright 2009-2011 Mozilla Foundation and contributors +Copyright (c) 2012 Yusuke Suzuki +Copyright (c) 2011 Ariya Hidayat +Copyright (c) 2012 Ariya Hidayat +Copyright (c) 2013 Ariya Hidayat +Copyright (c) 2012 Arpad Borsos +Copyright (c) 2012 Joost-Wim Boekesteijn Apache License @@ -1552,6 +1576,33 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------ + +** babel-transpiler; version 0.7.0 -- +Copyright (c) 2015 Joshua Peek + +Copyright (c) 2015 Joshua Peek + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + ------ ** rspec-rails; version 4.0.1 -- @@ -1586,6 +1637,33 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------ + +** connection_pool; version 2.2.3 -- +Copyright (c) 2011 Mike Perham + +Copyright (c) 2011 Mike Perham + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + ------ ** rubocop; version 0.72.0 -- @@ -3217,6 +3295,35 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------ + +** execjs; version 2.7.0 -- +Copyright (c) 2015-2016 Josh Peek +Copyright (c) 2015-2016 Sam Stephenson + +Copyright (c) 2015-2016 Sam Stephenson +Copyright (c) 2015-2016 Josh Peek + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + ------ ** actionmailer; version 6.0.3.2 -- @@ -3873,6 +3980,50 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------ + +** babel-source; version 5.8.35 -- +Copyright (c) 2014, Facebook, Inc. +Copyright 2011 The Closure Compiler +Copyright 2014, 2015 Simon Lydell X11 +(c) 2014 Angry Bytes and contributors. +Copyright (c) 2009 Thomas Robinson <280north.com> +Copyright (c) 2014 Ivan Nikulin +Copyright 2011 Mozilla Foundation and contributors +Copyright 2014 Mozilla Foundation and contributors +Copyright Joyent, Inc. and other Node contributors. +Copyright 2014 Benjamin Tan +Copyright (c) 2013 Olov Lassus +Copyright 2009-2011 Mozilla Foundation and contributors +Copyright (c) 2013 Yusuke Suzuki +Copyright (c) 2013-2014 Olov Lassus +Copyright (c) 2013-2014 Yusuke Suzuki +Copyright (c) 2014-2015 Sebastian McKenzie + +Copyright (c) 2014-2015 Sebastian McKenzie + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + ------ ** dante; version 0.2.0 -- diff --git a/app/javascript/components/.keep b/app/javascript/components/.keep new file mode 100644 index 00000000..e69de29b diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js new file mode 100644 index 00000000..fc913139 --- /dev/null +++ b/app/javascript/packs/application.js @@ -0,0 +1,4 @@ +// Support component names relative to this directory: +var componentRequireContext = require.context("components", true); +var ReactRailsUJS = require("react_ujs"); +ReactRailsUJS.useContext(componentRequireContext); diff --git a/app/javascript/packs/server_rendering.js b/app/javascript/packs/server_rendering.js new file mode 100644 index 00000000..a31e683d --- /dev/null +++ b/app/javascript/packs/server_rendering.js @@ -0,0 +1,5 @@ +// By default, this pack is loaded for server-side rendering. +// It must expose react_ujs as `ReactRailsUJS` and prepare a require context. +var componentRequireContext = require.context("components", true); +var ReactRailsUJS = require("react_ujs"); +ReactRailsUJS.useContext(componentRequireContext); diff --git a/package.json b/package.json index 7dd2eefe..7a5e02c3 100644 --- a/package.json +++ b/package.json @@ -123,6 +123,7 @@ "react-intl": "^2.4.0", "react-text-mask": "^5.3.0", "react-transition-group": "^2.9.0", + "react_ujs": "^2.6.1", "shuffle-array": "1.0.1", "snabbdom": "0.3.0", "snake-case": "2.1.0", diff --git a/yarn.lock b/yarn.lock index 240642bd..8b7c2009 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9426,6 +9426,13 @@ react@^16.2.0: object-assign "^4.1.1" prop-types "^15.6.2" +react_ujs@^2.6.0, react_ujs@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/react_ujs/-/react_ujs-2.6.1.tgz#a202a33c95c9e2bb18ab56926b7e79f3325ec855" + integrity sha512-9M33/A8cubStkZ2cpJSimcTD0RlCWiqXF6e90IQmMw/Caf/W0dtAzOtHtiQE3JjLbt/nhRR7NLPxMfnlm141ig== + dependencies: + react_ujs "^2.6.0" + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774"