From 2ef52265d56895cdbe12833fd4518154a96f03b1 Mon Sep 17 00:00:00 2001 From: aaronzdavis Date: Wed, 12 Dec 2018 18:21:04 -0800 Subject: [PATCH 1/6] Bump Ruby version, remove poltergeist & capybara-webkit gems, fix migration issue with Rails 5.2 --- .ruby-version | 1 - Gemfile | 6 +++--- Gemfile.lock | 14 ++------------ db/migrate/20140823052830_create_comments.rb | 2 +- ...151015160035_set_default_for_author_and_text.rb | 2 +- ...015160334_change_author_and_text_to_not_null.rb | 2 +- db/schema.rb | 10 +++++----- 7 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 55bc9834..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -ruby-2.4.1 diff --git a/Gemfile b/Gemfile index eebbe349..56c928cd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -ruby "2.4.1" +ruby "2.5.2" gem "react_on_rails", "11.0.7" gem "webpacker" @@ -94,13 +94,13 @@ end group :test do gem "capybara", "2.18.0" gem "capybara-screenshot" - gem "capybara-webkit" + # gem "capybara-webkit" gem "chromedriver-helper" gem "coveralls", require: false gem "database_cleaner" gem "generator_spec" gem "launchy" - gem "poltergeist" + # gem "poltergeist" gem "rails_best_practices" gem "rspec-rails", "3.7.2" gem "selenium-webdriver" diff --git a/Gemfile.lock b/Gemfile.lock index b811edae..19a35148 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,15 +70,11 @@ GEM capybara-screenshot (1.0.21) capybara (>= 1.0, < 4) launchy - capybara-webkit (1.15.0) - capybara (>= 2.3, < 4.0) - json childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) chromedriver-helper (1.2.0) archive-zip (~> 0.10) nokogiri (~> 1.8) - cliver (0.3.2) code_analyzer (0.4.8) sexp_processor coderay (1.1.2) @@ -155,10 +151,6 @@ GEM parser (2.5.1.0) ast (~> 2.4.0) pg (1.0.0) - poltergeist (1.18.0) - capybara (>= 2.1, < 4) - cliver (~> 0.3.1) - websocket-driver (>= 0.2.0) powerpack (0.1.1) pry (0.11.3) coderay (~> 1.1.0) @@ -334,7 +326,6 @@ DEPENDENCIES bundler-audit capybara (= 2.18.0) capybara-screenshot - capybara-webkit chromedriver-helper coffee-rails coveralls @@ -347,7 +338,6 @@ DEPENDENCIES listen mini_racer pg - poltergeist pry pry-byebug pry-doc @@ -375,7 +365,7 @@ DEPENDENCIES webpacker RUBY VERSION - ruby 2.4.1p111 + ruby 2.5.2p104 BUNDLED WITH - 1.16.0 + 1.17.1 diff --git a/db/migrate/20140823052830_create_comments.rb b/db/migrate/20140823052830_create_comments.rb index 08edf6c9..84a41c27 100644 --- a/db/migrate/20140823052830_create_comments.rb +++ b/db/migrate/20140823052830_create_comments.rb @@ -1,4 +1,4 @@ -class CreateComments < ActiveRecord::Migration +class CreateComments < ActiveRecord::Migration[5.2] def change create_table :comments do |t| t.string :author diff --git a/db/migrate/20151015160035_set_default_for_author_and_text.rb b/db/migrate/20151015160035_set_default_for_author_and_text.rb index 05f9054b..216025b5 100644 --- a/db/migrate/20151015160035_set_default_for_author_and_text.rb +++ b/db/migrate/20151015160035_set_default_for_author_and_text.rb @@ -1,4 +1,4 @@ -class SetDefaultForAuthorAndText < ActiveRecord::Migration +class SetDefaultForAuthorAndText < ActiveRecord::Migration[5.2] def up change_column_default(:comments, :author, "") change_column_default(:comments, :text, "") diff --git a/db/migrate/20151015160334_change_author_and_text_to_not_null.rb b/db/migrate/20151015160334_change_author_and_text_to_not_null.rb index 8b171d6e..d6948ca4 100644 --- a/db/migrate/20151015160334_change_author_and_text_to_not_null.rb +++ b/db/migrate/20151015160334_change_author_and_text_to_not_null.rb @@ -1,4 +1,4 @@ -class ChangeAuthorAndTextToNotNull < ActiveRecord::Migration +class ChangeAuthorAndTextToNotNull < ActiveRecord::Migration[5.2] def change change_column_null(:comments, :author, false, "") change_column_null(:comments, :text, false, "") diff --git a/db/schema.rb b/db/schema.rb index 17278c6c..2dbcc2d5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,16 +10,16 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151015160334) do +ActiveRecord::Schema.define(version: 2015_10_15_160334) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "comments", force: :cascade do |t| - t.string "author", default: "", null: false - t.text "text", default: "", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.string "author", default: "", null: false + t.text "text", default: "", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end end From d1028b00a2951884b9f148a98eccd1a10471a168 Mon Sep 17 00:00:00 2001 From: aaronzdavis Date: Sat, 12 Jan 2019 12:33:05 -0700 Subject: [PATCH 2/6] Install React + React Dom 16.8.0-alpha.0 for Hooks --- client/package.json | 4 ++-- client/yarn.lock | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/client/package.json b/client/package.json index 951dbcc5..4408ef24 100644 --- a/client/package.json +++ b/client/package.json @@ -77,10 +77,10 @@ "node-uuid": "^1.4.8", "postcss-loader": "^2.0.8", "prop-types": "^15.6.0", - "react": "^16.1.1", + "react": "^16.8.0-alpha.0", "react-addons-css-transition-group": "^15.6.2", "react-bootstrap": "^0.31.5", - "react-dom": "^16.1.1", + "react-dom": "^16.8.0-alpha.0", "react-intl": "^2.4.0", "react-on-rails": "11.0.7", "react-redux": "^5.0.6", diff --git a/client/yarn.lock b/client/yarn.lock index 50e12e21..035420a4 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -6131,6 +6131,14 @@ prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.6.2: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" + proxy-addr@~2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec" @@ -6384,14 +6392,15 @@ react-deep-force-update@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c" -react-dom@^16.1.1: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" +react-dom@^16.8.0-alpha.0: + version "16.8.0-alpha.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.0-alpha.0.tgz#47bbcf42593eab5468b577d3c3f3c27f251a65ef" + integrity sha512-OGfLUXGxtMgqLB1BqnB9flVCvc8VvAnhQYeFr+EUzwiODcD34dPrxtfa7ccK4dwzcPi8HRLSyBcaQi2OvVoUww== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.13.0-alpha.0" react-intl@^2.4.0: version "2.4.0" @@ -6478,14 +6487,15 @@ react-transition-group@^1.2.0: prop-types "^15.5.6" warning "^3.0.0" -react@^16.1.1: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" +react@^16.8.0-alpha.0: + version "16.8.0-alpha.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.0-alpha.0.tgz#8545eb79534cce5ba99ed40085f7f955e8857a19" + integrity sha512-B/nJJkNqV4JAJQ1M0Q38ZvhZ6BoYsjyZq29hbsIIPYayn/0DcYhu7tExpfzdtTC0SnUcA+RnDBTlXTEJ5b9PEg== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + prop-types "^15.6.2" + scheduler "^0.13.0-alpha.0" read-pkg-up@^1.0.1: version "1.0.1" @@ -6976,6 +6986,14 @@ sax@^1.2.4, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" +scheduler@^0.13.0-alpha.0: + version "0.13.0-alpha.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.0-alpha.0.tgz#8fc1f01617b59e4543376735b2f954867d49110c" + integrity sha512-+DbRwO53hlLso4gzrSIqcfNe8eRMMaV4gd4eySGisbyLBrp5unTpAMR0UAbrqlQLTGhnOFNoQAfaZTz4iPj1RQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf" From d6e67797be36792ed90397d77db07ce7178827a1 Mon Sep 17 00:00:00 2001 From: aaronzdavis Date: Sat, 12 Jan 2019 12:52:08 -0700 Subject: [PATCH 3/6] Add Simple Hooks Comment Screen --- app/controllers/pages_controller.rb | 1 + app/views/pages/simple_hooks.html.erb | 13 ++ .../NavigationBar/NavigationBar.jsx | 7 +- .../SimpleHooksCommentScreen.jsx | 121 ++++++++++++++++++ .../app/bundles/comments/constants/paths.js | 1 + .../comments/startup/clientRegistration.jsx | 2 + .../comments/startup/serverRegistration.jsx | 2 + config/routes.rb | 1 + spec/system/add_new_comment_spec.rb | 15 +++ 9 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 app/views/pages/simple_hooks.html.erb create mode 100644 client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 3f3956c7..48f79286 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -33,6 +33,7 @@ def no_router end def simple; end + def simple_hooks; end private diff --git a/app/views/pages/simple_hooks.html.erb b/app/views/pages/simple_hooks.html.erb new file mode 100644 index 00000000..8c44b430 --- /dev/null +++ b/app/views/pages/simple_hooks.html.erb @@ -0,0 +1,13 @@ +

Using React (with Hooks) + Rails Backend (with + react_on_rails gem)

+

This example is much simpler than the one using React + Redux and is appropriate when:

+
    +
  • No or minimal MVC
  • +
  • No async necessary
  • +
  • No server rendering
  • +
  • No pre-population of props
  • +
+
+ + +<%= react_component('SimpleHooksCommentScreen', props: {}, prerender: false) %> diff --git a/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx b/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx index c184b945..bb028138 100644 --- a/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx +++ b/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx @@ -33,13 +33,16 @@ const NavigationBar = (props) => {
  • + { active: (pathname === paths.ROUTER_PATH || pathname === paths.REACT_ROUTER_PATH) }, + )}> React Router Demo
  • React Demo
  • +
  • + Simple Hooks React +
  • Simple React
  • diff --git a/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx b/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx new file mode 100644 index 00000000..94ebb077 --- /dev/null +++ b/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx @@ -0,0 +1,121 @@ +import { React, useState, useEffect } from "react"; +import request from "axios"; +import Immutable from "immutable"; +import _ from "lodash"; +import ReactOnRails from "react-on-rails"; +import { IntlProvider, injectIntl } from "react-intl"; +import BaseComponent from 'libs/components/BaseComponent'; +import SelectLanguage from "libs/i18n/selectLanguage"; +import { defaultMessages, defaultLocale } from "libs/i18n/default"; +import { translations } from "libs/i18n/translations"; + +import CommentForm from "../CommentBox/CommentForm/CommentForm"; +import CommentList from "../CommentBox/CommentList/CommentList"; +import css from "../SimpleCommentScreen/SimpleCommentScreen.scss"; + +function SimpleHooksCommentScreen() { + const [comments, setComments] = useState(Immutable.fromJS([])); + const [isSaving, setIsSaving] = useState(false); + const [fetchCommentsError, setFetchCommentsError] = useState(null); + const [submitCommentError, setSubmitCommentError] = usestate(null); + + useEffect(() => { + this.fetchComments(); + }); + + function fetchComments() { + return request + .get("comments.json", { responseType: "json" }) + .then(res => + setComments(Immutable.fromJS(res.data.comments)) + ) + .catch(error => setFetchCommentsError(error)); + } + + function handleCommentSubmit(comment) { + setIsSaving(true); + + const requestConfig = { + responseType: "json", + headers: ReactOnRails.authenticityHeaders() + }; + + return request + .post("comments.json", { comment }, requestConfig) + .then(() => { + const $$comment = Immutable.fromJS(comment); + setComments(comments.unshift($$comment)); + setSubmitCommentError(null); + setIsSaving(false); + }) + .catch(error => { + setSubmitCommentError(error) + setIsSaving(false); + }); + } + + + const { handleSetLocale, locale, intl } = this.props; + const { formatMessage } = intl; + const cssTransitionGroupClassNames = { + enter: css.elementEnter, + enterActive: css.elementEnterActive, + leave: css.elementLeave, + leaveActive: css.elementLeaveActive + }; + + return ( +
    +

    {formatMessage(defaultMessages.comments)}

    + {SelectLanguage(handleSetLocale, locale)} +
      +
    • {formatMessage(defaultMessages.descriptionSupportMarkdown)}
    • +
    • {formatMessage(defaultMessages.descriptionDeleteRule)}
    • +
    • {formatMessage(defaultMessages.descriptionSubmitRule)}
    • +
    + + +
    + ); +} + +export default class I18nWrapper extends BaseComponent { + constructor(props) { + super(props); + + this.state = { + locale: defaultLocale + }; + + _.bindAll(this, "handleSetLocale"); + } + + handleSetLocale(locale) { + this.setState({ locale }); + } + + render() { + const { locale } = this.state; + const messages = translations[locale]; + const InjectedSimpleHooksCommentScreen = injectIntl(SimpleHooksCommentScreen); + + return ( + + + + ); + } +} diff --git a/client/app/bundles/comments/constants/paths.js b/client/app/bundles/comments/constants/paths.js index 91b3fea5..a7af0917 100644 --- a/client/app/bundles/comments/constants/paths.js +++ b/client/app/bundles/comments/constants/paths.js @@ -2,4 +2,5 @@ export const ROUTER_PATH = '/'; export const REACT_ROUTER_PATH = '/react-router'; export const NO_ROUTER_PATH = '/no-router'; export const SIMPLE_REACT_PATH = '/simple'; +export const SIMPLE_HOOKS_REACT_PATH = '/simple-hooks'; export const RAILS_PATH = '/comments'; diff --git a/client/app/bundles/comments/startup/clientRegistration.jsx b/client/app/bundles/comments/startup/clientRegistration.jsx index 3eb19264..ea37e899 100644 --- a/client/app/bundles/comments/startup/clientRegistration.jsx +++ b/client/app/bundles/comments/startup/clientRegistration.jsx @@ -9,6 +9,7 @@ import zh from 'react-intl/locale-data/zh'; import App from './App'; import RouterApp from './ClientRouterApp'; import SimpleCommentScreen from '../components/SimpleCommentScreen/SimpleCommentScreen'; +import SimpleHooksCommentScreen from '../components/SimpleHooksCommentScreen/SimpleHooksCommentScreen'; import routerCommentsStore from '../store/routerCommentsStore'; import commentsStore from '../store/commentsStore'; import NavigationBarApp from './NavigationBarApp'; @@ -25,6 +26,7 @@ ReactOnRails.register({ RouterApp, NavigationBarApp, SimpleCommentScreen, + SimpleHooksCommentScreen, }); ReactOnRails.registerStore({ diff --git a/client/app/bundles/comments/startup/serverRegistration.jsx b/client/app/bundles/comments/startup/serverRegistration.jsx index da8a1382..2c909467 100644 --- a/client/app/bundles/comments/startup/serverRegistration.jsx +++ b/client/app/bundles/comments/startup/serverRegistration.jsx @@ -4,6 +4,7 @@ import ReactOnRails from 'react-on-rails'; import App from './App'; import RouterApp from './ServerRouterApp'; import SimpleCommentScreen from '../components/SimpleCommentScreen/SimpleCommentScreen'; +import SimpleHooksCommentScreen from '../components/SimpleHooksCommentScreen/SimpleHooksCommentScreen'; import NavigationBarApp from './NavigationBarApp'; import routerCommentsStore from '../store/routerCommentsStore'; import commentsStore from '../store/commentsStore'; @@ -14,6 +15,7 @@ ReactOnRails.register( RouterApp, NavigationBarApp, SimpleCommentScreen, + SimpleHooksCommentScreen, }, ); diff --git a/config/routes.rb b/config/routes.rb index 83bc4640..073a1e50 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,6 +7,7 @@ root "pages#index" get "simple", to: "pages#simple" + get "simple-hooks", to: "pages#simple_hooks" get "no-router", to: "pages#no_router" # React Router needs a wildcard diff --git a/spec/system/add_new_comment_spec.rb b/spec/system/add_new_comment_spec.rb index 1709b606..2f54f06f 100644 --- a/spec/system/add_new_comment_spec.rb +++ b/spec/system/add_new_comment_spec.rb @@ -48,6 +48,21 @@ end end + context "simple hooks page", page: :simple_hooks, js: true, type: :system do + context "via Horizontal Form", form: :horizontal do + include_examples "New Comment Submission", false + include_examples "Validation errors displaying" + end + context "via Inline Form", form: :inline do + include_examples "New Comment Submission", false + include_examples "Validation errors displaying" + end + context "via the Stacked Form", form: :stacked do + include_examples "New Comment Submission", false + include_examples "Validation errors displaying" + end + end + context "from classic page", page: :classic do background { click_link "New Comment" } include_examples "New Comment Submission", false From d01a1df604df31278bba8fd4703e251d4870e940 Mon Sep 17 00:00:00 2001 From: aaronzdavis Date: Thu, 14 Mar 2019 14:13:02 -0700 Subject: [PATCH 4/6] Update ruby --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 56c928cd..e4c3e1ce 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -ruby "2.5.2" +ruby "2.6.1" gem "react_on_rails", "11.0.7" gem "webpacker" From 0a33dd0146435e46fd0946c69a1ee02ed3684ce0 Mon Sep 17 00:00:00 2001 From: aaronzdavis Date: Thu, 14 Mar 2019 14:33:39 -0700 Subject: [PATCH 5/6] add catch --- Gemfile.lock | 10 +- .../SimpleHooksCommentScreen.jsx | 6 + client/package.json | 8 +- client/yarn.lock | 230 ++++-------------- package.json | 4 +- 5 files changed, 59 insertions(+), 199 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 19a35148..43e22bd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -124,7 +124,7 @@ GEM json (2.1.0) launchy (2.4.3) addressable (~> 2.3) - libv8 (6.3.292.48.1) + libv8 (6.7.288.46.1) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -140,8 +140,8 @@ GEM mimemagic (0.3.2) mini_mime (1.0.0) mini_portile2 (2.3.0) - mini_racer (0.1.15) - libv8 (~> 6.3) + mini_racer (0.2.4) + libv8 (>= 6.3) minitest (5.11.3) multi_json (1.13.1) nio4r (2.3.1) @@ -365,7 +365,7 @@ DEPENDENCIES webpacker RUBY VERSION - ruby 2.5.2p104 + ruby 2.6.1p33 BUNDLED WITH - 1.17.1 + 1.17.3 diff --git a/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx b/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx index 94ebb077..3844392b 100644 --- a/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx +++ b/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx @@ -103,6 +103,12 @@ export default class I18nWrapper extends BaseComponent { this.setState({ locale }); } + componentDidCatch(error, info) { + console.log("xxxxxxxxxxxx") + console.log(error, info); + console.log("xxxxxxxxxxxx") + } + render() { const { locale } = this.state; const messages = translations[locale]; diff --git a/client/package.json b/client/package.json index 4408ef24..23431d0c 100644 --- a/client/package.json +++ b/client/package.json @@ -73,14 +73,14 @@ "loader-utils": "^1.1.0", "lodash": "^4.17.4", "marked": "^0.3.6", - "node-sass": "^4.7.2", + "node-sass": "^4.11.0", "node-uuid": "^1.4.8", "postcss-loader": "^2.0.8", "prop-types": "^15.6.0", - "react": "^16.8.0-alpha.0", + "react": "^16.8.4", "react-addons-css-transition-group": "^15.6.2", "react-bootstrap": "^0.31.5", - "react-dom": "^16.8.0-alpha.0", + "react-dom": "^16.8.4", "react-intl": "^2.4.0", "react-on-rails": "11.0.7", "react-redux": "^5.0.6", @@ -132,4 +132,4 @@ "^.+\\.jsx?$": "babel-jest" } } -} +} \ No newline at end of file diff --git a/client/yarn.lock b/client/yarn.lock index 035420a4..ac426a83 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -150,7 +150,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.3, ajv@^5.3.0: +ajv@^5.0.0, ajv@^5.1.5, ajv@^5.2.3, ajv@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.0.tgz#eb2840746e9dc48bd5e063a36e3fd400c5eab5a9" dependencies: @@ -423,7 +423,7 @@ aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" -aws4@^1.2.1, aws4@^1.6.0: +aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" @@ -1329,18 +1329,6 @@ boom@2.x.x: dependencies: hoek "2.x.x" -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - bootstrap-loader@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/bootstrap-loader/-/bootstrap-loader-2.2.0.tgz#dc162c82497275f0e427ab49bc406b4e6a8e250b" @@ -1586,10 +1574,6 @@ capture-exit@^1.2.0: dependencies: rsvp "^3.3.3" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -1823,7 +1807,7 @@ commander@2.8.x: dependencies: graceful-readlink ">= 1.0.0" -commander@^2.11.0, commander@^2.9.0: +commander@^2.11.0: version "2.12.2" resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" @@ -2005,12 +1989,6 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -2882,7 +2860,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.0, extend@~3.0.1: +extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -3118,14 +3096,6 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" -form-data@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" @@ -3230,16 +3200,6 @@ gaze@^1.0.0: dependencies: globule "^1.0.0" -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" @@ -3378,15 +3338,6 @@ har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - har-validator@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" @@ -3394,13 +3345,6 @@ har-validator@~4.2.1: ajv "^4.9.1" har-schema "^1.0.5" -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - har-validator@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" @@ -3496,15 +3440,6 @@ hawk@3.1.3, hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - history@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b" @@ -3527,10 +3462,6 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" -hoek@4.x.x: - version "4.2.0" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" - hoist-non-react-statics@^2.2.1, hoist-non-react-statics@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0" @@ -3978,15 +3909,6 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-my-json-valid@^2.12.4: - version "2.16.1" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz#5a846777e2c2620d1e69104e5d3a03b1f6088f11" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -4037,10 +3959,6 @@ is-promise@^2.0.0, is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - is-regex@^1.0.3, is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" @@ -4613,10 +4531,6 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -5171,10 +5085,15 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@>=2.5.1, nan@^2.3.0, nan@^2.3.2: +nan@>=2.5.1, nan@^2.3.0: version "2.8.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" +nan@^2.10.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.0.tgz#7bdfc27dd3c060c46e60b62c72b74012d1a4cd68" + integrity sha512-5DDQvN0luhXdut8SCwzm/ZuAX2W+fwhqNzfq7CZ+OJzQ6NwpcqmIGyLD1R8MEt7BeErzcsI0JLr4pND2pNp2Cw== + nan@^2.9.2: version "2.11.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" @@ -5222,19 +5141,19 @@ node-forge@0.6.33: version "0.6.33" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.6.33.tgz#463811879f573d45155ad6a9f43dc296e8e85ebc" -node-gyp@^3.3.1: - version "3.6.2" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.6.2.tgz#9bfbe54562286284838e750eac05295853fa1c60" +node-gyp@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" + integrity sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA== dependencies: fstream "^1.0.0" glob "^7.0.3" graceful-fs "^4.1.2" - minimatch "^3.0.2" mkdirp "^0.5.0" nopt "2 || 3" npmlog "0 || 1 || 2 || 3 || 4" osenv "0" - request "2" + request "^2.87.0" rimraf "2" semver "~5.3.0" tar "^2.0.0" @@ -5340,9 +5259,10 @@ node-pre-gyp@^0.6.39: tar "^2.2.1" tar-pack "^3.4.0" -node-sass@^4.7.2: - version "4.7.2" - resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.7.2.tgz#9366778ba1469eb01438a9e8592f4262bcb6794e" +node-sass@^4.11.0: + version "4.11.0" + resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.11.0.tgz#183faec398e9cbe93ba43362e2768ca988a6369a" + integrity sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA== dependencies: async-foreach "^0.1.3" chalk "^1.1.1" @@ -5356,10 +5276,10 @@ node-sass@^4.7.2: lodash.mergewith "^4.6.0" meow "^3.7.0" mkdirp "^0.5.1" - nan "^2.3.2" - node-gyp "^3.3.1" + nan "^2.10.0" + node-gyp "^3.8.0" npmlog "^4.0.0" - request "~2.79.0" + request "^2.88.0" sass-graph "^2.2.4" stdout-stream "^1.4.0" "true-case-path" "^1.0.2" @@ -5447,7 +5367,7 @@ nwsapi@^2.0.7: version "2.0.8" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.8.tgz#e3603579b7e162b3dbedae4fb24e46f771d8fa24" -oauth-sign@~0.8.1, oauth-sign@~0.8.2: +oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -6277,14 +6197,10 @@ q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" -qs@6.5.1, qs@~6.5.1: +qs@6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" -qs@~6.3.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" - qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" @@ -6392,15 +6308,15 @@ react-deep-force-update@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c" -react-dom@^16.8.0-alpha.0: - version "16.8.0-alpha.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.0-alpha.0.tgz#47bbcf42593eab5468b577d3c3f3c27f251a65ef" - integrity sha512-OGfLUXGxtMgqLB1BqnB9flVCvc8VvAnhQYeFr+EUzwiODcD34dPrxtfa7ccK4dwzcPi8HRLSyBcaQi2OvVoUww== +react-dom@^16.8.4: + version "16.8.4" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.4.tgz#1061a8e01a2b3b0c8160037441c3bf00a0e3bc48" + integrity sha512-Ob2wK7XG2tUDt7ps7LtLzGYYB6DXMCLj0G5fO6WeEICtT4/HdpOi7W/xLzZnR6RCG1tYza60nMdqtxzA8FaPJQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.0-alpha.0" + scheduler "^0.13.4" react-intl@^2.4.0: version "2.4.0" @@ -6487,15 +6403,15 @@ react-transition-group@^1.2.0: prop-types "^15.5.6" warning "^3.0.0" -react@^16.8.0-alpha.0: - version "16.8.0-alpha.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.8.0-alpha.0.tgz#8545eb79534cce5ba99ed40085f7f955e8857a19" - integrity sha512-B/nJJkNqV4JAJQ1M0Q38ZvhZ6BoYsjyZq29hbsIIPYayn/0DcYhu7tExpfzdtTC0SnUcA+RnDBTlXTEJ5b9PEg== +react@^16.8.4: + version "16.8.4" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.4.tgz#fdf7bd9ae53f03a9c4cd1a371432c206be1c4768" + integrity sha512-0GQ6gFXfUH7aZcjGVymlPOASTuSjlQL4ZtVC5YKH+3JL6bBLCVO21DknzmaPlI90LN253ojj02nsapy+j7wIjg== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.0-alpha.0" + scheduler "^0.13.4" read-pkg-up@^1.0.1: version "1.0.1" @@ -6687,33 +6603,6 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.0" tough-cookie ">=2.3.3" -request@2: - version "2.83.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - request@2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -6741,7 +6630,7 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" -request@^2.87.0: +request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" dependencies: @@ -6766,31 +6655,6 @@ request@^2.87.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -request@~2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - qs "~6.3.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - uuid "^3.0.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -6986,10 +6850,10 @@ sax@^1.2.4, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -scheduler@^0.13.0-alpha.0: - version "0.13.0-alpha.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.0-alpha.0.tgz#8fc1f01617b59e4543376735b2f954867d49110c" - integrity sha512-+DbRwO53hlLso4gzrSIqcfNe8eRMMaV4gd4eySGisbyLBrp5unTpAMR0UAbrqlQLTGhnOFNoQAfaZTz4iPj1RQ== +scheduler@^0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.4.tgz#8fef05e7a3580c76c0364d2df5e550e4c9140298" + integrity sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -7193,12 +7057,6 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - dependencies: - hoek "4.x.x" - sockjs-client@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.4.tgz#5babe386b775e4cf14e7520911452654016c8b12" @@ -7426,7 +7284,7 @@ string_decoder@^1.0.0, string_decoder@~1.0.3: dependencies: safe-buffer "~5.1.0" -stringstream@~0.0.4, stringstream@~0.0.5: +stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -7657,7 +7515,7 @@ token-stream@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a" -tough-cookie@>=2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3: +tough-cookie@>=2.3.3, tough-cookie@~2.3.0: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: @@ -7704,10 +7562,6 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - turbolinks@^5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/turbolinks/-/turbolinks-5.0.3.tgz#c8ce128cfc9be1d691a1e41ffa858a5a5ee86a02" @@ -7872,7 +7726,7 @@ uuid@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0, uuid@^3.1.0: +uuid@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" diff --git a/package.json b/package.json index 2806db30..86359fc6 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "ShakaCode's example of React on Rails plus React Native", "main": "server-express.js", "engines": { - "node": "^7.8.0 || ^8.0.0 || ^9.2.0 || ^10.0.0", + "node": "^7.8.0 || ^8.0.0 || ^9.2.0 || ^10.0.0 || ^11.0.0", "npm": "^4.4.4 || ^5.0.0", "yarn": "^1.0.0" }, @@ -46,4 +46,4 @@ "node_modules", "client/node_modules" ] -} +} \ No newline at end of file From eb5f322de1d194a935faeb7fed9baa3bae38d22a Mon Sep 17 00:00:00 2001 From: aaronzdavis Date: Thu, 14 Mar 2019 15:26:56 -0700 Subject: [PATCH 6/6] remove intl wrapper --- .../SimpleCommentScreen.jsx | 2 +- .../ErrorBoundary.jsx | 32 ++++++++++++++ .../SimpleHooksCommentScreen.jsx | 43 +++++++++++++++---- 3 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 client/app/bundles/comments/components/SimpleHooksCommentScreen/ErrorBoundary.jsx diff --git a/client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx b/client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx index e924749d..6a849176 100644 --- a/client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx +++ b/client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx @@ -85,7 +85,7 @@ class SimpleCommentScreen extends BaseComponent {

    {formatMessage(defaultMessages.comments)}

    - { SelectLanguage(handleSetLocale, locale) } + {SelectLanguage(handleSetLocale, locale)}
    • {formatMessage(defaultMessages.descriptionSupportMarkdown)}
    • {formatMessage(defaultMessages.descriptionDeleteRule)}
    • diff --git a/client/app/bundles/comments/components/SimpleHooksCommentScreen/ErrorBoundary.jsx b/client/app/bundles/comments/components/SimpleHooksCommentScreen/ErrorBoundary.jsx new file mode 100644 index 00000000..a3f750f8 --- /dev/null +++ b/client/app/bundles/comments/components/SimpleHooksCommentScreen/ErrorBoundary.jsx @@ -0,0 +1,32 @@ +import React from 'react'; + +class ErrorBoundary extends React.PureComponent { + constructor(props) { + super(props); + this.state = { hasError: false }; + } + + static getDerivedStateFromError(error) { + // Update state so the next render will show the fallback UI. + console.log(error, "getDerivedStateFromError"); + return { hasError: true }; + } + + componentDidCatch(error, info) { + // You can also log the error to an error reporting service + console.log("xxxxxxxxxxxx") + console.log(error, info); + console.log("xxxxxxxxxxxx") + } + + render() { + if (this.state.hasError) { + // You can render any custom fallback UI + return

      Something went wrong.

      ; + } + + return this.props.children; + } +} + +export default ErrorBoundary; \ No newline at end of file diff --git a/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx b/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx index 3844392b..b4370ebc 100644 --- a/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx +++ b/client/app/bundles/comments/components/SimpleHooksCommentScreen/SimpleHooksCommentScreen.jsx @@ -2,22 +2,32 @@ import { React, useState, useEffect } from "react"; import request from "axios"; import Immutable from "immutable"; import _ from "lodash"; +// import ReactOnRails from "react-on-rails"; +// import { IntlProvider, injectIntl } from "react-intl"; +// import BaseComponent from 'libs/components/BaseComponent'; +// import SelectLanguage from "libs/i18n/selectLanguage"; +// import { defaultMessages, defaultLocale } from "libs/i18n/default"; +// import { translations } from "libs/i18n/translations"; + +// import CommentForm from "../CommentBox/CommentForm/CommentForm"; +// import CommentList from "../CommentBox/CommentList/CommentList"; + import ReactOnRails from "react-on-rails"; -import { IntlProvider, injectIntl } from "react-intl"; import BaseComponent from 'libs/components/BaseComponent'; import SelectLanguage from "libs/i18n/selectLanguage"; import { defaultMessages, defaultLocale } from "libs/i18n/default"; import { translations } from "libs/i18n/translations"; -import CommentForm from "../CommentBox/CommentForm/CommentForm"; import CommentList from "../CommentBox/CommentList/CommentList"; import css from "../SimpleCommentScreen/SimpleCommentScreen.scss"; +import ErrorBoundary from "./ErrorBoundary" + function SimpleHooksCommentScreen() { const [comments, setComments] = useState(Immutable.fromJS([])); const [isSaving, setIsSaving] = useState(false); const [fetchCommentsError, setFetchCommentsError] = useState(null); - const [submitCommentError, setSubmitCommentError] = usestate(null); + const [submitCommentError, setSubmitCommentError] = useState(null); useEffect(() => { this.fetchComments(); @@ -88,7 +98,9 @@ function SimpleHooksCommentScreen() { ); } -export default class I18nWrapper extends BaseComponent { +export default SimpleHooksCommentScreen; + +class I18nWrapper extends BaseComponent { constructor(props) { super(props); @@ -104,24 +116,39 @@ export default class I18nWrapper extends BaseComponent { } componentDidCatch(error, info) { + debugger; console.log("xxxxxxxxxxxx") console.log(error, info); console.log("xxxxxxxxxxxx") } render() { + console.log("xxxxxxxxxxxx Render()") + console.log(this.state, this.props); + console.log("xxxxxxxxxxxx") + const { locale } = this.state; const messages = translations[locale]; - const InjectedSimpleHooksCommentScreen = injectIntl(SimpleHooksCommentScreen); + // const InjectedSimpleHooksCommentScreen = injectIntl(SimpleHooksCommentScreen); + + // return ( + // + // + // + // ); return ( - - + - + ); } }