Skip to content

Commit 68927b8

Browse files
authored
chore: slim @react-aria/i18n barrel and replace lodash import (-110 KB) (RocketChat#40110)
1 parent bf45c37 commit 68927b8

4 files changed

Lines changed: 171 additions & 6 deletions

File tree

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
diff --git a/dist/import.mjs b/dist/import.mjs
2+
index 668b87f9fbf77162f4baa4b02fe3586c3a2c0b26..6b6dc85b39196597504df1a287495a24ce3c0831 100644
3+
--- a/dist/import.mjs
4+
+++ b/dist/import.mjs
5+
@@ -1,31 +1,7 @@
6+
-import {I18nProvider as $18f2051aff69b9bf$export$a54013f0d02a8f82, useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.mjs";
7+
-import {useMessageFormatter as $321bc95feeb923dd$export$ec23bf898b1eed85} from "./useMessageFormatter.mjs";
8+
-import {useLocalizedStringDictionary as $fca6afa0e843324b$export$87b761675e8eaa10, useLocalizedStringFormatter as $fca6afa0e843324b$export$f12b703ca79dfbb1} from "./useLocalizedStringFormatter.mjs";
9+
-import {useListFormatter as $33bf17300c498528$export$a2f47a3d2973640} from "./useListFormatter.mjs";
10+
-import {useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79} from "./useDateFormatter.mjs";
11+
-import {useNumberFormatter as $a916eb452884faea$export$b7a616150fdb9f44} from "./useNumberFormatter.mjs";
12+
-import {useCollator as $325a3faab7a68acd$export$a16aca283550c30d} from "./useCollator.mjs";
13+
-import {useFilter as $bb77f239b46e8c72$export$3274cf84b703fff} from "./useFilter.mjs";
14+
-
15+
-/*
16+
- * Copyright 2020 Adobe. All rights reserved.
17+
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18+
- * you may not use this file except in compliance with the License. You may obtain a copy
19+
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
20+
- *
21+
- * Unless required by applicable law or agreed to in writing, software distributed under
22+
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23+
- * OF ANY KIND, either express or implied. See the License for the specific language
24+
- * governing permissions and limitations under the License.
25+
- */
26+
-
27+
-
28+
-
29+
-
30+
-
31+
-
32+
-
33+
-
34+
-
35+
-export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale, $321bc95feeb923dd$export$ec23bf898b1eed85 as useMessageFormatter, $fca6afa0e843324b$export$f12b703ca79dfbb1 as useLocalizedStringFormatter, $fca6afa0e843324b$export$87b761675e8eaa10 as useLocalizedStringDictionary, $33bf17300c498528$export$a2f47a3d2973640 as useListFormatter, $896ba0a80a8f4d36$export$85fd5fdf27bacc79 as useDateFormatter, $a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter, $325a3faab7a68acd$export$a16aca283550c30d as useCollator, $bb77f239b46e8c72$export$3274cf84b703fff as useFilter};
36+
-//# sourceMappingURL=module.js.map
37+
+import {I18nProvider as $18f2051aff69b9bf$export$a54013f0d02a8f82, useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.module.js";
38+
+import {useLocalizedStringDictionary as $fca6afa0e843324b$export$87b761675e8eaa10, useLocalizedStringFormatter as $fca6afa0e843324b$export$f12b703ca79dfbb1} from "./useLocalizedStringFormatter.module.js";
39+
+import {useNumberFormatter as $a916eb452884faea$export$b7a616150fdb9f44} from "./useNumberFormatter.module.js";
40+
+import {useCollator as $325a3faab7a68acd$export$a16aca283550c30d} from "./useCollator.module.js";
41+
+import {useFilter as $bb77f239b46e8c72$export$3274cf84b703fff} from "./useFilter.module.js";
42+
+// Slim barrel: removed useDateFormatter (@internationalized/date ~40KB) and useMessageFormatter (@formatjs ~62KB)
43+
+export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale, $fca6afa0e843324b$export$f12b703ca79dfbb1 as useLocalizedStringFormatter, $fca6afa0e843324b$export$87b761675e8eaa10 as useLocalizedStringDictionary, $a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter, $325a3faab7a68acd$export$a16aca283550c30d as useCollator, $bb77f239b46e8c72$export$3274cf84b703fff as useFilter};
44+
diff --git a/dist/main.js b/dist/main.js
45+
index 62b1f5e2054df93a1f3e851f191c42441cf33699..820e10e6bf275b396a46e26a8e80f46b59bffb5c 100644
46+
--- a/dist/main.js
47+
+++ b/dist/main.js
48+
@@ -1,45 +1,13 @@
49+
var $47fa5ec5ff482271$exports = require("./context.main.js");
50+
-var $c376aa482226bf60$exports = require("./useMessageFormatter.main.js");
51+
-var $fc53663969a3d00a$exports = require("./useLocalizedStringFormatter.main.js");
52+
-var $cb6a3e7d490e97a4$exports = require("./useListFormatter.main.js");
53+
-var $b80c530ff2e20243$exports = require("./useDateFormatter.main.js");
54+
-var $fea93c5b7c90d9f4$exports = require("./useNumberFormatter.main.js");
55+
-var $27a5ce66022270ad$exports = require("./useCollator.main.js");
56+
-var $832d079b867c7223$exports = require("./useFilter.main.js");
57+
-
58+
-
59+
-function $parcel$export(e, n, v, s) {
60+
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
61+
-}
62+
-
63+
-$parcel$export(module.exports, "I18nProvider", () => $47fa5ec5ff482271$exports.I18nProvider);
64+
-$parcel$export(module.exports, "useLocale", () => $47fa5ec5ff482271$exports.useLocale);
65+
-$parcel$export(module.exports, "useMessageFormatter", () => $c376aa482226bf60$exports.useMessageFormatter);
66+
-$parcel$export(module.exports, "useLocalizedStringFormatter", () => $fc53663969a3d00a$exports.useLocalizedStringFormatter);
67+
-$parcel$export(module.exports, "useLocalizedStringDictionary", () => $fc53663969a3d00a$exports.useLocalizedStringDictionary);
68+
-$parcel$export(module.exports, "useListFormatter", () => $cb6a3e7d490e97a4$exports.useListFormatter);
69+
-$parcel$export(module.exports, "useDateFormatter", () => $b80c530ff2e20243$exports.useDateFormatter);
70+
-$parcel$export(module.exports, "useNumberFormatter", () => $fea93c5b7c90d9f4$exports.useNumberFormatter);
71+
-$parcel$export(module.exports, "useCollator", () => $27a5ce66022270ad$exports.useCollator);
72+
-$parcel$export(module.exports, "useFilter", () => $832d079b867c7223$exports.useFilter);
73+
-/*
74+
- * Copyright 2020 Adobe. All rights reserved.
75+
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
76+
- * you may not use this file except in compliance with the License. You may obtain a copy
77+
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
78+
- *
79+
- * Unless required by applicable law or agreed to in writing, software distributed under
80+
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
81+
- * OF ANY KIND, either express or implied. See the License for the specific language
82+
- * governing permissions and limitations under the License.
83+
- */
84+
-
85+
-
86+
-
87+
-
88+
-
89+
-
90+
-
91+
-
92+
-
93+
-//# sourceMappingURL=main.js.map
94+
+var $fc53663969a3d00a$exports = require("./useLocalizedStringFormatter.main.js");
95+
+var $8c5e0e4c6ca34e89$exports = require("./useNumberFormatter.main.js");
96+
+var $22f23e74d8a5e30d$exports = require("./useCollator.main.js");
97+
+var $7d0e351af20babe4$exports = require("./useFilter.main.js");
98+
+// Slim barrel: removed useDateFormatter, useMessageFormatter, useListFormatter
99+
+exports.I18nProvider = $47fa5ec5ff482271$exports.I18nProvider;
100+
+exports.useLocale = $47fa5ec5ff482271$exports.useLocale;
101+
+exports.useLocalizedStringFormatter = $fc53663969a3d00a$exports.useLocalizedStringFormatter;
102+
+exports.useLocalizedStringDictionary = $fc53663969a3d00a$exports.useLocalizedStringDictionary;
103+
+exports.useNumberFormatter = $8c5e0e4c6ca34e89$exports.useNumberFormatter;
104+
+exports.useCollator = $22f23e74d8a5e30d$exports.useCollator;
105+
+exports.useFilter = $7d0e351af20babe4$exports.useFilter;
106+
diff --git a/dist/module.js b/dist/module.js
107+
index fb8c9b0ce2c72d49866c95c3fd6e73cd26149775..6b6dc85b39196597504df1a287495a24ce3c0831 100644
108+
--- a/dist/module.js
109+
+++ b/dist/module.js
110+
@@ -1,31 +1,7 @@
111+
import {I18nProvider as $18f2051aff69b9bf$export$a54013f0d02a8f82, useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.module.js";
112+
-import {useMessageFormatter as $321bc95feeb923dd$export$ec23bf898b1eed85} from "./useMessageFormatter.module.js";
113+
-import {useLocalizedStringDictionary as $fca6afa0e843324b$export$87b761675e8eaa10, useLocalizedStringFormatter as $fca6afa0e843324b$export$f12b703ca79dfbb1} from "./useLocalizedStringFormatter.module.js";
114+
-import {useListFormatter as $33bf17300c498528$export$a2f47a3d2973640} from "./useListFormatter.module.js";
115+
-import {useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79} from "./useDateFormatter.module.js";
116+
+import {useLocalizedStringDictionary as $fca6afa0e843324b$export$87b761675e8eaa10, useLocalizedStringFormatter as $fca6afa0e843324b$export$f12b703ca79dfbb1} from "./useLocalizedStringFormatter.module.js";
117+
import {useNumberFormatter as $a916eb452884faea$export$b7a616150fdb9f44} from "./useNumberFormatter.module.js";
118+
import {useCollator as $325a3faab7a68acd$export$a16aca283550c30d} from "./useCollator.module.js";
119+
import {useFilter as $bb77f239b46e8c72$export$3274cf84b703fff} from "./useFilter.module.js";
120+
-
121+
-/*
122+
- * Copyright 2020 Adobe. All rights reserved.
123+
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
124+
- * you may not use this file except in compliance with the License. You may obtain a copy
125+
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
126+
- *
127+
- * Unless required by applicable law or agreed to in writing, software distributed under
128+
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
129+
- * OF ANY KIND, either express or implied. See the License for the specific language
130+
- * governing permissions and limitations under the License.
131+
- */
132+
-
133+
-
134+
-
135+
-
136+
-
137+
-
138+
-
139+
-
140+
-
141+
-export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale, $321bc95feeb923dd$export$ec23bf898b1eed85 as useMessageFormatter, $fca6afa0e843324b$export$f12b703ca79dfbb1 as useLocalizedStringFormatter, $fca6afa0e843324b$export$87b761675e8eaa10 as useLocalizedStringDictionary, $33bf17300c498528$export$a2f47a3d2973640 as useListFormatter, $896ba0a80a8f4d36$export$85fd5fdf27bacc79 as useDateFormatter, $a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter, $325a3faab7a68acd$export$a16aca283550c30d as useCollator, $bb77f239b46e8c72$export$3274cf84b703fff as useFilter};
142+
-//# sourceMappingURL=module.js.map
143+
+// Slim barrel: removed useDateFormatter (@internationalized/date ~40KB) and useMessageFormatter (@formatjs ~62KB)
144+
+export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale, $fca6afa0e843324b$export$f12b703ca79dfbb1 as useLocalizedStringFormatter, $fca6afa0e843324b$export$87b761675e8eaa10 as useLocalizedStringDictionary, $a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter, $325a3faab7a68acd$export$a16aca283550c30d as useCollator, $bb77f239b46e8c72$export$3274cf84b703fff as useFilter};

apps/meteor/client/lib/e2ee/rocketchat.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Emitter } from '@rocket.chat/emitter';
77
import { isTruthy } from '@rocket.chat/tools';
88
import { imperativeModal } from '@rocket.chat/ui-client';
99
import type { SubscriptionWithRoom } from '@rocket.chat/ui-contexts';
10-
import _ from 'lodash';
10+
import sampleSize from 'lodash/sampleSize';
1111
import { Accounts } from 'meteor/accounts-base';
1212

1313
import type { E2EEState } from './E2EEState';
@@ -793,7 +793,7 @@ class E2E extends Emitter {
793793
return [];
794794
}
795795

796-
const randomRoomIds = _.sampleSize(roomIds, ROOM_KEY_EXCHANGE_SIZE);
796+
const randomRoomIds = sampleSize(roomIds, ROOM_KEY_EXCHANGE_SIZE);
797797

798798
const sampleIds: string[] = [];
799799
for await (const roomId of randomRoomIds) {

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
"react-aria@npm:~3.37.0": "patch:react-aria@npm%3A3.37.0#~/.yarn/patches/react-aria-npm-3.37.0-83959bd2fa.patch",
4949
"react-stately@npm:~3.35.0": "patch:react-stately@npm%3A3.17.0#~/.yarn/patches/react-stately-npm-3.17.0-264cc7a43c.patch",
5050
"zod@npm:^3.25.0 || ^4.0.0": "patch:zod@npm%3A4.3.6#~/.yarn/patches/zod-npm-4.3.6-a096e305e6.patch",
51-
"zod@npm:~4.3.6": "patch:zod@npm%3A4.3.6#~/.yarn/patches/zod-npm-4.3.6-a096e305e6.patch"
51+
"zod@npm:~4.3.6": "patch:zod@npm%3A4.3.6#~/.yarn/patches/zod-npm-4.3.6-a096e305e6.patch",
52+
"@react-aria/i18n@npm:^3.0.0-nightly-fb28ab3b4-241024": "patch:@react-aria/i18n@npm%3A3.12.5#~/.yarn/patches/@react-aria-i18n-npm-3.12.5-435edff786.patch",
53+
"@react-aria/i18n@npm:^3.12.5": "patch:@react-aria/i18n@npm%3A3.12.5#~/.yarn/patches/@react-aria-i18n-npm-3.12.5-435edff786.patch"
5254
},
5355
"dependencies": {
5456
"@types/stream-buffers": "^3.0.8",

yarn.lock

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7181,7 +7181,7 @@ __metadata:
71817181
languageName: node
71827182
linkType: hard
71837183

7184-
"@react-aria/i18n@npm:^3.0.0-nightly-fb28ab3b4-241024, @react-aria/i18n@npm:^3.12.5":
7184+
"@react-aria/i18n@npm:3.12.5":
71857185
version: 3.12.5
71867186
resolution: "@react-aria/i18n@npm:3.12.5"
71877187
dependencies:
@@ -7200,6 +7200,25 @@ __metadata:
72007200
languageName: node
72017201
linkType: hard
72027202

7203+
"@react-aria/i18n@patch:@react-aria/i18n@npm%3A3.12.5#~/.yarn/patches/@react-aria-i18n-npm-3.12.5-435edff786.patch":
7204+
version: 3.12.5
7205+
resolution: "@react-aria/i18n@patch:@react-aria/i18n@npm%3A3.12.5#~/.yarn/patches/@react-aria-i18n-npm-3.12.5-435edff786.patch::version=3.12.5&hash=6bfd1c"
7206+
dependencies:
7207+
"@internationalized/date": "npm:^3.7.0"
7208+
"@internationalized/message": "npm:^3.1.6"
7209+
"@internationalized/number": "npm:^3.6.0"
7210+
"@internationalized/string": "npm:^3.2.5"
7211+
"@react-aria/ssr": "npm:^3.9.7"
7212+
"@react-aria/utils": "npm:^3.27.0"
7213+
"@react-types/shared": "npm:^3.27.0"
7214+
"@swc/helpers": "npm:^0.5.0"
7215+
peerDependencies:
7216+
react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1
7217+
react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1
7218+
checksum: 10/84664c647b2b6372536e7896a0c679727f668c2ca4b9b98d8d6be4928ec6c584efddb0e85c7d97a46ddfd97eedbbcfdd760c5b67026a31a2335629bd65a7b2d5
7219+
languageName: node
7220+
linkType: hard
7221+
72037222
"@react-aria/interactions@npm:^3.23.0":
72047223
version: 3.23.0
72057224
resolution: "@react-aria/interactions@npm:3.23.0"
@@ -38730,8 +38749,8 @@ __metadata:
3873038749

3873138750
"zod@patch:zod@npm%3A4.3.6#~/.yarn/patches/zod-npm-4.3.6-a096e305e6.patch":
3873238751
version: 4.3.6
38733-
resolution: "zod@patch:zod@npm%3A4.3.6#~/.yarn/patches/zod-npm-4.3.6-a096e305e6.patch::version=4.3.6&hash=5b64de"
38734-
checksum: 10/7e9f9e3bef6a7aa9c859841837824b1bc95063c77afbe6dbb4bdb247b70c84aef505ddfc77a693e3dabe2e9182d2ccb497df6bd3f5b045a705e189c906dc8dfc
38752+
resolution: "zod@patch:zod@npm%3A4.3.6#~/.yarn/patches/zod-npm-4.3.6-a096e305e6.patch::version=4.3.6&hash=18f503"
38753+
checksum: 10/2b771f17a72ced59fa57b522693a352140eb193d7158ae75092683f568cf19015c53be5ae6b3fa52dad2335deaff0f7beccba677cc1890744d06776d90a4fc7c
3873538754
languageName: node
3873638755
linkType: hard
3873738756

0 commit comments

Comments
 (0)