Skip to content

Commit 94a8154

Browse files
authored
Realign index.windows.js with core and disable the deep import warning (#15309)
* Disable the deep import warning * Change files * Align index.windows.js with core * Change files
1 parent 26d93dc commit 94a8154

17 files changed

+623
-235
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Copy flow files for rn copy",
4+
"packageName": "@rnw-scripts/just-task",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Disable the deep import warning",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/@react-native-windows/tester/src/js/examples-win/NativeComponents/CustomXamlComponentWithNativeLayoutNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
1414
import type {HostComponent} from 'react-native';
1515
import type {DirectEventHandler} from 'react-native/Libraries/Types/CodegenTypes';
16-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
16+
import {codegenNativeComponent} from 'react-native';
1717

1818
type MyEventEvent = $ReadOnly<{|
1919
value: boolean,

packages/@react-native-windows/tester/src/js/examples-win/NativeComponents/CustomXamlComponentWithYogaLayoutNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
1414
import type {HostComponent} from 'react-native';
1515
import type {DirectEventHandler} from 'react-native/Libraries/Types/CodegenTypes';
16-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
16+
import {codegenNativeComponent} from 'react-native';
1717

1818
type MyEventEvent = $ReadOnly<{|
1919
value: boolean,

packages/@rnw-scripts/babel-react-native-config/babel.config.js

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

99
module.exports = () => ({
1010
presets: [
11-
'module:@react-native/babel-preset',
11+
['module:@react-native/babel-preset', { disableDeepImportWarnings: true }]
1212
],
1313
plugins: [
1414
"babel-plugin-transform-flow-enums",

packages/@rnw-scripts/just-task/copyRNLibraries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ exports.copyTask = baseDir => {
5858
dest: base('.'),
5959
}),
6060

61-
copyTask({paths: src('**/*+(.d.ts|.js|.png)'), dest: base('.')}),
61+
copyTask({paths: src('**/*+(.d.ts|.js|.png|.flow)'), dest: base('.')}),
6262

6363
() => {
6464
const typesPath = path.resolve(baseDir, 'types/index.d.ts');

packages/sample-custom-component/src/DrawingIslandNativeComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
1+
import { codegenNativeComponent } from 'react-native';
22
import type { ViewProps } from 'react-native';
33

44
export interface DrawingIslandProps extends ViewProps {

packages/sample-custom-component/src/FabricXamlCalendarViewNativeComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Temporary test example for UseExperimentalWinUI3=true
1111
// Remove when we get react-native-xaml working well for Fabric
1212

13-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
13+
import {codegenNativeComponent} from 'react-native';
1414
import type {ViewProps} from 'react-native';
1515
import type {DirectEventHandler} from 'react-native/Libraries/Types/CodegenTypes';
1616

packages/sample-custom-component/src/MovingLightNativeComponent.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2-
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
1+
import {codegenNativeComponent, codegenNativeCommands} from 'react-native';
32
import type { ColorValue, HostComponent, ViewProps } from 'react-native';
43

54
import type {

vnext/.flowconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<PROJECT_ROOT>/Libraries/Components/View/ViewPropTypes.js
2828
<PROJECT_ROOT>/Libraries/Components/View/View.js
2929
<PROJECT_ROOT>/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js
30-
<PROJECT_ROOT>/Libraries/Image/Image.js
3130
<PROJECT_ROOT>/Libraries/Image/resolveAssetSource.js
3231
<PROJECT_ROOT>/Libraries/Network/RCTNetworking.js
3332
<PROJECT_ROOT>/Libraries/Pressability/Pressability.js

0 commit comments

Comments
 (0)