From 6485fa2e79fc1f8c00336a44ea940ef8d10f0232 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 29 Jun 2026 07:35:34 -0700 Subject: [PATCH 1/2] Remove unused Libraries/*.d.ts export subpath (2/2) Summary: Follows https://github.com/react/react-native/pull/57362 (accidentally missed). Simplifying our `"exports"` map to its minimum form will help for the incoming review/understandability of the Strict TS API rollout by default. Changelog: [Internal] Differential Revision: D110055788 --- packages/react-native/package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 888245bcd3ec..991e42abc39a 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -43,10 +43,6 @@ "react-native-strict-api": null, "default": "./Libraries/*.js" }, - "./Libraries/*.d.ts": { - "react-native-strict-api": null, - "default": "./Libraries/*.d.ts" - }, "./scripts/*": "./scripts/*", "./src/*": { "types": null, From d6d49a5d61734694c7367803c309267f0391dd43 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 29 Jun 2026 07:37:40 -0700 Subject: [PATCH 2/2] Relocate __typetests__ directory, format Summary: Places this one folder up, in a location that will be preserved when we later delete the manual `types/` dir. These tests already apply to both the `types/Libraries` dirs and the generated `types_generated/`. Changelog: [Internal] Differential Revision: D110055787 --- .../{types => }/__typetests__/animated.tsx | 0 .../__typetests__/fabric-component-sample.ts | 0 .../{types => }/__typetests__/globals.tsx | 0 .../{types => }/__typetests__/index.tsx | 0 .../__typetests__/legacy-properties.tsx | 0 .../__typetests__/stylesheet-create.tsx | 0 .../__typetests__/stylesheet-flatten.tsx | 0 .../__typetests__/turbo-module-sample.ts | 15 ++++++++------- packages/react-native/types/tsconfig.json | 3 ++- .../build-types/templates/tsconfig.test.json | 2 +- 10 files changed, 11 insertions(+), 9 deletions(-) rename packages/react-native/{types => }/__typetests__/animated.tsx (100%) rename packages/react-native/{types => }/__typetests__/fabric-component-sample.ts (100%) rename packages/react-native/{types => }/__typetests__/globals.tsx (100%) rename packages/react-native/{types => }/__typetests__/index.tsx (100%) rename packages/react-native/{types => }/__typetests__/legacy-properties.tsx (100%) rename packages/react-native/{types => }/__typetests__/stylesheet-create.tsx (100%) rename packages/react-native/{types => }/__typetests__/stylesheet-flatten.tsx (100%) rename packages/react-native/{types => }/__typetests__/turbo-module-sample.ts (65%) diff --git a/packages/react-native/types/__typetests__/animated.tsx b/packages/react-native/__typetests__/animated.tsx similarity index 100% rename from packages/react-native/types/__typetests__/animated.tsx rename to packages/react-native/__typetests__/animated.tsx diff --git a/packages/react-native/types/__typetests__/fabric-component-sample.ts b/packages/react-native/__typetests__/fabric-component-sample.ts similarity index 100% rename from packages/react-native/types/__typetests__/fabric-component-sample.ts rename to packages/react-native/__typetests__/fabric-component-sample.ts diff --git a/packages/react-native/types/__typetests__/globals.tsx b/packages/react-native/__typetests__/globals.tsx similarity index 100% rename from packages/react-native/types/__typetests__/globals.tsx rename to packages/react-native/__typetests__/globals.tsx diff --git a/packages/react-native/types/__typetests__/index.tsx b/packages/react-native/__typetests__/index.tsx similarity index 100% rename from packages/react-native/types/__typetests__/index.tsx rename to packages/react-native/__typetests__/index.tsx diff --git a/packages/react-native/types/__typetests__/legacy-properties.tsx b/packages/react-native/__typetests__/legacy-properties.tsx similarity index 100% rename from packages/react-native/types/__typetests__/legacy-properties.tsx rename to packages/react-native/__typetests__/legacy-properties.tsx diff --git a/packages/react-native/types/__typetests__/stylesheet-create.tsx b/packages/react-native/__typetests__/stylesheet-create.tsx similarity index 100% rename from packages/react-native/types/__typetests__/stylesheet-create.tsx rename to packages/react-native/__typetests__/stylesheet-create.tsx diff --git a/packages/react-native/types/__typetests__/stylesheet-flatten.tsx b/packages/react-native/__typetests__/stylesheet-flatten.tsx similarity index 100% rename from packages/react-native/types/__typetests__/stylesheet-flatten.tsx rename to packages/react-native/__typetests__/stylesheet-flatten.tsx diff --git a/packages/react-native/types/__typetests__/turbo-module-sample.ts b/packages/react-native/__typetests__/turbo-module-sample.ts similarity index 65% rename from packages/react-native/types/__typetests__/turbo-module-sample.ts rename to packages/react-native/__typetests__/turbo-module-sample.ts index b178fdcc51b6..698bc125315d 100644 --- a/packages/react-native/types/__typetests__/turbo-module-sample.ts +++ b/packages/react-native/__typetests__/turbo-module-sample.ts @@ -3,20 +3,21 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @format */ -import { TurboModule, TurboModuleRegistry } from 'react-native'; -'use strict'; +import {TurboModule, TurboModuleRegistry} from 'react-native'; export interface SomeConstants { - x: string; - y: number; - z: boolean; + x: string; + y: number; + z: boolean; } export interface SampleSpec extends TurboModule { - getConstants(): SomeConstants - doSomething(): void; + getConstants(): SomeConstants; + doSomething(): void; } export default TurboModuleRegistry.getEnforcing('Sample'); diff --git a/packages/react-native/types/tsconfig.json b/packages/react-native/types/tsconfig.json index 8e8963ec2f6f..bb7659500b10 100644 --- a/packages/react-native/types/tsconfig.json +++ b/packages/react-native/types/tsconfig.json @@ -12,5 +12,6 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": {"react-native": ["."]} - } + }, + "include": ["**/*.d.ts", "../__typetests__/**/*"] } diff --git a/scripts/js-api/build-types/templates/tsconfig.test.json b/scripts/js-api/build-types/templates/tsconfig.test.json index 209586008a59..7af1dd074cb8 100644 --- a/scripts/js-api/build-types/templates/tsconfig.test.json +++ b/scripts/js-api/build-types/templates/tsconfig.test.json @@ -13,5 +13,5 @@ "moduleResolution": "bundler", "customConditions": ["react-native-strict-api"] }, - "include": ["**/*.d.ts", "../types/__typetests__/**/*"] + "include": ["**/*.d.ts", "../__typetests__/**/*"] }