From 2f8c5dd9e35854b2b4a8b4d6e23019a9a2b87440 Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 27 Feb 2019 16:01:58 +0100 Subject: [PATCH] :arrow_up: MAJ de React Helmet La version 5 provoquait des boucles infinies. --- package.json | 2 +- source/components/TypeFormEmbed.js | 2 +- source/components/rule/Rule.js | 2 +- source/sites/mycompanyinfrance.fr/App.js | 2 +- .../layout/Footer/Footer.js | 11 ++++++----- .../pages/Company/AutoEntrepreneur.js | 2 +- .../pages/Company/CreationChecklist.js | 2 +- .../pages/Company/DirectorStatus.js | 2 +- .../mycompanyinfrance.fr/pages/Company/Find.js | 2 +- .../mycompanyinfrance.fr/pages/Company/Home.js | 2 +- .../pages/Company/MinorityDirector.js | 2 +- .../pages/Company/NumberOfAssociate.js | 2 +- .../pages/Company/PickLegalStatus.js | 2 +- .../pages/Company/SoleProprietorship.js | 2 +- .../pages/HiringProcess.js | 2 +- .../pages/SocialSecurity/Home.js | 2 +- yarn.lock | 18 ++++++++++-------- 17 files changed, 31 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index a76307262..7e4143606 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "react-color": "^2.14.0", "react-dom": "^16.8.0", "react-easy-emoji": "^1.2.0", - "react-helmet": "^5.2.0", + "react-helmet": "6.0.0-beta", "react-highlight-words": "^0.11.0", "react-i18next": "^10.0.1", "react-redux": "^5.0.7", diff --git a/source/components/TypeFormEmbed.js b/source/components/TypeFormEmbed.js index e446f4954..ae520b893 100644 --- a/source/components/TypeFormEmbed.js +++ b/source/components/TypeFormEmbed.js @@ -1,5 +1,5 @@ import React from 'react' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' let createQueryParams = params => Object.keys(params) diff --git a/source/components/rule/Rule.js b/source/components/rule/Rule.js index 66dcb3e9b..00d12cb83 100644 --- a/source/components/rule/Rule.js +++ b/source/components/rule/Rule.js @@ -13,7 +13,7 @@ import { import { compose, isEmpty, isNil } from 'ramda' import React, { Component, Suspense } from 'react' import emoji from 'react-easy-emoji' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { Trans, withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { Link } from 'react-router-dom' diff --git a/source/sites/mycompanyinfrance.fr/App.js b/source/sites/mycompanyinfrance.fr/App.js index a10d77523..879d51b2f 100644 --- a/source/sites/mycompanyinfrance.fr/App.js +++ b/source/sites/mycompanyinfrance.fr/App.js @@ -6,7 +6,7 @@ import { compose } from 'ramda' import createRavenMiddleware from 'raven-for-redux' import Raven from 'raven-js' import React, { Component } from 'react' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { Route, Switch } from 'react-router-dom' import 'Ui/index.css' diff --git a/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js b/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js index 5e7f274d8..7742c284d 100644 --- a/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js +++ b/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js @@ -10,7 +10,7 @@ import urssafSvg from 'Images/urssaf.svg' import { compose, lensPath, view } from 'ramda' import React, { useState } from 'react' import emoji from 'react-easy-emoji' -import Helmet from 'react-helmet' +import { Helmet } from 'react-helmet' import { withTranslation } from 'react-i18next' import SocialIcon from 'Ui/SocialIcon' import i18n from '../../../../i18n' @@ -32,13 +32,14 @@ const feedbackBlacklist = [ const LOCAL_STORAGE_KEY = 'app::newsletter::registered' const userAlreadyRegistered: boolean = - JSON.parse(safeLocalStorage.getItem(LOCAL_STORAGE_KEY)) || false + JSON.parse(safeLocalStorage.getItem(LOCAL_STORAGE_KEY)) || false const Footer = ({ colours: { colour }, tracker, t, sitePaths }) => { const [showNewsletterForm, toggleNewsletterForm] = useState( - !userAlreadyRegistered && !['mycompanyinfrance.fr', 'mon-entreprise.fr'].includes( - window.location.hostname - ) + !userAlreadyRegistered && + !['mycompanyinfrance.fr', 'mon-entreprise.fr'].includes( + window.location.hostname + ) ) const onSubmit = () => { safeLocalStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(true)) diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/AutoEntrepreneur.js b/source/sites/mycompanyinfrance.fr/pages/Company/AutoEntrepreneur.js index c8a3ad590..5f0d44032 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/AutoEntrepreneur.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/AutoEntrepreneur.js @@ -2,7 +2,7 @@ import { isAutoentrepreneur } from 'Actions/companyStatusActions' import { React, T } from 'Components' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import CompanyStatusNavigation from './CompanyStatusNavigation' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js b/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js index f82f6ceed..3cdafe031 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js @@ -8,7 +8,7 @@ import { React, T } from 'Components' import Scroll from 'Components/utils/Scroll' import withSitePaths from 'Components/utils/withSitePaths' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { Link } from 'react-router-dom' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js b/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js index cb1a48d5d..245ac2d45 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js @@ -3,7 +3,7 @@ import { defineDirectorStatus } from 'Actions/companyStatusActions' import { React, T } from 'Components' import withSitePaths from 'Components/utils/withSitePaths' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { Link } from 'react-router-dom' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/Find.js b/source/sites/mycompanyinfrance.fr/pages/Company/Find.js index 9245e845f..9510f49f5 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/Find.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/Find.js @@ -3,7 +3,7 @@ import { saveExistingCompanyDetails } from 'Actions/existingCompanyActions' import { React, T } from 'Components' import withSitePaths from 'Components/utils/withSitePaths' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { withRouter } from 'react-router' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/Home.js b/source/sites/mycompanyinfrance.fr/pages/Company/Home.js index 8c253c247..8f23b245e 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/Home.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/Home.js @@ -4,7 +4,7 @@ import { T } from 'Components' import withSitePaths from 'Components/utils/withSitePaths' import { compose, toPairs } from 'ramda' import React, { useEffect } from 'react' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { Link, Redirect } from 'react-router-dom' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/MinorityDirector.js b/source/sites/mycompanyinfrance.fr/pages/Company/MinorityDirector.js index 278113edf..6c1122bb9 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/MinorityDirector.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/MinorityDirector.js @@ -2,7 +2,7 @@ import { directorIsInAMinority } from 'Actions/companyStatusActions' import { React, T } from 'Components' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import CompanyStatusNavigation from './CompanyStatusNavigation' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js b/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js index 2b49c50d9..e06fa3d49 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js @@ -3,7 +3,7 @@ import { companyHasMultipleAssociates } from 'Actions/companyStatusActions' import { React, T } from 'Components' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import CompanyStatusNavigation from './CompanyStatusNavigation' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js b/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js index defacaa0e..295a3174d 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js @@ -4,7 +4,7 @@ import { React, T } from 'Components' import withLanguage from 'Components/utils/withLanguage' import withSitePaths from 'Components/utils/withSitePaths' import { compose, filter } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { Link } from 'react-router-dom' diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/SoleProprietorship.js b/source/sites/mycompanyinfrance.fr/pages/Company/SoleProprietorship.js index 7ea014c09..734f56644 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/SoleProprietorship.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/SoleProprietorship.js @@ -2,7 +2,7 @@ import { isSoleProprietorship } from 'Actions/companyStatusActions' import { React, T } from 'Components' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import CompanyStatusNavigation from './CompanyStatusNavigation' diff --git a/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js b/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js index 24a7ef4dd..1d9f0b1a1 100644 --- a/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js +++ b/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js @@ -6,7 +6,7 @@ import { import { React, T } from 'Components' import withSitePaths from 'Components/utils/withSitePaths' import { compose } from 'ramda' -import Helmet from 'react-helmet' +import {Helmet} from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { Link } from 'react-router-dom' diff --git a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js index dc05a334e..bef443a2e 100644 --- a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js +++ b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js @@ -6,7 +6,7 @@ import withLanguage from 'Components/utils/withLanguage'; import withSitePaths from 'Components/utils/withSitePaths'; import { compose } from 'ramda'; import emoji from 'react-easy-emoji'; -import Helmet from 'react-helmet'; +import {Helmet} from 'react-helmet'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; diff --git a/yarn.lock b/yarn.lock index a87197dec..4fea33d2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2965,10 +2965,6 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" -deep-equal@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -7604,13 +7600,19 @@ react-easy-emoji@^1.2.0: lodash.assign "^4.0.8" string-replace-to-array "^1.0.1" -react-helmet@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-5.2.0.tgz#a81811df21313a6d55c5f058c4aeba5d6f3d97a7" +react-fast-compare@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" + integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== + +react-helmet@6.0.0-beta: + version "6.0.0-beta" + resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.0.0-beta.tgz#1f2ac04521951486e4fce3296d0c88aae8cabd5c" + integrity sha512-GnNWsokebTe7fe8MH2I/a2dl4THYWhthLBoMaQSRYqW5XbPo881WAJGi+lqRBjyOFryW6zpQluEkBy70zh+h9w== dependencies: - deep-equal "^1.0.1" object-assign "^4.1.1" prop-types "^15.5.4" + react-fast-compare "^2.0.2" react-side-effect "^1.1.0" react-highlight-words@^0.11.0: