Repository navigation
Keep nested Fantom Text children in arrays - #60315
GianSandoval5 wants to merge 1 commit into
Conversation
|
Hi @GianSandoval5! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary:
Fixes #60281.
Fantom declares every rendered node's
childrenas an array, but the native emitter stores a bare string for a nestedTextfragment. The JavaScript prop filter preserves it, so consumers using the declared JSON shape can fail on array methods.Emit a one-element array for nested fragment text, matching the existing Flow type and other nodes. Update the existing nested-text expectation, cover
toJSONObject()andtoJSON()with direct paragraph text surrounding a nested fragment, and verify that JSX output preserves the text after the nested content changes to Unicode.This changes the internal raw shape from
children: "text"tochildren: ["text"]; consumers relying on the previous raw shape must update expectations. This proposes a uniform-array contract rather than widening the type. No public React Native API is changed.Changelog:
[INTERNAL] [FIXED] - Keep nested Fantom Text fragment children in arrays, matching the declared rendered-output JSON shape
Test Plan:
Base:
dce80ca65a1848e4131f1292c31c87f36bed1e10. Verified on November 26, 2026 in the project's Android CI image v22.0, using Node 22.14.0, Yarn 1.22.22, OpenJDK 17.0.20.1 and Clang 14.0.0 (different from the reporter's Clang 23.1.3).it.skipcases cover task/microtask scheduling after errors and have TODO comments to fix that handling. They are unchanged on the base and patch.--max-warnings 0), full Flow check and source-restoration diff check: exit 0.Commands:
yarn workspace @react-native/fantom build yarn fantom private/react-native-fantom/src/__tests__/Fantom-itest.js --ci --runInBand --json --outputFile=verification-results/baseline.json # Restore the patch and rebuild the native tester, then: yarn fantom private/react-native-fantom/src/__tests__/Fantom-itest.js private/react-native-fantom/src/__tests__/FantomTextMeasurement-itest.js packages/react-native/Libraries/Text/__tests__/Text-itest.js --ci --runInBand --json --outputFile=verification-results/patched.jsonNative build logs and JSON results: https://github.com/GianSandoval5/react-native/actions/runs/45823207836
The first verification run passed static checks but stopped before compilation because the shallow checkout lacked the baseline object. It is not counted as a product reproduction. The successful run fetches the recorded base, builds the actual Fantom/Hermes tester for baseline and patch, requires exactly the two contract failures, and then executes the three integration suites. The verification workflow and harness remain on a separate fork-only branch; this PR contains only two functional files.
Not run: Android/iOS application builds, physical devices, the whole Fantom/React Native suite, or public API snapshot generation (no public API/header changed). This Linux tester run is not Android/iOS validation.
AI-assisted implementation, based on the native emitter and existing suite. The issue's reproduction is credited through the link; its posted test was not copied into this contribution. Kept in draft for Gian's personal review and confirmation of Meta CLA coverage. No agreement is signed by this preparation.