Delete TextAncestor compatibility shim#56813
Draft
yaminyassin wants to merge 1 commit into
Draft
Conversation
The shim file `packages/react-native/Libraries/Text/TextAncestor.js` was kept solely to support react-strict-dom's deep import. The file's own comment carried a TODO from @huntie to delete it once the cross-repo reference was fixed. react-strict-dom has now switched to the public `unstable_TextAncestorContext` API (facebook/react-strict-dom#477), exposed in facebook#52368. No internal React Native consumers reference this shim — both `packages/react-native/index.js` and `index.js.flow` import `./Libraries/Text/TextAncestorContext` directly. ## Changelog: [INTERNAL] - Delete TextAncestor compatibility shim
Member
Author
|
@huntie finally getting patched 😂 The strict-dom side is in facebook/react-strict-dom#477. It might take a while on their side but i'll let you know when its merged! These is my first contribution to the project so let me know what i can change/improve 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary:
Deletes
packages/react-native/Libraries/Text/TextAncestor.js, which exists solely as a backwards-compatibility shim for react-strict-dom. The shim's own comment carries a TODO from @huntie to delete it once the cross-repo reference is fixed:RSD has now switched to the public
unstable_TextAncestorContextAPI in facebook/react-strict-dom#477. Once that PR merges and a new react-strict-dom version is published, this shim is no longer needed.Verified clean
No internal React Native consumers reference the shim, every internal user imports the canonical
TextAncestorContextdirectly:packages/react-native/index.js:124-125—require('./Libraries/Text/TextAncestorContext').defaultpackages/react-native/index.js.flow:132—export {default as unstable_TextAncestorContext} from './Libraries/Text/TextAncestorContext'packages/react-native/Libraries/Components/TextInput/TextInput.js:58—import TextAncestorContext from '../../Text/TextAncestorContext'packages/react-native/Libraries/Components/View/View.js:13— samepackages/react-native/Libraries/Text/Text.js:24—import TextAncestorContext from './TextAncestorContext'packages/react-native/Libraries/Text/Text.d.ts:230—export const unstable_TextAncestorContext: React.Context<boolean>(TS public API export, unaffected)No
__snapshots__, BUCK/BUILD files,.flowconfig, ortsconfig.jsonreferences the shim path.Changelog:
[Internal] [Removed] - Delete
Libraries/Text/TextAncestorcompatibility shimTest Plan:
Followed the steps in How to Run and Write Tests and How to Contribute Code on macOS with Node v24.11.0 / Yarn 1.22.22.
All five JS-level checks pass. The public TypeScript API surface (
ReactNativeApi.d.ts) is unchanged — the shim was a.js-only re-export and never part of the typed public API.Dependencies / merge order
Marked as draft. Do not merge until react-strict-dom has shipped a release containing facebook/react-strict-dom#477, otherwise published versions of react-strict-dom that still use
react-native/Libraries/Text/TextAncestorwill fail at runtime when consumers upgrade React Native.I'll un-draft this PR once the strict-dom side ships.