pl-fe: Update formatjs, replace polyfill with one from formatjs

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-27 23:17:25 +02:00
parent 9e972c5c22
commit 3460fe2c8d
4 changed files with 56 additions and 120 deletions

View file

@ -29,7 +29,6 @@
"lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass", "lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass",
"lint:js": "npx eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache", "lint:js": "npx eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache",
"lint:sass": "npx stylelint src/styles/**/*.scss", "lint:sass": "npx stylelint src/styles/**/*.scss",
"prepare": "husky install",
"precommit": "npx lint-staged" "precommit": "npx lint-staged"
}, },
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
@ -45,6 +44,7 @@
"@fontsource/noto-sans-javanese": "^5.0.16", "@fontsource/noto-sans-javanese": "^5.0.16",
"@fontsource/roboto-mono": "^5.0.0", "@fontsource/roboto-mono": "^5.0.0",
"@fontsource/tajawal": "^5.0.8", "@fontsource/tajawal": "^5.0.8",
"@formatjs/intl-pluralrules": "^5.2.14",
"@lexical/clipboard": "^0.18.0", "@lexical/clipboard": "^0.18.0",
"@lexical/code": "^0.18.0", "@lexical/code": "^0.18.0",
"@lexical/hashtag": "^0.18.0", "@lexical/hashtag": "^0.18.0",
@ -94,8 +94,7 @@
"immer": "^10.1.1", "immer": "^10.1.1",
"immutable": "^4.3.7", "immutable": "^4.3.7",
"intersection-observer": "^0.12.2", "intersection-observer": "^0.12.2",
"intl-messageformat": "10.5.11", "intl-messageformat": "^10.5.14",
"intl-pluralrules": "^2.0.0",
"isomorphic-dompurify": "^2.3.0", "isomorphic-dompurify": "^2.3.0",
"leaflet": "^1.8.0", "leaflet": "^1.8.0",
"lexical": "^0.18.0", "lexical": "^0.18.0",
@ -120,7 +119,7 @@
"react-hot-toast": "^2.4.0", "react-hot-toast": "^2.4.0",
"react-immutable-pure-component": "^2.2.2", "react-immutable-pure-component": "^2.2.2",
"react-inlinesvg": "^4.0.0", "react-inlinesvg": "^4.0.0",
"react-intl": "^6.0.0", "react-intl": "^6.7.0",
"react-motion": "^0.5.2", "react-motion": "^0.5.2",
"react-redux": "^9.0.4", "react-redux": "^9.0.4",
"react-router-dom": "^5.3.4", "react-router-dom": "^5.3.4",
@ -155,7 +154,7 @@
"zustand": "^5.0.0-rc.2" "zustand": "^5.0.0-rc.2"
}, },
"devDependencies": { "devDependencies": {
"@formatjs/cli": "^6.2.0", "@formatjs/cli": "^6.2.12",
"@gitbeaker/node": "^35.8.0", "@gitbeaker/node": "^35.8.0",
"@jedmao/redux-mock-store": "^3.0.5", "@jedmao/redux-mock-store": "^3.0.5",
"@stylistic/eslint-plugin": "^2.8.0", "@stylistic/eslint-plugin": "^2.8.0",

View file

@ -1,5 +1,5 @@
import '@formatjs/intl-pluralrules';
import IntlMessageFormat from 'intl-messageformat'; import IntlMessageFormat from 'intl-messageformat';
import 'intl-pluralrules';
import { defineMessages } from 'react-intl'; import { defineMessages } from 'react-intl';
import { getClient } from 'pl-fe/api'; import { getClient } from 'pl-fe/api';

View file

@ -1,6 +1,6 @@
/// <reference lib="webworker" /> /// <reference lib="webworker" />
import '@formatjs/intl-pluralrules';
import IntlMessageFormat from 'intl-messageformat'; import IntlMessageFormat from 'intl-messageformat';
import 'intl-pluralrules';
import unescape from 'lodash/unescape'; import unescape from 'lodash/unescape';
import type { import type {

View file

@ -1488,26 +1488,10 @@
resolved "https://registry.yarnpkg.com/@fontsource/tajawal/-/tajawal-5.0.8.tgz#cd8a593ec5062b283b093b56ee5d38b6b97fa93d" resolved "https://registry.yarnpkg.com/@fontsource/tajawal/-/tajawal-5.0.8.tgz#cd8a593ec5062b283b093b56ee5d38b6b97fa93d"
integrity sha512-KILlXB6B8YYcssz3pccPs/4s1XcXwTWogCtE4Ag3oTpK+81DIQLc2b9o77UiBP4yC17MmqeOp1lvoaJQP80RoA== integrity sha512-KILlXB6B8YYcssz3pccPs/4s1XcXwTWogCtE4Ag3oTpK+81DIQLc2b9o77UiBP4yC17MmqeOp1lvoaJQP80RoA==
"@formatjs/cli@^6.2.0": "@formatjs/cli@^6.2.12":
version "6.2.0" version "6.2.12"
resolved "https://registry.yarnpkg.com/@formatjs/cli/-/cli-6.2.0.tgz#17fbd40753eeb1f6e79c3caf25845c3a9c044d90" resolved "https://registry.yarnpkg.com/@formatjs/cli/-/cli-6.2.12.tgz#5295e4f6351ed563bcd49fb6479905165098bcd4"
integrity sha512-sP04UpocRHYwSovUnunAZHYvCTVbNcaLtWKnr1lETGRUnRRQqnXy/3d2Ce271ELXmNUSde2eHRdu4rv2XaVaiQ== integrity sha512-bt1NEgkeYN8N9zWcpsPu3fZ57vv+biA+NtIQBlyOZnCp1bcvh+vNTXvmwF4C5qxqDtCylpOIb3yi3Ktgp4v0JQ==
"@formatjs/ecma402-abstract@1.17.2":
version "1.17.2"
resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.17.2.tgz#d197c6e26b9fd96ff7ba3b3a0cc2f25f1f2dcac3"
integrity sha512-k2mTh0m+IV1HRdU0xXM617tSQTi53tVR2muvYOsBeYcUgEAyxV1FOC7Qj279th3fBVQ+Dj6muvNJZcHSPNdbKg==
dependencies:
"@formatjs/intl-localematcher" "0.4.2"
tslib "^2.4.0"
"@formatjs/ecma402-abstract@1.18.2":
version "1.18.2"
resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.18.2.tgz#bf103712a406874eb1e387858d5be2371ab3aa14"
integrity sha512-+QoPW4csYALsQIl8GbN14igZzDbuwzcpWrku9nyMXlaqAlwRBgl5V+p0vWMGFqHOw37czNXaP/lEk4wbLgcmtA==
dependencies:
"@formatjs/intl-localematcher" "0.5.4"
tslib "^2.4.0"
"@formatjs/ecma402-abstract@2.0.0": "@formatjs/ecma402-abstract@2.0.0":
version "2.0.0" version "2.0.0"
@ -1524,24 +1508,6 @@
dependencies: dependencies:
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/icu-messageformat-parser@2.6.2":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.6.2.tgz#9bbb29099416e4ce2c7df50029c48985d4f901b3"
integrity sha512-nF/Iww7sc5h+1MBCDRm68qpHTCG4xvGzYs/x9HFcDETSGScaJ1Fcadk5U/NXjXeCtzD+DhN4BAwKFVclHfKMdA==
dependencies:
"@formatjs/ecma402-abstract" "1.17.2"
"@formatjs/icu-skeleton-parser" "1.6.2"
tslib "^2.4.0"
"@formatjs/icu-messageformat-parser@2.7.6":
version "2.7.6"
resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.7.6.tgz#3d69806de056d2919d53dad895a5ff4851e4e9ff"
integrity sha512-etVau26po9+eewJKYoiBKP6743I1br0/Ie00Pb/S/PtmYfmjTcOn2YCh2yNkSZI12h6Rg+BOgQYborXk46BvkA==
dependencies:
"@formatjs/ecma402-abstract" "1.18.2"
"@formatjs/icu-skeleton-parser" "1.8.0"
tslib "^2.4.0"
"@formatjs/icu-messageformat-parser@2.7.8": "@formatjs/icu-messageformat-parser@2.7.8":
version "2.7.8" version "2.7.8"
resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.7.8.tgz#f6d7643001e9bb5930d812f1f9a9856f30fa0343" resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.7.8.tgz#f6d7643001e9bb5930d812f1f9a9856f30fa0343"
@ -1551,22 +1517,6 @@
"@formatjs/icu-skeleton-parser" "1.8.2" "@formatjs/icu-skeleton-parser" "1.8.2"
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/icu-skeleton-parser@1.6.2":
version "1.6.2"
resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.6.2.tgz#00303034dc08583973c8aa67b96534c49c0bad8d"
integrity sha512-VtB9Slo4ZL6QgtDFJ8Injvscf0xiDd4bIV93SOJTBjUF4xe2nAWOoSjLEtqIG+hlIs1sNrVKAaFo3nuTI4r5ZA==
dependencies:
"@formatjs/ecma402-abstract" "1.17.2"
tslib "^2.4.0"
"@formatjs/icu-skeleton-parser@1.8.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.0.tgz#5f3d3a620c687d6f8c180d80d1241e8f213acf79"
integrity sha512-QWLAYvM0n8hv7Nq5BEs4LKIjevpVpbGLAJgOaYzg9wABEoX1j0JO1q2/jVkO6CVlq0dbsxZCngS5aXbysYueqA==
dependencies:
"@formatjs/ecma402-abstract" "1.18.2"
tslib "^2.4.0"
"@formatjs/icu-skeleton-parser@1.8.2": "@formatjs/icu-skeleton-parser@1.8.2":
version "1.8.2" version "1.8.2"
resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.2.tgz#2252c949ae84ee66930e726130ea66731a123c9f" resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.2.tgz#2252c949ae84ee66930e726130ea66731a123c9f"
@ -1575,29 +1525,22 @@
"@formatjs/ecma402-abstract" "2.0.0" "@formatjs/ecma402-abstract" "2.0.0"
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/intl-displaynames@6.5.2": "@formatjs/intl-displaynames@6.6.8":
version "6.5.2" version "6.6.8"
resolved "https://registry.yarnpkg.com/@formatjs/intl-displaynames/-/intl-displaynames-6.5.2.tgz#b14ffd0962d5b5cfd71457efc389f0bca83a00db" resolved "https://registry.yarnpkg.com/@formatjs/intl-displaynames/-/intl-displaynames-6.6.8.tgz#2f5afac8df83167f5a6ef8543600eaf1ef99c885"
integrity sha512-uC2VBlz+WydGTDDpJwMTQuPH3CUpTricr91WH1QMfz5oEHg2sB7mUERcZONE/lu8MOe1jREIx4vBciZEVTqkmA== integrity sha512-Lgx6n5KxN16B3Pb05z3NLEBQkGoXnGjkTBNCZI+Cn17YjHJ3fhCeEJJUqRlIZmJdmaXQhjcQVDp6WIiNeRYT5g==
dependencies: dependencies:
"@formatjs/ecma402-abstract" "1.17.2" "@formatjs/ecma402-abstract" "2.0.0"
"@formatjs/intl-localematcher" "0.4.2" "@formatjs/intl-localematcher" "0.5.4"
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/intl-listformat@7.4.2": "@formatjs/intl-listformat@7.5.7":
version "7.4.2" version "7.5.7"
resolved "https://registry.yarnpkg.com/@formatjs/intl-listformat/-/intl-listformat-7.4.2.tgz#c8d86d3b15eead41f74748d1c79d6450fd1bad82" resolved "https://registry.yarnpkg.com/@formatjs/intl-listformat/-/intl-listformat-7.5.7.tgz#125e05105fabd1ae5f11881d6ab74484f2098ee4"
integrity sha512-+6bSVudEQkf12Hh7kuKt8Xv/MyFlqdwA4V4NLnTZW8uYdF9RxlOELDD0rPaOc2++TMKIzI5o6XXwHPvpL6VrPA== integrity sha512-MG2TSChQJQT9f7Rlv+eXwUFiG24mKSzmF144PLb8m8OixyXqn4+YWU+5wZracZGCgVTVmx8viCf7IH3QXoiB2g==
dependencies:
"@formatjs/ecma402-abstract" "1.17.2"
"@formatjs/intl-localematcher" "0.4.2"
tslib "^2.4.0"
"@formatjs/intl-localematcher@0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@formatjs/intl-localematcher/-/intl-localematcher-0.4.2.tgz#7e6e596dbaf2f0c5a7c22da5a01d5c55f4c37e9a"
integrity sha512-BGdtJFmaNJy5An/Zan4OId/yR9Ih1OojFjcduX/xOvq798OgWSyDtd6Qd5jqJXwJs1ipe4Fxu9+cshic5Ox2tA==
dependencies: dependencies:
"@formatjs/ecma402-abstract" "2.0.0"
"@formatjs/intl-localematcher" "0.5.4"
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/intl-localematcher@0.5.4": "@formatjs/intl-localematcher@0.5.4":
@ -1607,17 +1550,26 @@
dependencies: dependencies:
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/intl@2.9.3": "@formatjs/intl-pluralrules@^5.2.14":
version "2.9.3" version "5.2.14"
resolved "https://registry.yarnpkg.com/@formatjs/intl/-/intl-2.9.3.tgz#e570c4b1afb173dfb1f80a42624425dde9841329" resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-5.2.14.tgz#7477bd2aa9bfde9e543d839707eff5460eb08026"
integrity sha512-hclPdyCF1zk2XmhgdXfl5Sd30QEdRBnIijH7Vc1AWz2K0/saVRrxuL3UYn+m3xEyfOa4yDbTWVbmXDL0XEzlsQ== integrity sha512-l6Ev7aOGXJSh5EPDEqzsbyufdCCKXZk993QXRQebLsB0TXRhIyF4alqjdMEatLwIigK/Mka8kiVIOLeFP5Cj9Q==
dependencies: dependencies:
"@formatjs/ecma402-abstract" "1.17.2" "@formatjs/ecma402-abstract" "2.0.0"
"@formatjs/intl-localematcher" "0.5.4"
tslib "^2.4.0"
"@formatjs/intl@2.10.5":
version "2.10.5"
resolved "https://registry.yarnpkg.com/@formatjs/intl/-/intl-2.10.5.tgz#1a83960fc1871f476385e006f2fee23cc439f416"
integrity sha512-f9qPNNgLrh2KvoFvHGIfcPTmNGbyy7lyyV4/P6JioDqtTE7Akdmgt+ZzVndr+yMLZnssUShyTMXxM/6aV9eVuQ==
dependencies:
"@formatjs/ecma402-abstract" "2.0.0"
"@formatjs/fast-memoize" "2.2.0" "@formatjs/fast-memoize" "2.2.0"
"@formatjs/icu-messageformat-parser" "2.6.2" "@formatjs/icu-messageformat-parser" "2.7.8"
"@formatjs/intl-displaynames" "6.5.2" "@formatjs/intl-displaynames" "6.6.8"
"@formatjs/intl-listformat" "7.4.2" "@formatjs/intl-listformat" "7.5.7"
intl-messageformat "10.5.3" intl-messageformat "10.5.14"
tslib "^2.4.0" tslib "^2.4.0"
"@formatjs/ts-transformer@3.13.14": "@formatjs/ts-transformer@3.13.14":
@ -7172,31 +7124,16 @@ intersection-observer@^0.12.2:
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375" resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375"
integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg== integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==
intl-messageformat@10.5.11: intl-messageformat@10.5.14, intl-messageformat@^10.5.14:
version "10.5.11" version "10.5.14"
resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-10.5.11.tgz#95d6a3b0b303f924d5d8c3f8d3ad057d1dc73c64" resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-10.5.14.tgz#e5bb373f8a37b88fbe647d7b941f3ab2a37ed00a"
integrity sha512-eYq5fkFBVxc7GIFDzpFQkDOZgNayNTQn4Oufe8jw6YY6OHVw70/4pA3FyCsQ0Gb2DnvEJEMmN2tOaXUGByM+kg== integrity sha512-IjC6sI0X7YRjjyVH9aUgdftcmZK7WXdHeil4KwbjDnRWjnVitKpAx3rr6t6di1joFp5188VqKcobOPA6mCLG/w==
dependencies: dependencies:
"@formatjs/ecma402-abstract" "1.18.2" "@formatjs/ecma402-abstract" "2.0.0"
"@formatjs/fast-memoize" "2.2.0" "@formatjs/fast-memoize" "2.2.0"
"@formatjs/icu-messageformat-parser" "2.7.6" "@formatjs/icu-messageformat-parser" "2.7.8"
tslib "^2.4.0" tslib "^2.4.0"
intl-messageformat@10.5.3:
version "10.5.3"
resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-10.5.3.tgz#db0779d4a1988faa2977d76574489b7a25f0d5d0"
integrity sha512-TzKn1uhJBMyuKTO4zUX47SU+d66fu1W9tVzIiZrQ6hBqQQeYscBMIzKL/qEXnFbJrH9uU5VV3+T5fWib4SIcKA==
dependencies:
"@formatjs/ecma402-abstract" "1.17.2"
"@formatjs/fast-memoize" "2.2.0"
"@formatjs/icu-messageformat-parser" "2.6.2"
tslib "^2.4.0"
intl-pluralrules@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/intl-pluralrules/-/intl-pluralrules-2.0.1.tgz#de16c3df1e09437635829725e88ea70c9ad79569"
integrity sha512-astxTLzIdXPeN0K9Rumi6LfMpm3rvNO0iJE+h/k8Kr/is+wPbRe4ikyDjlLr6VTh/mEfNv8RjN+gu3KwDiuhqg==
invariant@^2.2.4: invariant@^2.2.4:
version "2.2.4" version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
@ -9719,20 +9656,20 @@ react-inlinesvg@^4.0.0:
dependencies: dependencies:
react-from-dom "^0.6.2" react-from-dom "^0.6.2"
react-intl@^6.0.0: react-intl@^6.7.0:
version "6.4.7" version "6.7.0"
resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-6.4.7.tgz#28ec40350ff791a6a773f5e76b9e12835ae17e19" resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-6.7.0.tgz#e84c20424017004f99e1af4e2cbc098f1eaace2e"
integrity sha512-0hnOHAZhxTFqD1hGTxrF40qNyZJPPYiGhWIIxIz0Udz+3e3c7sdN80qlxArR+AbJ+jb5ALXZkJYH20+GPFCM0Q== integrity sha512-f5QhjuKb+WEqiAbL5hDqUs2+sSRkF0vxkTbJ4A8ompt55XTyOHcrDlCXGq4o73ywFFrpgz+78C9IXegSLlya2A==
dependencies: dependencies:
"@formatjs/ecma402-abstract" "1.17.2" "@formatjs/ecma402-abstract" "2.0.0"
"@formatjs/icu-messageformat-parser" "2.6.2" "@formatjs/icu-messageformat-parser" "2.7.8"
"@formatjs/intl" "2.9.3" "@formatjs/intl" "2.10.5"
"@formatjs/intl-displaynames" "6.5.2" "@formatjs/intl-displaynames" "6.6.8"
"@formatjs/intl-listformat" "7.4.2" "@formatjs/intl-listformat" "7.5.7"
"@types/hoist-non-react-statics" "^3.3.1" "@types/hoist-non-react-statics" "^3.3.1"
"@types/react" "16 || 17 || 18" "@types/react" "16 || 17 || 18"
hoist-non-react-statics "^3.3.2" hoist-non-react-statics "^3.3.2"
intl-messageformat "10.5.3" intl-messageformat "10.5.14"
tslib "^2.4.0" tslib "^2.4.0"
react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: