Remplace react-helmet par react-helmet-async

Motivation : https://github.com/nfl/react-helmet/issues/426#issuecomment-690925576
Popularité relative : https://www.npmtrends.com/react-helmet-vs-react-helmet-async
pull/1803/head
Maxime Quandalle 2021-10-26 17:27:48 +02:00
parent 86e8696d50
commit 55fc3a2bc3
24 changed files with 49 additions and 56 deletions

View File

@ -31,7 +31,6 @@
"@types/react": "^17.0.0",
"@types/react-color": "^3.0.1",
"@types/react-dom": "^17.0.9",
"@types/react-helmet": "^6.1.0",
"@types/react-redux": "^7.1.11",
"@types/react-router": "^5.1.2",
"@types/recharts": "^1.8.16",
@ -84,7 +83,7 @@
"react-color": "^2.14.0",
"react-dom": "npm:@hot-loader/react-dom",
"react-easy-emoji": "^1.2.0",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.1.2",
"react-i18next": "^11.0.0",
"react-instantsearch": "^6.11.2",
"react-instantsearch-dom": "^6.11.2",

View File

@ -11,7 +11,7 @@ import {
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import 'iframe-resizer'
import { StrictMode, useContext, useMemo } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
import { Redirect, Route, Switch } from 'react-router-dom'

View File

@ -5,6 +5,7 @@ import { SitePathProvider, SitePaths } from 'Components/utils/SitePathsContext'
import { createBrowserHistory } from 'history'
import i18next from 'i18next'
import React, { createContext, useMemo } from 'react'
import { HelmetProvider } from 'react-helmet-async'
import { I18nextProvider } from 'react-i18next'
import { Provider as ReduxProvider } from 'react-redux'
import { Router } from 'react-router-dom'
@ -161,9 +162,11 @@ export default function Provider({
<SiteNameContext.Provider value={basename}>
<SitePathProvider value={sitePaths}>
<I18nextProvider i18n={i18next}>
<Router history={history}>
<>{children}</>
</Router>
<HelmetProvider>
<Router history={history}>
<>{children}</>
</Router>
</HelmetProvider>
</I18nextProvider>
</SitePathProvider>
</SiteNameContext.Provider>

View File

@ -1,4 +1,4 @@
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
let createQueryParams = (params) =>
Object.keys(params)

View File

@ -4,7 +4,7 @@ import SocialIcon from 'Components/ui/SocialIcon'
import Emoji from 'Components/utils/Emoji'
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import { useContext } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { Link, useLocation } from 'react-router-dom'
import styled from 'styled-components'

View File

@ -1,4 +1,4 @@
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { useTranslation } from 'react-i18next'
import { useLocation } from 'react-router'

View File

@ -5,7 +5,7 @@ import { ScrollToTop } from 'Components/utils/Scroll'
import { formatValue } from 'publicodes'
import { sum, uniq } from 'ramda'
import { useState } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
import { TrackPage } from '../../ATInternetTracking'

View File

@ -9,7 +9,7 @@ import Emoji from 'Components/utils/Emoji'
import Scroll from 'Components/utils/Scroll'
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import { useContext } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { Link, useHistory } from 'react-router-dom'

View File

@ -1,5 +1,5 @@
import SchemeComparaison from 'Components/SchemeComparaison'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { TrackPage } from '../../../ATInternetTracking'

View File

@ -1,5 +1,5 @@
import SchemeComparaison from 'Components/SchemeComparaison'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { TrackPage } from '../../../ATInternetTracking'

View File

@ -2,7 +2,7 @@ import {
directorIsInAMinority,
useDispatchAndGoToNextQuestion,
} from 'Actions/companyStatusActions'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { TrackPage } from '../../../ATInternetTracking'

View File

@ -2,7 +2,7 @@ import {
companyHasMultipleAssociates,
useDispatchAndGoToNextQuestion,
} from 'Actions/companyStatusActions'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { TrackPage } from '../../../ATInternetTracking'

View File

@ -1,7 +1,7 @@
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import { filter } from 'ramda'
import { useContext } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
import { Link } from 'react-router-dom'

View File

@ -2,7 +2,7 @@ import {
isSoleProprietorship,
useDispatchAndGoToNextQuestion,
} from 'Actions/companyStatusActions'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { TrackPage } from '../../../ATInternetTracking'

View File

@ -4,7 +4,7 @@ import {
} from 'Actions/hiringChecklistAction'
import { FromBottom } from 'Components/ui/animate'
import { CheckItem, Checklist, ChecklistProps } from 'Components/ui/Checklist'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { connect, useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'

View File

@ -1,5 +1,5 @@
import { FromBottom } from 'Components/ui/animate'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { TrackPage } from '../../ATInternetTracking'
import Video from './Video'

View File

@ -1,6 +1,6 @@
import { IsEmbeddedContext } from 'Components/utils/embeddedContext'
import { useEffect } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Route, Switch } from 'react-router-dom'
import useSimulatorsData from '../Simulateurs/metadata'
import SimulateurPage from '../Simulateurs/Page'

View File

@ -6,7 +6,7 @@ import Emoji from 'Components/utils/Emoji'
import { HeadingWithAnchorLink } from 'Components/utils/markdown'
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import { useContext } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import { TrackPage } from '../../ATInternetTracking'

View File

@ -3,7 +3,7 @@ import Emoji from 'Components/utils/Emoji'
import { ScrollToTop } from 'Components/utils/Scroll'
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import { useContext } from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
import { Trans, useTranslation } from 'react-i18next'
import { Link, Redirect } from 'react-router-dom'
import { TrackPage } from '../../../ATInternetTracking'

View File

@ -31,7 +31,6 @@
"@types/react": "^17.0.0",
"@types/react-color": "^3.0.1",
"@types/react-dom": "^17.0.0",
"@types/react-helmet": "^5.0.13",
"@types/react-redux": "^7.1.11",
"@types/react-router": "^5.1.2",
"@types/react-router-hash-link": "^1.2.1",

View File

@ -3,6 +3,7 @@
import { createBrowserHistory } from 'history'
import React, { createContext, useMemo } from 'react'
import { HelmetProvider } from 'react-helmet-async'
import { Router } from 'react-router-dom'
import { ThemeColorsProvider } from './colors'
@ -55,9 +56,11 @@ export default function Provider({ basename, children }: ProviderProps) {
return (
<ThemeColorsProvider>
<SiteNameContext.Provider value={basename}>
<Router history={history}>
<>{children}</>
</Router>
<HelmetProvider>
<Router history={history}>
<>{children}</>
</Router>
</HelmetProvider>
</SiteNameContext.Provider>
</ThemeColorsProvider>
)

View File

@ -19,7 +19,7 @@
"classnames": "^2.2.6",
"focus-trap-react": "^3.1.2",
"ramda": "^0.27.0",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.1.2",
"react-markdown": "^4.3.1",
"react-router-hash-link": "^2.4.3",
"styled-components": "^5.1.0",

View File

@ -1,4 +1,4 @@
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet-async'
type PropType = {
title: string

View File

@ -2493,6 +2493,13 @@
dependencies:
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.12.5":
version "7.15.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/template@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278"
@ -3566,20 +3573,6 @@
dependencies:
"@types/react" "*"
"@types/react-helmet@^5.0.13":
version "5.0.16"
resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-5.0.16.tgz#dafac5f043665b880559285a27c71a69abd1f29e"
integrity sha512-++KMqwodVBg75hT2ZT4jobvDPi6iPUl/Lhrn0nP1XTcmFLtccaDb4FTAxzrj3egL7WQYTDnpHuPj52FSFkJqzA==
dependencies:
"@types/react" "*"
"@types/react-helmet@^6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-6.1.0.tgz#af586ed685f4905e2adc7462d1d65ace52beee7a"
integrity sha512-PYRoU1XJFOzQ3BHvWL1T8iDNbRjdMDJMT5hFmZKGbsq09kbSqJy61uwEpTrbTNWDopVphUT34zUSVLK9pjsgYQ==
dependencies:
"@types/react" "*"
"@types/react-instantsearch-core@*":
version "6.10.2"
resolved "https://registry.yarnpkg.com/@types/react-instantsearch-core/-/react-instantsearch-core-6.10.2.tgz#634a887233ce76cc0f37a37f30909fe77a24d73b"
@ -5919,7 +5912,7 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"
classnames@^2.2.5, classnames@^2.2.6:
classnames@^2.2.5:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
@ -13503,20 +13496,21 @@ react-easy-emoji@^1.2.0:
lodash.assign "^4.0.8"
string-replace-to-array "^1.0.1"
react-fast-compare@^3.0.0, react-fast-compare@^3.1.1:
react-fast-compare@^3.0.0, react-fast-compare@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
react-helmet@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
react-helmet-async@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.1.2.tgz#653b7e6bbfdd239c5dcd6b8df2811c7a363b8334"
integrity sha512-LTTzDDkyIleT/JJ6T/uqx7Y8qi1EuPPSiJawQY/nHHz0h7SPDT6HxP1YDDQx/fzcVxCqpWEEMS3QdrSrNkJYhg==
dependencies:
object-assign "^4.1.1"
"@babel/runtime" "^7.12.5"
invariant "^2.2.4"
prop-types "^15.7.2"
react-fast-compare "^3.1.1"
react-side-effect "^2.1.0"
react-fast-compare "^3.2.0"
shallowequal "^1.1.0"
react-hot-loader@^4.12.15:
version "4.12.21"
@ -13707,11 +13701,6 @@ react-shallow-renderer@^16.13.1:
object-assign "^4.1.1"
react-is "^16.12.0 || ^17.0.0"
react-side-effect@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==
react-signature-pad-wrapper@^1.2.11:
version "1.2.11"
resolved "https://registry.yarnpkg.com/react-signature-pad-wrapper/-/react-signature-pad-wrapper-1.2.11.tgz#fb017012611e2e5c09b5210d35d56c1180f19137"