perf(i18n): bundle default locale with main chunk (#2405)
* fix(i18n): do not defer render on locale Do not defer render on locale load. This delays the initial render of the page, effectively delaying to LCP. Lingui allows the page to render with no text while a locale is loading. A fallback locale is only used when loading a locale fails - not while it is pending. * perf(i18n): include default language in initial bundle
Showing
... | @@ -12,7 +12,6 @@ | ... | @@ -12,7 +12,6 @@ |
"@graphql-codegen/typescript-operations": "^1.18.2", | "@graphql-codegen/typescript-operations": "^1.18.2", | ||
"@graphql-codegen/typescript-rtk-query": "^1.1.1", | "@graphql-codegen/typescript-rtk-query": "^1.1.1", | ||
"@lingui/cli": "^3.9.0", | "@lingui/cli": "^3.9.0", | ||
"@lingui/loader": "^3.9.0", | |||
"@lingui/macro": "^3.9.0", | "@lingui/macro": "^3.9.0", | ||
"@lingui/react": "^3.9.0", | "@lingui/react": "^3.9.0", | ||
"@popperjs/core": "^2.4.4", | "@popperjs/core": "^2.4.4", | ||
... | @@ -131,15 +130,16 @@ | ... | @@ -131,15 +130,16 @@ |
"compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-contract-types", | "compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-contract-types", | ||
"compile-external-abi-types": "typechain --target ethers-v5 --out-dir src/abis/types './src/abis/**/*.json'", | "compile-external-abi-types": "typechain --target ethers-v5 --out-dir src/abis/types './src/abis/**/*.json'", | ||
"compile-v3-contract-types": "typechain --target ethers-v5 --out-dir src/types/v3 './node_modules/@uniswap/?(v3-core|v3-periphery)/artifacts/contracts/**/*.json'", | "compile-v3-contract-types": "typechain --target ethers-v5 --out-dir src/types/v3 './node_modules/@uniswap/?(v3-core|v3-periphery)/artifacts/contracts/**/*.json'", | ||
"build": "yarn compile-contract-types && yarn graphql:generate && yarn i18n:extract && react-scripts build", | "build": "yarn compile-contract-types && yarn graphql:generate && yarn i18n:extract && yarn i18n:compile && react-scripts build", | ||
"i18n:extract": "lingui extract --locale en-US", | "i18n:extract": "lingui extract --locale en-US", | ||
"i18n:compile": "lingui compile", | |||
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run --record'", | "integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run --record'", | ||
"graphql:generate": "graphql-codegen --config codegen.yml", | "graphql:generate": "graphql-codegen --config codegen.yml", | ||
"postinstall": "yarn compile-contract-types", | "postinstall": "yarn compile-contract-types", | ||
"start": "yarn compile-contract-types && react-scripts start", | "start": "yarn compile-contract-types && react-scripts start", | ||
"test": "react-scripts test --env=./custom-test-env.js", | "test": "react-scripts test --env=./custom-test-env.js", | ||
"prei18n:extract": "touch src/locales/en-US.po", | "prei18n:extract": "touch src/locales/en-US.po", | ||
"prestart": "yarn graphql:generate && yarn prei18n:extract" | "prestart": "yarn graphql:generate && yarn prei18n:extract && yarn i18n:compile" | ||
}, | }, | ||
"eslintConfig": { | "eslintConfig": { | ||
"extends": "react-app", | "extends": "react-app", | ||
... | ... |
Please register or sign in to comment