Skip to content

Spike: PoC Tamagui as the combined primitives + styling choice for #578/#591 #629

Description

@gaidheal1

Summary

#591 (styling spike) and #579 (primitives spike, #578) were coordinated but answered somewhat independently: #579 recommended @rn-primitives specifically because it's style-agnostic and doesn't force #591's hand. Revisiting that: Tamagui and Gluestack UI are broader kits that solve primitives and styling together, and #591 explicitly says a kit choice in the #578 spike "likely decides this too."

This issue tests Tamagui as that combined choice. A companion spike for Gluestack should follow the same shape before a final decision, since the two kits push the styling answer in different directions (Tamagui ≈ #591's "runtime/compiled style objects with theme" option; Gluestack, being built on NativeWind, ≈ #591's "utility/atomic CSS" option). Scope of #578 and #591 may be merged or resized based on the outcome — that's an accepted possibility, not a scope violation.

Why Tamagui specifically needs its own verification pass

Docs research surfaced numbers and claims that don't fully agree with each other or with #579's own findings, and #579 already caught one research-vs-reality gap (web bundle cost from @rn-primitives, assumed negligible, measured at +84 kB raw). Don't trust the following without a real PoC against this repo's Vite toolchain:

Scope of the PoC

  1. Confirm the Tamagui compiler is actually active in the build (not just the package installed) — inspect the emitted output, not just docs claims.
  2. Measure the real production bundle delta (raw + gzip), same methodology Spike: choose the cross-platform primitive strategy (and resolve the ds-entry contract) #579 used: before/after on the index chunk.
  3. Port two components, matching Spike: choose the cross-platform styling approach #591's own acceptance criteria:
    • One trivial component (styling only)
    • One exercising apply-text-style + a variant mixin + a breakpoint — the hard case, not the easy one
  4. Also swap the underlying primitive on at least one of them — ideally Tooltip again, so this PoC is a direct, apples-to-apples comparison against Spike: choose the cross-platform primitive strategy (and resolve the ds-entry contract) #579's existing @rn-primitives/tooltip PoC (branch claude/rn-primitives-library-4ny4sa) rather than a fresh, unrelated data point.
  5. Run the existing Tooltip test suite (5 cases covering click/tap-to-toggle per Unify tap/click tooltip behaviour #568, hover suppression, focus, escape-to-close, aria-describedby) against the Tamagui version and report pass/fail — don't assume parity, verify it.
  6. Confirm visual parity against current output (per Spike: choose the cross-platform styling approach #591's acceptance criteria).

Acceptance criteria

Notes

Related: #578, #579, #588, #590, #591. Timebox it the same way #579 and #591 were timeboxed — this is still a spike, not a commitment to adopt Tamagui.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions