@symbiote-native/components 1.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -13
- package/build/accessibility-props.d.ts +1 -1
- package/build/accessibility-props.js +2 -2
- package/build/behaviors/activity-indicator/index.android.d.ts +1 -0
- package/build/behaviors/activity-indicator/index.android.js +16 -0
- package/build/behaviors/activity-indicator/index.d.ts +3 -0
- package/build/behaviors/activity-indicator/index.ios.d.ts +1 -0
- package/build/behaviors/activity-indicator/index.ios.js +14 -0
- package/build/behaviors/activity-indicator/index.js +5 -0
- package/build/behaviors/activity-indicator/shared.d.ts +18 -0
- package/build/behaviors/activity-indicator/shared.js +120 -0
- package/build/behaviors/button.d.ts +13 -0
- package/build/behaviors/button.js +340 -0
- package/build/behaviors/image-background.d.ts +3 -0
- package/build/behaviors/image-background.js +155 -0
- package/build/behaviors/image.d.ts +1 -2
- package/build/behaviors/image.js +25 -106
- package/build/behaviors/input-accessory-view.d.ts +1 -2
- package/build/behaviors/input-accessory-view.js +49 -55
- package/build/behaviors/pressable.d.ts +59 -1
- package/build/behaviors/pressable.js +142 -96
- package/build/behaviors/refresh-control.d.ts +2 -0
- package/build/behaviors/refresh-control.js +96 -0
- package/build/behaviors/scroll-view/index.android.d.ts +1 -0
- package/build/behaviors/scroll-view/index.android.js +40 -0
- package/build/behaviors/scroll-view/index.d.ts +3 -0
- package/build/behaviors/scroll-view/index.ios.d.ts +1 -0
- package/build/behaviors/scroll-view/index.ios.js +10 -0
- package/build/behaviors/scroll-view/index.js +8 -0
- package/build/behaviors/scroll-view/responder.d.ts +4 -0
- package/build/behaviors/scroll-view/responder.js +202 -0
- package/build/behaviors/scroll-view/shared.d.ts +9 -0
- package/build/behaviors/scroll-view/shared.js +291 -0
- package/build/behaviors/scroll-view/sticky.d.ts +18 -0
- package/build/behaviors/scroll-view/sticky.js +581 -0
- package/build/behaviors/switch.d.ts +1 -1
- package/build/behaviors/switch.js +49 -88
- package/build/behaviors/text-input.d.ts +2 -2
- package/build/behaviors/text-input.js +244 -104
- package/build/behaviors/touchable-highlight.d.ts +9 -0
- package/build/behaviors/touchable-highlight.js +205 -0
- package/build/behaviors/touchable-native-feedback.d.ts +20 -0
- package/build/behaviors/touchable-native-feedback.js +254 -0
- package/build/behaviors/touchable-opacity.d.ts +12 -0
- package/build/behaviors/touchable-opacity.js +239 -0
- package/build/behaviors/touchable-without-feedback.d.ts +2 -0
- package/build/behaviors/touchable-without-feedback.js +231 -0
- package/build/component-names/index.android.js +31 -25
- package/build/component-names/index.ios.js +28 -23
- package/build/component-names/shared.d.ts +2 -1
- package/build/component-names/shared.js +16 -6
- package/build/descriptor.js +4 -4
- package/build/index.d.ts +26 -26
- package/build/index.js +56 -27
- package/build/register.d.ts +1 -0
- package/build/register.js +55 -0
- package/build/resolve-intrinsic.js +3 -9
- package/build/scroll-view-commands.d.ts +1 -5
- package/build/scroll-view-commands.js +23 -85
- package/build/state/flat-list.d.ts +2 -2
- package/build/state/flat-list.js +10 -2
- package/build/state/pressable.d.ts +6 -1
- package/build/state/pressable.js +63 -28
- package/build/state/section-list.d.ts +2 -0
- package/build/state/section-list.js +14 -7
- package/build/state/text-input.d.ts +10 -40
- package/build/state/text-input.js +17 -186
- package/build/state/touchable.d.ts +1 -0
- package/build/state/touchable.js +11 -8
- package/build/state/virtualized-list-reducer.d.ts +2 -2
- package/build/state/virtualized-list.d.ts +6 -6
- package/build/state/virtualized-list.js +71 -37
- package/build/text-props.d.ts +0 -8
- package/build/text-props.js +14 -25
- package/build/view/render-button.d.ts +11 -4
- package/build/view/render-button.js +74 -22
- package/build/view/render-image/index.d.ts +14 -1
- package/build/view/render-image/index.js +22 -147
- package/build/view/render-input-accessory-view.d.ts +1 -5
- package/build/view/render-input-accessory-view.js +26 -48
- package/build/view/render-keyboard-avoiding-view.d.ts +7 -1
- package/build/view/render-keyboard-avoiding-view.js +40 -1
- package/build/view/render-modal.d.ts +1 -1
- package/build/view/render-modal.js +18 -8
- package/build/view/render-pressable/index.d.ts +3 -0
- package/build/view/render-pressable/index.js +28 -0
- package/build/view/render-scroll-view.d.ts +1 -4
- package/build/view/render-scroll-view.js +17 -54
- package/build/view/render-switch.d.ts +4 -15
- package/build/view/render-switch.js +4 -42
- package/build/view/render-touchable-highlight.d.ts +1 -0
- package/build/view/render-touchable-native-feedback.d.ts +19 -1
- package/build/view/render-touchable-native-feedback.js +34 -9
- package/host-primitives.cjs +178 -280
- package/host-primitives.d.cts +0 -3
- package/package.json +8 -21
- package/build/fold-host-bag.d.ts +0 -15
- package/build/fold-host-bag.js +0 -99
- package/build/state-style.d.ts +0 -15
- package/build/state-style.js +0 -47
- package/build/view/render-activity-indicator.d.ts +0 -25
- package/build/view/render-activity-indicator.js +0 -88
- package/build/view/render-image-background.d.ts +0 -9
- package/build/view/render-image-background.js +0 -48
- package/build/view/render-text-input.d.ts +0 -11
- package/build/view/render-text-input.js +0 -39
- package/lowering-fixtures.cjs +0 -259
- package/lowering-fixtures.d.cts +0 -17
- package/specialize-state-style.cjs +0 -219
- package/specialize-state-style.d.cts +0 -15
package/host-primitives.cjs
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
// The
|
|
2
|
-
//
|
|
1
|
+
// The PRIMITIVE SPEC — one description of which intrinsic tag each primitive is, what it folds,
|
|
2
|
+
// and which of its two Fabric views a prop selects. Data only: no AST, no framework, no code.
|
|
3
3
|
//
|
|
4
|
-
// WHY IT IS A `.cjs` AND NOT PART OF `src/`. Its consumers
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// says so out loud: "keeps its own copy of this map (a .cjs cannot import from here)".
|
|
4
|
+
// WHY IT IS A `.cjs` AND NOT PART OF `src/`. Its consumers include build-tool files that run
|
|
5
|
+
// before any TS exists and cannot import from `src/` — `adapters/vue/intrinsic-tags.cjs`, which
|
|
6
|
+
// both Vue compilers read to answer element-vs-component. That constraint is why the map was
|
|
7
|
+
// copied per adapter in the first place.
|
|
9
8
|
//
|
|
10
9
|
// WHAT IT DOES NOT UNIFY, stated here so nobody hunts for a contradiction that is not one: this
|
|
11
|
-
// says WHAT a fold is, never WHICH LAYER applies it. Svelte folds Text's defaults
|
|
12
|
-
//
|
|
13
|
-
// fold at runtime in their renderers, where the wrapper used to. Both are correct.
|
|
10
|
+
// says WHAT a fold is, never WHICH LAYER applies it. Svelte folds Text's defaults in its DOM shim;
|
|
11
|
+
// Vue and Solid apply the same fold in their renderers. Both are correct.
|
|
14
12
|
//
|
|
15
13
|
// Four transforms carried their own copy of this before it existed, and it had already produced a
|
|
16
|
-
// real behaviour split —
|
|
14
|
+
// real behaviour split — the `aliases` note below is what is left of it.
|
|
17
15
|
|
|
18
|
-
// `intrinsicWhen` DECLARED AHEAD OF ITS FIRST ENTRY
|
|
16
|
+
// `intrinsicWhen` DECLARED AHEAD OF ITS FIRST ENTRY.
|
|
19
17
|
//
|
|
20
18
|
// WHAT IT IS FOR. `TextInput` is the first primitive whose TAG depends on a prop: `multiline`
|
|
21
|
-
// selects between two different Fabric views, `
|
|
22
|
-
// `
|
|
23
|
-
// one view.
|
|
19
|
+
// selects between two different Fabric views, `text-input` and
|
|
20
|
+
// `text-input-multiline` (`src/view/render-text-input.ts:33`), not between two values of
|
|
21
|
+
// one view. `src/resolve-intrinsic.ts` reads it at element creation, where the value is known.
|
|
24
22
|
//
|
|
25
23
|
// ONE selector and ONE alternative, deliberately — not a map and not a list. There is exactly one
|
|
26
24
|
// such prop in the whole surface, and a wider field would be invented rather than needed. Absent
|
|
27
25
|
// `intrinsicWhen` means "one tag", so no existing entry changes.
|
|
28
26
|
//
|
|
29
|
-
// THE
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
// silently wrong native view gets committed, and no later prop write can correct one.
|
|
27
|
+
// THE BOUNDARY IS IDENTITY, not truthiness: only `true` picks the alternative, and a truthy
|
|
28
|
+
// non-boolean like `multiline={1}` does not. The spec types the selector as a boolean; guessing
|
|
29
|
+
// past that commits the wrong native view, and no later prop write moves a node between views.
|
|
30
|
+
//
|
|
34
31
|
// THE TYPEDEF BELOW IS NOT WHAT TYPESCRIPT READS. `host-primitives.d.cts` is a hand-written
|
|
35
32
|
// declaration file, and a field added here and not there compiles fine in every `.cjs` transform
|
|
36
33
|
// while failing `tsc` in the one consumer written in TypeScript — measured 2026-08-31, when
|
|
@@ -38,175 +35,166 @@
|
|
|
38
35
|
// (vitest does not typecheck). The reverse is worse and silent: a field in the `.d.cts` and not
|
|
39
36
|
// here typechecks everywhere and arrives `undefined` in all five transforms. Change both, together.
|
|
40
37
|
/**
|
|
41
|
-
* @typedef {{ op: 'nullish', value: unknown } | { op: 'notFalse' }} IFoldOp
|
|
42
38
|
* @typedef {{ prop: string, intrinsic: string }} IIntrinsicWhen
|
|
43
|
-
* @typedef {{ intrinsic: string,
|
|
39
|
+
* @typedef {{ intrinsic: string, intrinsicWhen?: IIntrinsicWhen }} IHostPrimitive
|
|
44
40
|
*/
|
|
45
41
|
|
|
46
|
-
// `
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
// Text.js:222 const _nativeID = id ?? nativeID;
|
|
51
|
-
//
|
|
52
|
-
// Same outcome on both tags: `nativeID = id ?? nativeID`, and the raw `id` key must NOT reach
|
|
53
|
-
// Fabric (no ViewConfig declares it, so it is silently dropped). What the adapters actually did:
|
|
54
|
-
// Solid folded it on both tags, Svelte on View only (its `else` branch skips Text), and Vue on
|
|
55
|
-
// neither — not in either transform, not in its renderer, not in `routeProp`. Vue's gap is OLDER
|
|
56
|
-
// than lowering (its `View` wrapper was always a bare pass-through), so it is a standing
|
|
57
|
-
// <adapters_reach_full_feature_parity> miss, not a lowering regression.
|
|
58
|
-
//
|
|
59
|
-
// WHICH LAYER APPLIES IT IS THE ADAPTER'S CHOICE, exactly as for `defaults` below. Solid and
|
|
60
|
-
// Svelte rename at COMPILE time inside the lowering transform; Vue applies it at RUNTIME
|
|
61
|
-
// (`PROP_ALIASES` in `adapters/vue/src/renderer/index.ts`, in `patchProp`) because Vue has FOUR
|
|
62
|
-
// paths to a node — lowered SFC, lowered TSX, the component wrapper, and a hand-written
|
|
63
|
-
// `h('symbiote-view', {id})` — and compile time only covers two of them. A transform reading this
|
|
64
|
-
// spec must therefore not assume it owns the fold. Applying it at both layers happens to be
|
|
65
|
-
// harmless here (the rename deletes `id`, so the second pass sees nothing), but that is a property
|
|
66
|
-
// of THIS alias, not a licence.
|
|
67
|
-
//
|
|
68
|
-
// KNOWN DIVERGENCE FROM UPSTREAM, present in two adapters and not introduced by this file: when an
|
|
69
|
-
// element carries BOTH `id` and `nativeID`, RN gives `id` unconditional priority, while a per-key
|
|
70
|
-
// rename (Vue's runtime patchProp, Solid's compile-time rename producing two `nativeID`
|
|
71
|
-
// attributes) lets the LAST one win. Honest parity needs per-node state; no example and no test
|
|
72
|
-
// sets both today.
|
|
73
|
-
const ID_ALIAS = { id: 'nativeID' };
|
|
42
|
+
// `aliases` LEFT THIS SPEC ON 2026-09-18, and what it held was one pair — `id` -> `nativeID` —
|
|
43
|
+
// repeated on all nineteen entries. It is `routeProp`'s now
|
|
44
|
+
// (`core/engine/cpp/tests/js/id-alias-coverage.itest.ts`), which reaches every node rather than
|
|
45
|
+
// every REGISTERED one, and resolves precedence the way upstream does instead of by write order.
|
|
74
46
|
|
|
75
47
|
/** @type {Record<string, IHostPrimitive>} */
|
|
76
48
|
const HOST_PRIMITIVES = {
|
|
77
49
|
View: {
|
|
78
|
-
intrinsic: '
|
|
79
|
-
aliases: ID_ALIAS,
|
|
80
|
-
defaults: {},
|
|
50
|
+
intrinsic: 'view',
|
|
81
51
|
},
|
|
82
52
|
// The five-way switch, thrown 2026-08-23 once all three transforms carried the refusals
|
|
83
|
-
// (`observesState` below). `
|
|
53
|
+
// (`observesState` below). `pressable` resolves to the SAME `RCTView` a plain view does
|
|
84
54
|
// — the tag exists only so the host-behavior registry, which is keyed by TAG and never by
|
|
85
55
|
// resolved name, can find the press machine.
|
|
86
56
|
//
|
|
87
|
-
// No defaults
|
|
88
|
-
//
|
|
89
|
-
// time. (This read "No aliases and no defaults" while the line below already said `ID_ALIAS`, and
|
|
90
|
-
// a Solid test injected a `Pressable` entry with `aliases: {}` on the strength of it.)
|
|
57
|
+
// No defaults: the tag forwards its props untouched, and the machine reads them off `node.props`
|
|
58
|
+
// at event time.
|
|
91
59
|
Pressable: {
|
|
92
|
-
intrinsic: '
|
|
93
|
-
aliases: ID_ALIAS,
|
|
94
|
-
defaults: {},
|
|
60
|
+
intrinsic: 'pressable',
|
|
95
61
|
// Turns on `stateInTemplate` and `renderPropChild`. Without them a render-prop button becomes
|
|
96
62
|
// a tag with no machine — the whole reason this entry landed last.
|
|
97
63
|
observesState: true,
|
|
98
64
|
},
|
|
65
|
+
// The three that were WITHHELD until their wrappers collapsed, landed 2026-09-11 now that none
|
|
66
|
+
// exists on any adapter. The condition the old note stated — "it lands when the wrappers collapse
|
|
67
|
+
// to a forwarder over the tag" — was met by deleting them outright.
|
|
68
|
+
//
|
|
69
|
+
// What the entry buys, since the tag and its behavior already worked without one: a hand-written
|
|
70
|
+
// `<scroll-view>` was resolving as a COMPONENT on Vue, because `adapters/vue/intrinsic-tags.cjs`
|
|
71
|
+
// derives its element set from this table and both Vue compilers read it. Missing here, the tag
|
|
72
|
+
// cost a dev-mode resolve warning per element plus the component codegen path — a slot closure
|
|
73
|
+
// instead of `_createElementBlock`.
|
|
74
|
+
TouchableOpacity: {
|
|
75
|
+
intrinsic: 'touchable-opacity',
|
|
76
|
+
},
|
|
77
|
+
TouchableHighlight: {
|
|
78
|
+
intrinsic: 'touchable-highlight',
|
|
79
|
+
},
|
|
80
|
+
// The second primitive whose TAG depends on a prop, and the first where the prop is one RN's own
|
|
81
|
+
// API takes (`<ScrollView horizontal>`): the axis is a SEPARATE native ViewManager, not a flag on
|
|
82
|
+
// one view (`behaviors/scroll-view/shared.ts:131`). So an app may write either spelling and
|
|
83
|
+
// `resolveIntrinsicTag` picks the view, which is also what puts `horizontal-scroll-view` into
|
|
84
|
+
// Vue's element set — a tag apps write directly and which would otherwise resolve as a component.
|
|
85
|
+
ScrollView: {
|
|
86
|
+
intrinsic: 'scroll-view',
|
|
87
|
+
intrinsicWhen: {
|
|
88
|
+
prop: 'horizontal',
|
|
89
|
+
intrinsic: 'horizontal-scroll-view',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
99
92
|
// Landed 2026-08-31, on the second attempt. The first threw the switch with the runtime half
|
|
100
93
|
// unwired and was reverted the same hour; both gaps it exposed are closed here, and the record is
|
|
101
94
|
// kept because the SEQUENCE is the reusable part — an entry here is a switch for four transforms
|
|
102
95
|
// at once, so it goes in after every side is ready, never to prove the transforms work.
|
|
103
96
|
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
// exists there and neither carries a `register.ts` — the same reason they skip Pressable's.
|
|
107
|
-
//
|
|
108
|
-
// 2. The component path no longer shares these tags. It renders `symbiote-text-input-managed`
|
|
109
|
-
// (`component-names/shared.ts`), because the registry is keyed by TAG and the wrappers run the
|
|
110
|
-
// same machine in their own lifecycle — one shared tag would have installed both copies on a
|
|
111
|
-
// wrapper-built node and fired `setInputFocused` twice per focus.
|
|
97
|
+
// `registerTextInputBehavior()` is called by every adapter's `src/register.ts`: the tag is the
|
|
98
|
+
// only path an app has, so the machine has exactly one owner per node.
|
|
112
99
|
TextInput: {
|
|
113
|
-
intrinsic: '
|
|
114
|
-
aliases: ID_ALIAS,
|
|
115
|
-
defaults: {},
|
|
100
|
+
intrinsic: 'text-input',
|
|
116
101
|
// `multiline` picks between two SEPARATE native views, not one view with a flag, so the tag is
|
|
117
102
|
// decided at compile time and a runtime selector must refuse — a wrong view here is
|
|
118
|
-
// uncorrectable by any later prop write.
|
|
103
|
+
// uncorrectable by any later prop write.
|
|
119
104
|
intrinsicWhen: {
|
|
120
105
|
prop: 'multiline',
|
|
121
|
-
intrinsic: '
|
|
106
|
+
intrinsic: 'text-input-multiline',
|
|
122
107
|
},
|
|
123
108
|
},
|
|
124
109
|
// Landed 2026-09-01, same order as TextInput and Image: runtime half built
|
|
125
|
-
// (`core/components/src/behaviors/switch.ts`), registered by
|
|
110
|
+
// (`core/components/src/behaviors/switch.ts`), registered by every adapter, proven
|
|
126
111
|
// against the wrapper's payload (positive + negative controls, a break-tested async-timing case)
|
|
127
112
|
// before this key existed.
|
|
128
113
|
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
// node — which already runs that same machine in its own lifecycle — must not also get the
|
|
132
|
-
// engine's copy. `render-switch.ts` emits `symbiote-switch-managed`; this key's `intrinsic` is
|
|
133
|
-
// the bare tag the behavior registry attaches to.
|
|
114
|
+
// The behavior carries a machine: it mirrors the last value native reported and sends a platform
|
|
115
|
+
// snap-back command on disagreement.
|
|
134
116
|
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
// `-managed` split means only the bare `symbiote-switch` tag ever carries this behavior, and the
|
|
141
|
-
// wrapper never emits that tag, so no node's payload ever passes through this fold more than
|
|
142
|
-
// once. Unreachable by construction, not idempotent by property — the same distinction
|
|
143
|
-
// TextInput's own entry draws for its fold.
|
|
117
|
+
// ITS FOLD IS NOT IDEMPOTENT, and that is safe for a reason Image's entry does not share. Switch
|
|
118
|
+
// maps `trackColor`/`thumbColor`/`ios_backgroundColor` onto native prop names keyed on
|
|
119
|
+
// `Platform.OS`, so running it twice would NOT be a no-op — the question never arises because a
|
|
120
|
+
// payload reaches this fold once, on the one tag that carries the behavior. Unreachable by
|
|
121
|
+
// construction, not idempotent by property.
|
|
144
122
|
//
|
|
145
123
|
// No `observesState`: nothing in Switch's public surface is a function-valued style or a
|
|
146
124
|
// render-prop child (`style?: IStyleProp<IViewStyle>`, never a callback), so neither
|
|
147
125
|
// `stateInTemplate` nor `renderPropChild` applies — unlike Pressable, whose machine is what
|
|
148
126
|
// forced that flag.
|
|
149
127
|
Switch: {
|
|
150
|
-
intrinsic: '
|
|
151
|
-
aliases: ID_ALIAS,
|
|
152
|
-
defaults: {},
|
|
128
|
+
intrinsic: 'switch',
|
|
153
129
|
},
|
|
130
|
+
// Filed as NOT LOWERABLE for a week under `.claude/rules/host-primitive-tier.md`'s "SECOND
|
|
131
|
+
// disqualifier" — its own node is a single element, but its POSITION is decided by the ScrollView
|
|
132
|
+
// and differs per platform (iOS a sibling before the content view, Android the scroll view's
|
|
133
|
+
// PARENT), and a per-node behavior cannot own a decision another component makes.
|
|
134
|
+
//
|
|
135
|
+
// That is settled and it was settled elsewhere: the ScrollView states the placement as DATA
|
|
136
|
+
// (`claimedChildren: { [REFRESH_CONTROL]: platform.claimMode }`, `behaviors/scroll-view/shared.ts`)
|
|
137
|
+
// and the ENGINE moves the node in `appendChild`. So the claim needs nothing from this primitive's
|
|
138
|
+
// own behavior — verified on a bare node with no wrapper anywhere, both platforms, in
|
|
139
|
+
// `behaviors/refresh-control.test.ts`.
|
|
140
|
+
//
|
|
141
|
+
// What the behavior owes is therefore only the CONTROLLED HANDSHAKE, and no fold at all: four of
|
|
142
|
+
// the five wrappers folded exactly `resolveAccessibilityProps`, which the engine already runs at
|
|
143
|
+
// `fabricProps` on every path — the same reason SafeAreaView has no behavior file.
|
|
144
|
+
//
|
|
145
|
+
// `id` is declared on all five wrappers, which it was not until 2026-09-01: upstream's
|
|
146
|
+
// RefreshControl spreads `...ViewProps` (RefreshControl.js:70), so its absence was a parity gap
|
|
147
|
+
// rather than a decision. The rename itself is the engine's.
|
|
148
|
+
RefreshControl: {
|
|
149
|
+
intrinsic: 'refresh-control',
|
|
150
|
+
// None. RN seeds nothing: `refreshing` is required, and every other prop is per-platform
|
|
151
|
+
// styling the native view defaults itself.
|
|
152
|
+
},
|
|
153
|
+
// `defaults` LEFT THIS SPEC ON 2026-09-18, and Text was the last entry that had any — RN's
|
|
154
|
+
// `ellipsizeMode ?? 'tail'` and `allowFontScaling !== false` (`Text.js:289,291`). The other
|
|
155
|
+
// eighteen entries had declared `{}` for months.
|
|
156
|
+
//
|
|
157
|
+
// It was the THIRD copy of that one rule. `applyTextDefaults` (`core/engine/src/fabric-props.ts`)
|
|
158
|
+
// and its C++ twin apply both to every node committing as `RCTText`, whoever authored it and
|
|
159
|
+
// whatever tag it carries — strictly WIDER than this table, which reached only a registered
|
|
160
|
+
// primitive. Proven redundant rather than argued: emptying it turned ZERO itests red, and the
|
|
161
|
+
// itests are the side that reads a real committed payload.
|
|
154
162
|
Text: {
|
|
155
|
-
intrinsic: '
|
|
156
|
-
aliases: ID_ALIAS,
|
|
157
|
-
// RN's Text.js applies both unconditionally on the non-virtual path. Each key below cites
|
|
158
|
-
// the upstream line verbatim, because THIS DATA is now the thing that must not drift from RN.
|
|
159
|
-
// The
|
|
160
|
-
// authority on what they MEAN is `src/text-props.ts`'s resolveTextProps, which every wrapper
|
|
161
|
-
// path already calls; this is the same fold expressed as data so a COMPILE-time transform can
|
|
162
|
-
// emit it too. `notFalse`, never `nullish` — RN treats an explicit `undefined` like a missing
|
|
163
|
-
// prop and only a literal `false` opts out. Emit both keys unconditionally: a fold whose two
|
|
164
|
-
// branches emit different key sets is the hazard `.claude/rules/solid-descriptor-bridge.md` §1
|
|
165
|
-
// exists for.
|
|
166
|
-
defaults: {
|
|
167
|
-
// Text.js:291 processedProps.ellipsizeMode = ellipsizeMode ?? 'tail';
|
|
168
|
-
ellipsizeMode: { op: 'nullish', value: 'tail' },
|
|
169
|
-
// Text.js:289 processedProps.allowFontScaling = allowFontScaling !== false;
|
|
170
|
-
allowFontScaling: { op: 'notFalse' },
|
|
171
|
-
},
|
|
163
|
+
intrinsic: 'text',
|
|
172
164
|
},
|
|
173
165
|
// FOLD-ONLY: the behavior registered for this tag carries a prop fold and nothing else — no
|
|
174
|
-
// listeners, no commit hook, no per-node runtime (`core/components/src/behaviors/image.ts`).
|
|
175
|
-
// whole of the wrapper's body was prop mapping, so the lowered form owes exactly that.
|
|
166
|
+
// listeners, no commit hook, no per-node runtime (`core/components/src/behaviors/image.ts`).
|
|
176
167
|
//
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
// already emits means a wrapper-built node simply folds a second time to no effect. Asserted in
|
|
180
|
-
// `behaviors/image.test.ts`; break-tested. TextInput's split is NOT about idempotence (its fold
|
|
181
|
-
// is idempotent too) — it is about one owner per node, because that behavior carries a machine.
|
|
168
|
+
// `mapImageProps` is idempotent, asserted in `behaviors/image.test.ts` and break-tested, so a bag
|
|
169
|
+
// that reaches the fold twice folds to no effect.
|
|
182
170
|
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
171
|
+
// The runtime half has to land before this key does: without the fold a raw `src` reaches Fabric,
|
|
172
|
+
// a key no ViewConfig declares, which throws nothing and paints nothing.
|
|
173
|
+
// THE ENTRY IS NOT OPTIONAL HERE, and the reason has nothing to do with folds: this table is what
|
|
174
|
+
// `adapters/vue/intrinsic-tags.cjs` derives element-vs-component from, and a hyphenated tag it
|
|
175
|
+
// does not name compiles to `resolveComponent("image-background")` — children become a slot the
|
|
176
|
+
// element path never reads, so the subtree renders BLANK with no error. `image`/`view`/`text` are
|
|
177
|
+
// real SVG element names and survive that gap; this one is not.
|
|
178
|
+
ImageBackground: {
|
|
179
|
+
intrinsic: 'image-background',
|
|
180
|
+
// None. The absolute-fill style, the box-dimension proxy and the Image mapping are all derived
|
|
181
|
+
// from live props at commit, which a compile-time seed cannot express.
|
|
182
|
+
},
|
|
187
183
|
Image: {
|
|
188
|
-
intrinsic: '
|
|
189
|
-
aliases: ID_ALIAS,
|
|
184
|
+
intrinsic: 'image',
|
|
190
185
|
// None. Every default RN's Image applies is already inside the shared mapping (the source
|
|
191
186
|
// array shape, the width/height style fold, `alt` -> accessibilityLabel), which the behavior
|
|
192
187
|
// runs at commit — so there is nothing left for a compile-time seed to do.
|
|
193
|
-
defaults: {},
|
|
194
188
|
},
|
|
195
|
-
// Entered LAST, same order Image used: runtime half built, registered by the four lowering
|
|
196
|
-
// adapters, and proven against the wrapper's payload before this key existed.
|
|
197
|
-
//
|
|
198
189
|
// The ONLY primitive so far whose intrinsic resolves to a different Fabric component per
|
|
199
190
|
// platform — `RCTInputAccessoryView` on iOS, a plain `RCTView` on Android. The fold is
|
|
200
|
-
// platform-invariant on purpose
|
|
201
|
-
//
|
|
202
|
-
//
|
|
203
|
-
// identical on both paths, and is with the owner as its own decision.
|
|
191
|
+
// platform-invariant on purpose; what it does NOT do is repair what sits underneath, where
|
|
192
|
+
// upstream RN renders nothing at all off iOS. That divergence is with the owner as its own
|
|
193
|
+
// decision.
|
|
204
194
|
InputAccessoryView: {
|
|
205
|
-
intrinsic: '
|
|
206
|
-
aliases: ID_ALIAS,
|
|
195
|
+
intrinsic: 'input-accessory-view',
|
|
207
196
|
// None. The mapping has no aliasing and no derived value — every consumed name leaves under the
|
|
208
197
|
// same name — so there is nothing for a compile-time seed to do.
|
|
209
|
-
defaults: {},
|
|
210
198
|
},
|
|
211
199
|
// The emptiest entry here, and deliberately so — the withholding protocol has nothing to protect
|
|
212
200
|
// for this one. Every other primitive was held back until its runtime half existed and was proven
|
|
@@ -218,163 +206,73 @@ const HOST_PRIMITIVES = {
|
|
|
218
206
|
//
|
|
219
207
|
// Counted before writing, which is the only thing standing behind that claim: five
|
|
220
208
|
// implementations, zero shared, none synthesizing a node — each renders ONE
|
|
221
|
-
// `
|
|
209
|
+
// `safe-area-view` with children on its framework's own channel (React's third argument,
|
|
222
210
|
// a Vue slot, a Solid JSX child, Angular's `<ng-content>`, a Svelte snippet). That clears the
|
|
223
211
|
// disqualifier in `.claude/rules/host-primitive-tier.md`.
|
|
224
|
-
//
|
|
225
|
-
// NO `ID_ALIAS`, and this is the one place SafeAreaView departs from every entry above it. The
|
|
226
|
-
// alias exists to REPRODUCE a fold the wrapper performs; not one of the five SafeAreaView wrappers
|
|
227
|
-
// folds `id`, and none declares it. Adding the alias here would make the lowered element fold a
|
|
228
|
-
// prop its component spelling passes through untouched — a lowering that ADDS a capability, which
|
|
229
|
-
// `.claude/rules/adapter-parity-audit.md` records as a bug in the same way as one that drops it.
|
|
230
|
-
// That the five entries above all share `ID_ALIAS` is a property of those five primitives, not a
|
|
231
|
-
// house style to copy: the sixth is where "every case so far did X" stops being a rule.
|
|
232
|
-
//
|
|
233
|
-
// The `id` surface gap itself is real and PRE-EXISTING — upstream's SafeAreaView takes `ViewProps`,
|
|
234
|
-
// so RN accepts `id` where our wrappers do not. It predates lowering, is identical on both paths,
|
|
235
|
-
// and closing it means adding `id` to five wrappers AND this alias together, never one of the two.
|
|
236
212
|
SafeAreaView: {
|
|
237
|
-
intrinsic: '
|
|
238
|
-
// ID_ALIAS was deliberately ABSENT here until 2026-09-01, because none of the five wrappers
|
|
239
|
-
// declared `id` and aliasing on the lowered path alone would have made lowering ADD a fold the
|
|
240
|
-
// component spelling does not perform. That exposed a real divergence — Solid's renderer folds
|
|
241
|
-
// `id` from two string constants on the write path, so it aliased for a primitive whose spec
|
|
242
|
-
// said not to (`adapters/solid/src/renderer-alias-fold.test.ts`, whose header predicted exactly
|
|
243
|
-
// this the day a primitive stopped sharing the pair).
|
|
244
|
-
//
|
|
245
|
-
// Resolved by closing the gap rather than routing around it: `id` is now declared on all five
|
|
246
|
-
// wrappers and folded here. That keeps Solid's constant-pair fast path (32 001 writes on a
|
|
247
|
-
// benchmark create) and removes a real parity deficit — upstream's SafeAreaView takes the full
|
|
248
|
-
// ViewProps surface, so RN accepts `id` where none of ours did. Half of this is not an option
|
|
249
|
-
// in either direction: the alias without the prop folds a key nobody can pass, and the prop
|
|
250
|
-
// without the alias sends a raw `id` to a view whose ViewConfig declares no such key.
|
|
251
|
-
aliases: ID_ALIAS,
|
|
252
|
-
defaults: {},
|
|
213
|
+
intrinsic: 'safe-area-view',
|
|
253
214
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
//
|
|
257
|
-
//
|
|
258
|
-
//
|
|
259
|
-
//
|
|
260
|
-
// Refusing is always safe: a refused element simply keeps today's behaviour. Guessing is not — a
|
|
261
|
-
// half-read attribute set is a silently wrong render, on device only. Design every new category
|
|
262
|
-
// around that asymmetry.
|
|
263
|
-
// A stateful primitive carries `observesState: true`, and that flag is what turns the two refusal
|
|
264
|
-
// categories below ON in a transform. Declared in one place so five transforms agree on the
|
|
265
|
-
// spelling rather than inventing five.
|
|
266
|
-
//
|
|
267
|
-
// ADDING A STATEFUL ENTRY TO HOST_PRIMITIVES IS A FIVE-WAY SWITCH and must be the LAST step. Every
|
|
268
|
-
// transform lowers whatever the spec lists, so an entry that lands before a transform can refuse
|
|
269
|
-
// turns a render-prop button into a tag with no machine: a button that does not press, with nothing
|
|
270
|
-
// red in any suite. `Pressable` was held back for exactly that and thrown only once all three
|
|
271
|
-
// transforms carried the detections — verified by grep for `observesState` in
|
|
272
|
-
// adapters/{solid,vue}/*.cjs and adapters/svelte/src/preprocessor/, not by asking.
|
|
273
|
-
const REFUSAL_CATEGORIES = {
|
|
274
|
-
// `{...spread}` / `v-bind="obj"` — the attribute set cannot be read whole.
|
|
275
|
-
unreadableAttributeSet: 'an attribute set this transform cannot enumerate',
|
|
276
|
-
// A computed or otherwise non-literal attribute KEY.
|
|
277
|
-
unreadableKey: 'an attribute key this transform cannot resolve to a string',
|
|
278
|
-
// A value shape the transform cannot reproduce in the lowered form.
|
|
279
|
-
unreadableValue: 'an attribute value this transform cannot read whole',
|
|
280
|
-
// `bind:` / `use:` / `{@attach}` / a template ref — binds the COMPONENT INSTANCE, which a
|
|
281
|
-
// lowered element does not have.
|
|
282
|
-
instanceBoundDirective:
|
|
283
|
-
'a directive that binds the component instance, not the host node',
|
|
284
|
-
// RETIRED 2026-08-31 — `bagFold`, "an attribute whose fold needs to see its siblings (role,
|
|
285
|
-
// aria-*)". Kept as a comment because the retirement carries two lessons the entry itself never
|
|
286
|
-
// could.
|
|
287
|
-
//
|
|
288
|
-
// WHY IT IS GONE. The aria fold moved into the engine — `core/engine/src/accessibility-props.ts`,
|
|
289
|
-
// called from `fabricProps`, the one point where the whole bag is known on BOTH commit paths — so
|
|
290
|
-
// a lowered element gets it exactly like a wrapped one. The premise that a per-key element path
|
|
291
|
-
// cannot fold a composite was right; the conclusion that a TRANSFORM had to refuse was not. The
|
|
292
|
-
// fold belongs at the layer every path goes through, not at the one layer lowering removes.
|
|
215
|
+
// The one primitive that commits NO NODE: its intrinsic resolves to the engine's anchor, and the
|
|
216
|
+
// behavior (`src/behaviors/touchable-native-feedback.ts`) clones the owner's props onto the single
|
|
217
|
+
// child instead — RN's own shape (TouchableNativeFeedback.js:289,339). Entered in the same commit
|
|
218
|
+
// that deletes the five wrappers, because the registry is keyed by TAG: a wrapper still emitting
|
|
219
|
+
// its own `pressable` while the behavior is registered would put two press machines on one tree.
|
|
293
220
|
//
|
|
294
|
-
//
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
//
|
|
301
|
-
//
|
|
302
|
-
//
|
|
303
|
-
//
|
|
304
|
-
//
|
|
305
|
-
// The two below exist for a STATEFUL primitive (Pressable) and nothing refuses on them yet.
|
|
306
|
-
// They are declared ahead of the spec entry on purpose: the moment a stateful tag appears in
|
|
307
|
-
// HOST_PRIMITIVES, every transform lowers it, and a transform that cannot yet refuse lowers a
|
|
308
|
-
// render-prop button into a tag with no machine — a button that does not press, with nothing
|
|
309
|
-
// red anywhere. So the spec entry goes in LAST, after all five can refuse, and the names live
|
|
310
|
-
// here from the start so five detections do not invent five spellings of one rule.
|
|
311
|
-
//
|
|
312
|
-
// A functional `style` — `style={({pressed}) => …}`. The TEMPLATE reads the press state, which
|
|
313
|
-
// is exactly what tier 2 cannot do: the state resolves below the framework, through the style
|
|
314
|
-
// registry's `:active`, and never crosses back up. The migration target is a `:active` CSS rule,
|
|
315
|
-
// not a smarter transform (`.claude/rules/host-primitive-tier.md`).
|
|
221
|
+
// No `defaults`: RN's TNF seeds nothing at all — every value it derives (`accessible`,
|
|
222
|
+
// `focusable`, `accessibilityState`, the ripple background) depends on ANOTHER prop or on a
|
|
223
|
+
// listener, which is a fold and not a default.
|
|
224
|
+
TouchableNativeFeedback: {
|
|
225
|
+
intrinsic: 'touchable-native-feedback',
|
|
226
|
+
},
|
|
227
|
+
// The SECOND primitive that commits no node, same anchor shape and same reason
|
|
228
|
+
// (TouchableWithoutFeedback.js:229,286). Its clone list is not TNF's: the passthrough half is
|
|
229
|
+
// copied only when SET (:281), there is no ripple, and `onBlur`/`onFocus` are cloned where TNF
|
|
230
|
+
// drops them — read `src/behaviors/touchable-without-feedback.ts`'s header rather than inheriting
|
|
231
|
+
// the neighbour's fold.
|
|
316
232
|
//
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
//
|
|
321
|
-
//
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
//
|
|
326
|
-
//
|
|
233
|
+
// Upstream's passthrough loop lets an explicit `nativeID` win over `id` here (:280-284, unlike
|
|
234
|
+
// TNF's :373); NOT reproduced — the engine resolves that precedence once, on the way in, and a
|
|
235
|
+
// per-primitive exception to it would be invisible from anywhere the app can see. No `defaults`:
|
|
236
|
+
// every value TWF derives depends on another prop or on a listener, which is a fold and not a
|
|
237
|
+
// default.
|
|
238
|
+
TouchableWithoutFeedback: {
|
|
239
|
+
intrinsic: 'touchable-without-feedback',
|
|
240
|
+
},
|
|
241
|
+
// RN's Button is a touchable wrapping a View wrapping a Text and takes NO children — `title` is a
|
|
242
|
+
// string prop (Button.js:363-388) — so the behavior owns the whole subtree and the tag is the
|
|
243
|
+
// only spelling. Entered in the same commit that deletes the five wrappers: the registry is keyed
|
|
244
|
+
// by TAG, and a wrapper still building its own View/Text under a registered `button` would give
|
|
245
|
+
// every existing Button a second copy of the subtree.
|
|
327
246
|
//
|
|
328
|
-
//
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
// `style={bag[i]}` evaluates the index three times, and `style={flag ? a : b}` can take
|
|
332
|
-
// different branches on different reads. Faced with that, the first instinct is to refuse those
|
|
333
|
-
// shapes.
|
|
247
|
+
// `id` used to be PLATFORM-DEPENDENT here, and the record is worth keeping because it is what a
|
|
248
|
+
// per-primitive rename costs. Button's touchable is swapped by platform (Button.js:281-284), only
|
|
249
|
+
// the iOS arm renamed `id` itself, and with no entry in this table the committed payload read:
|
|
334
250
|
//
|
|
335
|
-
//
|
|
336
|
-
//
|
|
337
|
-
// the expression: wrap once — `resolveStateStyle(expr)` — and the expression is evaluated
|
|
338
|
-
// exactly once while its RESULT is what gets called twice. All three shapes above then lower and
|
|
339
|
-
// stay correct.
|
|
251
|
+
// iOS nativeID: 'from-id' id: absent the touchable-opacity fold
|
|
252
|
+
// Android nativeID: undefined id: 'from-id' a key no ViewConfig declares -> dropped
|
|
340
253
|
//
|
|
341
|
-
//
|
|
342
|
-
// on the output text (`occurrences(out, expr) === 1`) rather than trusting the shape. What
|
|
343
|
-
// survives as a real contract is only that the callback must be PURE in `pressed` — its result is
|
|
344
|
-
// invoked twice under any emission.
|
|
254
|
+
// A rename that runs once, for every node, on the way in cannot produce that shape at all.
|
|
345
255
|
//
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
//
|
|
355
|
-
//
|
|
356
|
-
// cannot yet refuse would pick the WRONG Fabric view. Four detections written against a name that
|
|
357
|
-
// already exists cannot invent four spellings of one rule.
|
|
256
|
+
// No `defaults`: every value RN's Button seeds is derived from another prop or from a listener
|
|
257
|
+
// (`accessible`, `focusable`, the greyed label, the uppercased title), which is a fold, not a
|
|
258
|
+
// default.
|
|
259
|
+
Button: {
|
|
260
|
+
intrinsic: 'button',
|
|
261
|
+
},
|
|
262
|
+
// RN wraps the native spinner in a centering `<View>` (ActivityIndicator.js:112), so this tag is
|
|
263
|
+
// that View and the behavior builds `activity-indicator-spinner` under it. Entered in the same
|
|
264
|
+
// commit that deletes the five wrappers: the registry is keyed by TAG, and a wrapper still
|
|
265
|
+
// painting its own spinner while the behavior is registered would give every indicator two.
|
|
358
266
|
//
|
|
359
|
-
// `
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
// tag name, so it can resolve `multiline` only when the value is a literal. `multiline={isLong}`
|
|
363
|
-
// is a RUNTIME value and there is no tag to print — the element must stay a component.
|
|
267
|
+
// `id` renames on the OWNER, before `slotPropsExcept` routes the survivor down — so the key that
|
|
268
|
+
// reaches the spinner is `nativeID`, which is where RN's `...restProps` puts it too
|
|
269
|
+
// (ActivityIndicator.js:99).
|
|
364
270
|
//
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
|
|
369
|
-
'
|
|
271
|
+
// No `defaults`: `animating` and `hidesWhenStopped` ARE `notFalse` folds, but they belong to the
|
|
272
|
+
// SPINNER, and this table's ops are applied to the tag's own bag before any slot routing. They
|
|
273
|
+
// live in the behavior's spinner fold instead, which is the only layer that can see that node.
|
|
274
|
+
ActivityIndicator: {
|
|
275
|
+
intrinsic: 'activity-indicator',
|
|
276
|
+
},
|
|
370
277
|
};
|
|
371
|
-
|
|
372
|
-
// Lowering rewrites `class="x"` into an opaque bag expression, so any pass that matches on literal
|
|
373
|
-
// attributes can no longer see it. Reversed against Svelte's style scoper, every scoped class
|
|
374
|
-
// silently stopped being scoped — nothing threw, the styles just stopped applying on device. The
|
|
375
|
-
// hazard belongs to any transform that folds attributes into an expression, not to Svelte, so it
|
|
376
|
-
// is stated once here as an ordering contract.
|
|
377
|
-
const LOWERING_RUNS_LAST =
|
|
378
|
-
'lowering is the LAST attribute-rewriting pass in its pipeline';
|
|
379
|
-
|
|
380
|
-
module.exports = { HOST_PRIMITIVES, REFUSAL_CATEGORIES, LOWERING_RUNS_LAST };
|
|
278
|
+
module.exports = { HOST_PRIMITIVES };
|
package/host-primitives.d.cts
CHANGED
|
@@ -6,7 +6,6 @@ export type IFoldOp = { op: 'nullish'; value: unknown } | { op: 'notFalse' };
|
|
|
6
6
|
|
|
7
7
|
export interface IHostPrimitive {
|
|
8
8
|
intrinsic: string;
|
|
9
|
-
aliases: Readonly<Record<string, string>>;
|
|
10
9
|
defaults: Readonly<Record<string, IFoldOp>>;
|
|
11
10
|
/**
|
|
12
11
|
* The primitive's own state is observable from the TEMPLATE, so a call site that reads it
|
|
@@ -31,5 +30,3 @@ export interface IHostPrimitive {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
export declare const HOST_PRIMITIVES: Readonly<Record<string, IHostPrimitive>>;
|
|
34
|
-
export declare const REFUSAL_CATEGORIES: Readonly<Record<string, string>>;
|
|
35
|
-
export declare const LOWERING_RUNS_LAST: string;
|