Skip to content

Commit f05be1a

Browse files
author
Alex Fedoseev
authored
Merge pull request #22 from alexfedoseev/react-intl-3.0.0b8
Adaptations for react-intl 3.0.0b8
2 parents 027ee58 + cf0db5f commit f05be1a

File tree

4 files changed

+49
-57
lines changed

4 files changed

+49
-57
lines changed

examples/index.re

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
[@bs.module "react-intl/locale-data/en"]
2-
external en: ReactIntl.localeData('t) = "default";
3-
[@bs.module "react-intl/locale-data/ru"]
4-
external ru: ReactIntl.localeData('t) = "default";
5-
6-
ReactIntl.addLocaleData(en);
7-
ReactIntl.addLocaleData(ru);
8-
9-
ReactDOMRe.renderToElementWithId(<App />, "app");
1+
ReactDOMRe.renderToElementWithId(<App />, "app");

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"peerDependencies": {
2020
"bs-platform": "^5.0.3",
21-
"react-intl": "^2.7.1",
21+
"react-intl": "3.0.0-beta-8",
2222
"reason-react": "^0.7.0"
2323
},
2424
"devDependencies": {
@@ -29,7 +29,7 @@
2929
"prop-types": "15.7.2",
3030
"react": "16.8.6",
3131
"react-dom": "16.8.6",
32-
"react-intl": "3.0.0-beta-1",
32+
"react-intl": "3.0.0-beta-8",
3333
"reason-react": "0.7.0"
3434
},
3535
"repository": {

src/ReactIntl.re

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
type localeData('t) = {.. "locale": string} as 't;
2-
3-
[@bs.module "react-intl"] external addLocaleData: localeData('t) => unit = "";
4-
51
type dateTimeFormatOptions;
62

73
[@bs.obj]
@@ -134,10 +130,7 @@ module Intl = {
134130
[@bs.val] [@bs.module "react-intl"]
135131
external context: React.Context.t(Intl.t) = "IntlContext";
136132

137-
// Not in react-intl yet
138-
// [@bs.module "react-intl"] external useIntl: unit => intl = "";
139-
140-
let useIntl = () => context->React.useContext; // not zero-cost but will be when react-intl will add it
133+
[@bs.module "react-intl"] external useIntl: unit => Intl.t = "";
141134

142135
type textComponent;
143136

yarn.lock

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,10 +2560,12 @@ hmac-drbg@^1.0.0:
25602560
minimalistic-assert "^1.0.0"
25612561
minimalistic-crypto-utils "^1.0.1"
25622562

2563-
hoist-non-react-statics@^2.5.5:
2564-
version "2.5.5"
2565-
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
2566-
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==
2563+
hoist-non-react-statics@^3.3.0:
2564+
version "3.3.0"
2565+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b"
2566+
integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==
2567+
dependencies:
2568+
react-is "^16.7.0"
25672569

25682570
hsl-regex@^1.0.0:
25692571
version "1.0.0"
@@ -2699,29 +2701,32 @@ ini@^1.3.4, ini@~1.3.0:
26992701
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
27002702
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
27012703

2702-
intl-format-cache@^2.0.5:
2703-
version "2.1.0"
2704-
resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316"
2705-
integrity sha1-BKNp/sv61tpgBbrh8UMzMy3PkxY=
2704+
intl-format-cache@^3.0.0:
2705+
version "3.0.2"
2706+
resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-3.0.2.tgz#d83f5d659e2eb00d8d575fe104d30e5c2affad2d"
2707+
integrity sha512-/cRGShV1FaYpD4pO/mCf3r+00iasUbkV0qp5ai0TZ0FHpZxAigi3CCkLc9me4Smd8/XpjDT2pLY/5iRmnN7r0g==
27062708

2707-
intl-messageformat-parser@1.4.0:
2708-
version "1.4.0"
2709-
resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075"
2710-
integrity sha1-tD1FqXRoytvkQzHXS7Ho3qRPwHU=
2709+
intl-locales-supported@^1.0.10:
2710+
version "1.1.0"
2711+
resolved "https://registry.yarnpkg.com/intl-locales-supported/-/intl-locales-supported-1.1.0.tgz#6f04e86464b527a84850b7f554ac2a0246d55ded"
2712+
integrity sha512-EDOpb+LUqTBdOsB24NtW/Tostabhh2JMHDcL4hClXHr4IPqGQL9oTYzmNQWOHwIa7ZjsZSYHSiHXS0iHUwfh2A==
27112713

2712-
intl-messageformat@^2.0.0, intl-messageformat@^2.1.0:
2713-
version "2.2.0"
2714-
resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc"
2715-
integrity sha1-NFvNRt5jC3aDMwwuUhd/9eq0hPw=
2716-
dependencies:
2717-
intl-messageformat-parser "1.4.0"
2714+
intl-messageformat-parser@^1.6.6:
2715+
version "1.6.6"
2716+
resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.6.6.tgz#ac803a94f2b94ef575287038ee8ccc2fc876a255"
2717+
integrity sha512-MfBWPyCUIrRM1rB6rVdvkv8LxOxo17sLF/XVyOKV0MypU1WL3NuDVC5Ng27Q9zUsikU9vJCzqCEzI8ZEccUsmA==
27182718

2719-
intl-relativeformat@^2.1.0:
2720-
version "2.1.0"
2721-
resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#010f1105802251f40ac47d0e3e1a201348a255df"
2722-
integrity sha1-AQ8RBYAiUfQKxH0OPhogE0iiVd8=
2719+
intl-messageformat@^4.0.0:
2720+
version "4.0.1"
2721+
resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-4.0.1.tgz#8641034548ed06716c0a0ee6183a426bd7d31992"
2722+
integrity sha512-xWPjRs3oyaSGp8dCzx1VAn/C4Fqy59eEvJq7m3RrEn6mzJ32/cR+jVLBlEWMNC31GSmkbtXfFMLYeMAXiV0oUg==
27232723
dependencies:
2724-
intl-messageformat "^2.0.0"
2724+
intl-messageformat-parser "^1.6.6"
2725+
2726+
intl-relativeformat@^6.1.0:
2727+
version "6.1.1"
2728+
resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-6.1.1.tgz#ed60fcd7460469b45c4588ece7b61e1c697c401d"
2729+
integrity sha512-KkkuLnq+rJur77pTUuDNA8j2z3n7lj+R2IXLF0uArADngYPWByuY95pJ7DPxiTokXW49FadV887/I/W7arCWew==
27252730

27262731
invariant@^2.1.1:
27272732
version "2.2.2"
@@ -4601,11 +4606,6 @@ rc@^1.2.7:
46014606
minimist "^1.2.0"
46024607
strip-json-comments "~2.0.1"
46034608

4604-
react-display-name@^0.2.4:
4605-
version "0.2.4"
4606-
resolved "https://registry.yarnpkg.com/react-display-name/-/react-display-name-0.2.4.tgz#e2a670b81d79a2204335510c01246f4c92ff12cf"
4607-
integrity sha512-zvU6iouW+SWwHTyThwxGICjJYCMZFk/6r/+jmOdC7ntQoPlS/Pqb81MkxaMf2bHTSq9TN3K3zX2/ayMW/jCtyA==
4608-
46094609
react-dom@16.8.6, react-dom@>=16.8.1:
46104610
version "16.8.6"
46114611
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
@@ -4616,19 +4616,21 @@ react-dom@16.8.6, react-dom@>=16.8.1:
46164616
prop-types "^15.6.2"
46174617
scheduler "^0.13.6"
46184618

4619-
react-intl@3.0.0-beta-1:
4620-
version "3.0.0-beta-1"
4621-
resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-3.0.0-beta-1.tgz#de6f91fb7b3409b81fac90dc029d281b54b6bbd4"
4622-
integrity sha512-ZH9iKrod9ojg1AX7XnntBcD/t1C2+MNy6NZLoqiarUSsyaj/uOZUPQhIQM2MgCi3n2aOu1PjYxde8iMORYxfhQ==
4619+
react-intl@3.0.0-beta-8:
4620+
version "3.0.0-beta-8"
4621+
resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-3.0.0-beta-8.tgz#6e638a494b02f5228c11737cf9c51f826d137738"
4622+
integrity sha512-706VWfLATgIUAGB6oLkWUIv3krsI8YmhC5wMrDzAScg/OSgn2lAmUviNheACb87BmJfSGb4LUaDWz0UN3qUYeg==
46234623
dependencies:
4624-
hoist-non-react-statics "^2.5.5"
4625-
intl-format-cache "^2.0.5"
4626-
intl-messageformat "^2.1.0"
4627-
intl-relativeformat "^2.1.0"
4624+
hoist-non-react-statics "^3.3.0"
4625+
intl-format-cache "^3.0.0"
4626+
intl-locales-supported "^1.0.10"
4627+
intl-messageformat "^4.0.0"
4628+
intl-relativeformat "^6.1.0"
46284629
invariant "^2.1.1"
4629-
react-display-name "^0.2.4"
4630+
react-is "^16.3.1"
4631+
shallow-equal "^1.1.0"
46304632

4631-
react-is@^16.8.1:
4633+
react-is@^16.3.1, react-is@^16.7.0, react-is@^16.8.1:
46324634
version "16.8.6"
46334635
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
46344636
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
@@ -5045,6 +5047,11 @@ shallow-copy@~0.0.1:
50455047
resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170"
50465048
integrity sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=
50475049

5050+
shallow-equal@^1.1.0:
5051+
version "1.2.0"
5052+
resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.0.tgz#fd828d2029ff4e19569db7e19e535e94e2d1f5cc"
5053+
integrity sha512-Z21pVxR4cXsfwpMKMhCEIO1PCi5sp7KEp+CmOpBQ+E8GpHwKOw2sEzk7sgblM3d/j4z4gakoWEoPcjK0VJQogA==
5054+
50485055
shebang-command@^1.2.0:
50495056
version "1.2.0"
50505057
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"

0 commit comments

Comments
 (0)