@tamagui/native-registry 3.0.14 → 3.0.15
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/cpp/HybridTamaguiRegistry.cpp +5 -32
- package/cpp/HybridTamaguiRegistry.hpp +2 -2
- package/package.json +3 -3
- package/src/types.ts +1 -1
- package/types/types.d.ts +1 -1
- package/types/types.d.ts.map +1 -1
|
@@ -536,9 +536,7 @@ class MountThread {
|
|
|
536
536
|
|
|
537
537
|
} // namespace
|
|
538
538
|
|
|
539
|
-
// merge base + the named state's props for one view into `out`.
|
|
540
|
-
// view also syncs its family's native props so React re-commits of unchanged
|
|
541
|
-
// children merge our values instead of resurrecting a stale absorbed node.
|
|
539
|
+
// merge base + the named state's props for one view into `out`.
|
|
542
540
|
// returns false on a state miss.
|
|
543
541
|
bool HybridTamaguiRegistry::buildViewUpdate(LinkedView& view,
|
|
544
542
|
const std::string& stateName,
|
|
@@ -572,35 +570,10 @@ bool HybridTamaguiRegistry::buildViewUpdate(LinkedView& view,
|
|
|
572
570
|
return false;
|
|
573
571
|
}
|
|
574
572
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
// no ancestors during the transaction and are skipped safely
|
|
580
|
-
if (view.table) {
|
|
581
|
-
// React renders a table view with its scope's current state and the
|
|
582
|
-
// engine's clones take over React's handles, so nothing goes stale. a
|
|
583
|
-
// sticky copy would make RN re-parse the view's props on every clone
|
|
584
|
-
out[&family] = std::move(update);
|
|
585
|
-
return true;
|
|
586
|
-
}
|
|
587
|
-
std::lock_guard<std::mutex> lock(family.nativePropsMutex);
|
|
588
|
-
if (family.nativeProps_DEPRECATED) {
|
|
589
|
-
family.nativeProps_DEPRECATED->update(props);
|
|
590
|
-
} else {
|
|
591
|
-
family.nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(props);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// a null value means reset-to-default (a style key dropped by a media
|
|
595
|
-
// change): it must COMMIT as null so RawProps clears the prop, but must not
|
|
596
|
-
// stick in nativeProps_DEPRECATED or every future React render would keep
|
|
597
|
-
// re-clearing a key the render may now legitimately set
|
|
598
|
-
auto& sticky = *family.nativeProps_DEPRECATED;
|
|
599
|
-
for (const auto& item : props.items()) {
|
|
600
|
-
if (item.second.isNull()) sticky.erase(item.first.asString());
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
out[&family] = std::move(update);
|
|
573
|
+
// commitUpdates transfers the updated nodes to React's handles for both
|
|
574
|
+
// runtime and table links. sticky native props would make RN re-parse
|
|
575
|
+
// unchanged props on every state/children-only clone, including scrolls.
|
|
576
|
+
out[view.family.get()] = std::move(update);
|
|
604
577
|
return true;
|
|
605
578
|
}
|
|
606
579
|
|
|
@@ -144,8 +144,8 @@ class HybridTamaguiRegistry : public HybridTamaguiRegistrySpec {
|
|
|
144
144
|
// resolve the active state name for a scope: scope entry, else root
|
|
145
145
|
const std::string* activeStateName(const std::string& scopeId) const;
|
|
146
146
|
|
|
147
|
-
// merge base + named state props for one view into `out
|
|
148
|
-
//
|
|
147
|
+
// merge base + named state props for one view into `out`;
|
|
148
|
+
// returns false on a state miss
|
|
149
149
|
bool buildViewUpdate(LinkedView& view, const std::string& stateName,
|
|
150
150
|
LeafUpdates& out);
|
|
151
151
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/native-registry",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"description": "Generic native style registry: zero-re-render style updates via Fabric ShadowTree commits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@tamagui/build": "3.0.
|
|
49
|
+
"@tamagui/build": "3.0.15",
|
|
50
50
|
"react": "19.2.3",
|
|
51
51
|
"react-native": "0.87.1",
|
|
52
52
|
"react-native-nitro-modules": "0.37.1",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"releaseSourceCommit": "
|
|
80
|
+
"releaseSourceCommit": "181782eb92d59e1a0c5b235070f58003af6a1280"
|
|
81
81
|
}
|
package/src/types.ts
CHANGED
|
@@ -53,6 +53,6 @@ export interface ViewStateSnapshot {
|
|
|
53
53
|
activeState: string
|
|
54
54
|
base: Record<string, unknown> | null
|
|
55
55
|
states: Record<string, Record<string, unknown>> | null
|
|
56
|
-
/** the family's
|
|
56
|
+
/** the family's nativeProps_DEPRECATED, which only RN's setNativeProps writes; null when unset */
|
|
57
57
|
nativeProps: Record<string, unknown> | null
|
|
58
58
|
}
|
package/types/types.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface ViewStateSnapshot {
|
|
|
48
48
|
activeState: string;
|
|
49
49
|
base: Record<string, unknown> | null;
|
|
50
50
|
states: Record<string, Record<string, unknown>> | null;
|
|
51
|
-
/** the family's
|
|
51
|
+
/** the family's nativeProps_DEPRECATED, which only RN's setNativeProps writes; null when unset */
|
|
52
52
|
nativeProps: Record<string, unknown> | null;
|
|
53
53
|
}
|
|
54
54
|
|
package/types/types.d.ts.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"/**\n * Slot props for one linked view.\n *\n * v1 implements two slot kinds: `base` (state-independent props, applied\n * under every state) and `state` (props keyed by state name, e.g. theme\n * name; the scope's active name selects which entry applies). Future kinds\n * (media, press, group, container) extend this shape; the engine merge\n * order is fixed: base, then state, then future kinds.\n *\n * Keys must be exhaustive for every state name the scope can take. The\n * engine does exact lookups only: no fallback chains, no name parsing. A\n * miss increments the engine's miss counter and is a bug in the emitter.\n */\nexport interface ViewSlots {\n base?: Record<string, unknown>\n state?: Record<string, Record<string, unknown>>\n}\n\nexport interface RegistryStats {\n viewCount: number\n commitCount: number\n missCount: number\n}\n\n/** Returned by link(); call to unlink. Safe to call more than once. */\nexport type Unlink = () => void\n\n/**\n * Handle for a linked view. `id` addresses the view in batched per-view\n * operations (applyViewStates); `unlink` removes it. null when the ref had\n * no shadow node (never mounted) or the engine is unavailable (web).\n */\nexport interface LinkHandle {\n id: number\n unlink: Unlink\n}\n\n/**\n * One entry of a batched per-view state update. When `props` is present it\n * is merged into the view's state table under `state` first (lazy warm-up\n * for runtime integrations); the view's active state then becomes `state`\n * and all entries commit natively in one transaction.\n */\nexport interface ViewStateUpdate {\n id: number\n state: string\n props?: Record<string, unknown>\n}\n\n/** Debug/test snapshot of a linked view's engine tables (getViewState). */\nexport interface ViewStateSnapshot {\n scopeId: string\n activeState: string\n base: Record<string, unknown> | null\n states: Record<string, Record<string, unknown>> | null\n /** the family's
|
|
9
|
+
"/**\n * Slot props for one linked view.\n *\n * v1 implements two slot kinds: `base` (state-independent props, applied\n * under every state) and `state` (props keyed by state name, e.g. theme\n * name; the scope's active name selects which entry applies). Future kinds\n * (media, press, group, container) extend this shape; the engine merge\n * order is fixed: base, then state, then future kinds.\n *\n * Keys must be exhaustive for every state name the scope can take. The\n * engine does exact lookups only: no fallback chains, no name parsing. A\n * miss increments the engine's miss counter and is a bug in the emitter.\n */\nexport interface ViewSlots {\n base?: Record<string, unknown>\n state?: Record<string, Record<string, unknown>>\n}\n\nexport interface RegistryStats {\n viewCount: number\n commitCount: number\n missCount: number\n}\n\n/** Returned by link(); call to unlink. Safe to call more than once. */\nexport type Unlink = () => void\n\n/**\n * Handle for a linked view. `id` addresses the view in batched per-view\n * operations (applyViewStates); `unlink` removes it. null when the ref had\n * no shadow node (never mounted) or the engine is unavailable (web).\n */\nexport interface LinkHandle {\n id: number\n unlink: Unlink\n}\n\n/**\n * One entry of a batched per-view state update. When `props` is present it\n * is merged into the view's state table under `state` first (lazy warm-up\n * for runtime integrations); the view's active state then becomes `state`\n * and all entries commit natively in one transaction.\n */\nexport interface ViewStateUpdate {\n id: number\n state: string\n props?: Record<string, unknown>\n}\n\n/** Debug/test snapshot of a linked view's engine tables (getViewState). */\nexport interface ViewStateSnapshot {\n scopeId: string\n activeState: string\n base: Record<string, unknown> | null\n states: Record<string, Record<string, unknown>> | null\n /** the family's nativeProps_DEPRECATED, which only RN's setNativeProps writes; null when unset */\n nativeProps: Record<string, unknown> | null\n}\n"
|
|
10
10
|
]
|
|
11
11
|
}
|