Skip to content

Commit 3f01e4c

Browse files
authored
fix: Dependency consolidation fixes (#9830)
* Fix icon dependency * Move useMessageFormatter to legacy package * Back compat for @react-aria/i18n/server subpath
1 parent 6a0d13c commit 3f01e4c

File tree

13 files changed

+19
-29
lines changed

13 files changed

+19
-29
lines changed

packages/@adobe/react-spectrum/exports/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ export {useDateFormatter} from 'react-aria/useDateFormatter';
113113
export {useFilter} from 'react-aria/useFilter';
114114
export {useLocale} from 'react-aria/I18nProvider';
115115
export {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';
116-
export {useMessageFormatter} from 'react-aria/private/i18n/useMessageFormatter';
117116
export {useNumberFormatter} from 'react-aria/useNumberFormatter';
118117
export {SSRProvider} from 'react-aria/SSRProvider';
119118
export {useDragAndDrop} from '../src/dnd/useDragAndDrop';
@@ -220,9 +219,7 @@ export type {DateValue, MappedDateValue} from 'react-stately/useDateFieldState';
220219
export type {DateRange} from 'react-stately/useDateRangePickerState';
221220
export type {TimeValue, MappedTimeValue} from 'react-stately/useTimeFieldState';
222221
export type {Filter} from 'react-aria/useFilter';
223-
export type {FormatMessage} from 'react-aria/private/i18n/useMessageFormatter';
224222
export type {Locale} from 'react-aria/I18nProvider';
225-
export type {LocalizedStrings} from '@internationalized/message';
226223
export type {SSRProviderProps} from 'react-aria/SSRProvider';
227224
export type {DirectoryDropItem, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragPreviewRenderer, DragTypes, DropItem, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem} from '@react-types/shared';
228225
export type {DragAndDropHooks, DragAndDropOptions} from '../src/dnd/useDragAndDrop';

packages/@adobe/react-spectrum/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
},
4747
"dependencies": {
4848
"@internationalized/date": "^3.12.0",
49-
"@internationalized/message": "^3.1.8",
5049
"@react-spectrum/style-macro-s1": "3.0.0-alpha.5",
5150
"@react-types/shared": "^3.33.1",
5251
"@spectrum-icons/ui": "^3.6.23",

packages/@react-aria/i18n/package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require": "./dist/main.js"
1717
},
1818
"./server": {
19-
"source": "./src/server.tsx",
19+
"source": "./src/server.ts",
2020
"import": "./server/index.mjs",
2121
"require": "./server/index.js"
2222
},
@@ -27,7 +27,19 @@
2727
"types": "dist/types.d.ts",
2828
"source": "src/index.ts",
2929
"targets": {
30-
"types": false
30+
"types": false,
31+
"server-module": {
32+
"source": "src/server.ts",
33+
"outputFormat": "esmodule",
34+
"isLibrary": true,
35+
"includeNodeModules": false
36+
},
37+
"server-main": {
38+
"source": "src/server.ts",
39+
"outputFormat": "commonjs",
40+
"isLibrary": true,
41+
"includeNodeModules": false
42+
}
3143
},
3244
"files": [
3345
"dist",

packages/@react-aria/i18n/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
export {I18nProvider, useLocale} from 'react-aria/I18nProvider';
1414

15-
export {useMessageFormatter} from 'react-aria/private/i18n/useMessageFormatter';
15+
export {useMessageFormatter} from './useMessageFormatter';
1616
export {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';
1717
export {useLocalizedStringDictionary} from 'react-aria/private/i18n/useLocalizedStringFormatter';
1818
export {useListFormatter} from 'react-aria/useListFormatter';
@@ -21,7 +21,7 @@ export {useNumberFormatter} from 'react-aria/useNumberFormatter';
2121
export {useCollator} from 'react-aria/useCollator';
2222
export {useFilter} from 'react-aria/useFilter';
2323
export {isRTL} from 'react-aria/private/i18n/utils';
24-
export type {FormatMessage} from 'react-aria/private/i18n/useMessageFormatter';
24+
export type {FormatMessage} from './useMessageFormatter';
2525
export type {I18nProviderProps, Locale} from 'react-aria/I18nProvider';
2626
export type {DateFormatterOptions} from 'react-aria/useDateFormatter';
2727
export type {Filter} from 'react-aria/useFilter';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {PackageLocalizationProvider, getPackageLocalizationScript} from 'react-aria/private/i18n/server';

packages/react-aria/src/i18n/useMessageFormatter.ts renamed to packages/@react-aria/i18n/src/useMessageFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import {LocalizedStrings, MessageDictionary, MessageFormatter} from '@internationalized/message';
1414
import {useCallback, useMemo} from 'react';
15-
import {useLocale} from './I18nProvider';
15+
import {useLocale} from 'react-aria/I18nProvider';
1616

1717
export type FormatMessage = (key: string, variables?: {[key: string]: any}) => string;
1818

packages/@spectrum-icons/ui/scripts/generateIcons.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function template(iconName) {
3838
return (
3939
`import {${iconName} as IconComponent} from '@adobe/react-spectrum-ui/dist/${iconName}.js';
4040
import {UIIcon, UIIconPropsWithoutChildren} from '@adobe/react-spectrum/private/icon/UIIcon';
41-
import {useProvider} from '@react-spectrum/provider';
41+
import {useProvider} from '@adobe/react-spectrum/Provider';
4242
import React, {JSX} from 'react';
4343
4444
${jsx}

packages/react-aria/exports/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export {useCollator} from '../src/i18n/useCollator';
5656
export {useDateFormatter} from '../src/i18n/useDateFormatter';
5757
export {useFilter} from '../src/i18n/useFilter';
5858
export {useLocalizedStringFormatter} from '../src/i18n/useLocalizedStringFormatter';
59-
export {useMessageFormatter} from '../src/i18n/useMessageFormatter';
6059
export {useNumberFormatter} from '../src/i18n/useNumberFormatter';
6160
export {useListFormatter} from '../src/i18n/useListFormatter';
6261
export {useFocus} from '../src/interactions/useFocus';
@@ -173,10 +172,8 @@ export type {FocusRingProps} from '../src/focus/FocusRing';
173172
export type {DateFormatter} from '@internationalized/date';
174173
export type {DateFormatterOptions} from '../src/i18n/useDateFormatter';
175174
export type {Filter} from '../src/i18n/useFilter';
176-
export type {FormatMessage} from '../src/i18n/useMessageFormatter';
177175
export type {I18nProviderProps, Locale} from '../src/i18n/I18nProvider';
178176
export type {LocalizedStringFormatter} from '@internationalized/string';
179-
export type {LocalizedStrings} from '@internationalized/message';
180177
export type {ClipboardProps, ClipboardResult} from '../src/dnd/useClipboard';
181178
export type {DirectoryDropItem, DragEndEvent, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragItem, DragMoveEvent, DragPreviewRenderer, DragStartEvent, DragTypes, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropMoveEvent, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, DropTargetDelegate, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem} from '@react-types/shared';
182179
export type {DraggableCollectionOptions} from '../src/dnd/useDraggableCollection';

packages/react-aria/exports/private/i18n/useMessageFormatter.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/react-aria/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
},
4545
"dependencies": {
4646
"@internationalized/date": "^3.12.0",
47-
"@internationalized/message": "^3.1.8",
4847
"@internationalized/number": "^3.6.5",
4948
"@internationalized/string": "^3.2.7",
5049
"@react-types/shared": "^3.33.1",

0 commit comments

Comments
 (0)