feat: add live JSX markers and custom cluster rendering - #74
feat: add live JSX markers and custom cluster rendering#74piotr-graczyk-dev wants to merge 11 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
|
React Doctor found 10 issues in 5 files · 2 errors & 8 warnings · score 64 / 100 (Needs work) · full project Errors
8 warnings
Reviewed by React Doctor for commit |
| }, [markers, markerViewEntries]); | ||
| const visibleMarkerViews = useMemo(() => { | ||
| const ids = new Set(markerViewState?.markerViewIds); | ||
| return markerViewEntries |
There was a problem hiding this comment.
React Doctor · react-doctor/js-combine-iterations (warning)
This loops over your list twice because .filter().map() makes two passes, so do it in one pass with .reduce() or a for...of loop
Fix → Combine .map().filter() style chains into one pass with .reduce() or a for...of loop, so you only loop over the list once
| ); | ||
| } | ||
|
|
||
| export function validateMarkerViewProps({ |
There was a problem hiding this comment.
React Doctor · react-doctor/only-export-components (warning)
This file exports non-components, so Fast Refresh can't safely preserve component state.
Fix → Move non-component exports out of component files so Fast Refresh can preserve component state instead of full-reloading.
| coordinate: { latitude: 52, longitude: 21 }, | ||
| width: 96, | ||
| height: 48, | ||
| children: null, |
There was a problem hiding this comment.
React Doctor · react-doctor/no-children-prop (warning)
A children prop can override or hide nested children, so the component may render different content than the JSX shows.
Fix → Nest children between the tags so the rendered content is visible in JSX and cannot be hidden inside a props object.
Markerchildren are serialized descriptors, so they cannot host live React Native content. AddMarkerViewwith fixed bounds, native coordinate projection, and Fabric-owned children for arbitrary JSX, stateful controls, and internal animations. No bitmap snapshots or per-frame JavaScript camera projection are used.Live markers now share the native clustering engine with descriptor markers.
renderClustersupplies arbitrary JSX cluster badges; clustered-away marker subtrees unmount to release their animation/layout work. The existing SDK badge remains the default. The change also handles native gesture ownership, clipping, host/provider lifecycle, generated Fabric child mounting, and optional Google iOS builds.Validation:
This is a draft because the performance acceptance gate remains open. Pre-clustering iPhone diagnostics show about 119 Hz callbacks for 200 static hosts, 117–120 Hz for transformed hosts, and 51–55 Hz for animated width; ordinary JSX overlays show the same width bottleneck. These callback rates are not presented map FPS, and the surface traces did not reproduce a sustained 120 FPS map baseline. The 24-case cluster workload passed functional checks on an isolated simulator. The final iPhone Release binary is built; a fresh device query still requires a passcode, so the physical cluster run remains pending. No unrestricted 120 FPS guarantee is claimed.
API and clustering contract · Device evidence and limitations · Reproduction
The example-only FrameStats harness is adapted from #66. Earlier duration-error measurements are retained separately and explicitly excluded from moving-camera acceptance.