Repository navigation
feat(native): place code block slots in the iOS and Android hosts - #1069
Open
eszlamczyk wants to merge 2 commits into
Open
eszlamczyk wants to merge 2 commits into
eszlamczyk wants to merge 2 commits into
Conversation
eszlamczyk
force-pushed
the
feat/code-renderers-native
branch
from
October 23, 2026 08:41
48fd94e to
05620c1
Compare
6 tasks
The hosts map the `code` slot kind and give its placeholder the code block's margins. The TurboModule's slots carry `language`, `code` and `isComplete`, which is false only for the code block an open streamed fence belongs to. Wrap state and the pending code block need no change: a replaced block is not a native code block view, so measurement and view collection both skip it, and a trailing code slot leaves nothing pending. The TurboModule still skips code slots until useBlockSlots maps them.
eszlamczyk
force-pushed
the
feat/code-renderers-native
branch
from
October 23, 2026 13:32
05620c1 to
3b09536
Compare
eszlamczyk
marked this pull request as ready for review
October 23, 2026 13:46
This branch has not been deployed
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.
What/Why?
Second step of the code block renderers stack, on top of #1068.
This PR teaches the iOS and Android hosts to place code block slots, so the next PR can turn them on from JS.
codeslot kind (ENRMBlockSlotKindCode,BlockSlotKind.CODE). A code block the core stamped becomes a slot segment instead of a native code block, and takes the top and bottom margins ofmarkdownStyle.codeBlock.NativeBlockSlotgainslanguage,codeandisComplete.isCompleteis false only for the slot whose fence is still open in the streamed markdown, read from the core'sisSlotComplete.useBlockSlotsmaps them in the next PR.Testing
testCodeSlotTakesCodeBlockMarginsinBlockSlotStackingTests.mm: a stamped fence is a single slot segment whose height is the code block margins plus the measured height.BlockSlotKindTest.kt: every core kind name maps to its kind, a code slot takes the code block margins, and only a stamped code block splits into a slot.renderers.test.tsxfixtures for the new fields.PR Checklist