Skip to content

feat: add @parity/product-sdk-react-renderer ported from @novasamatech/product-react-renderer - #279

Open
eugypalu wants to merge 6 commits into
mainfrom
eugenio/product-sdk-react-renderer
Open

feat: add @parity/product-sdk-react-renderer ported from @novasamatech/product-react-renderer#279
eugypalu wants to merge 6 commits into
mainfrom
eugenio/product-sdk-react-renderer

Conversation

@eugypalu

@eugypalu eugypalu commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Dependencies. The three novasama packages are gone:

  • @novasamatech/host-api → widget and style types (CustomRendererNode, ColorToken,
    Modifier, …) now come from @parity/truapi
  • @novasamatech/host-api-wrapper → the two chat callback types it provided
    (ChatCustomMessageRenderer, ChatCustomMessageRendererParams) are now defined in this
    package, with the same shape — no transport dependency left
  • scale-ts → the single runtime use (str.dec) now comes from @parity/truapi/scale

What remains: @parity/truapi (catalog) + react-reconciler as dependencies, react ^19.2
as peer.

@socket-security

socket-security Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​react-reconciler@​0.33.01001007583100
Added@​types/​react@​19.2.181001007992100
Addedreact@​19.2.81001008497100
Addedreact-reconciler@​0.33.01001009997100

View full report

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

📦 Bundle size impact

Comparing 2026-08-31T15:06:16.090Z2026-08-31T15:06:29.591Z

Package Entry Bundled before Bundled after Δ Ship gzip Δ Shake ratio
🟢 @parity/product-sdk . 8.56 MB 8.56 MB +66 B (+0.0%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./chain 8.32 MB 8.32 MB +63 B (+0.0%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./cloud-storage 8.50 MB 8.50 MB +63 B (+0.0%) 0 B 2% (was 2%)
🟢 @parity/product-sdk ./core 8.56 MB 8.56 MB +66 B (+0.0%) 0 B 0% (was 0%)
🟠 @parity/product-sdk ./host 93.7 KB 161.7 KB +68.0 KB (+72.5%) 0 B 5% (was 9%)
🟢 @parity/product-sdk ./local-storage 60.1 KB 60.4 KB +354 B (+0.6%) 0 B 100% (was 100%)
🟢 @parity/product-sdk ./react 8.57 MB 8.57 MB +66 B (+0.0%) 0 B 0% (was 0%)
🟢 @parity/product-sdk ./testing 59.1 KB 59.1 KB +41 B (+0.1%) 0 B 26% (was 26%)
🟢 @parity/product-sdk ./wallet 190.5 KB 192.0 KB +1.6 KB (+0.8%) 0 B 1% (was 1%)
🟢 @parity/product-sdk-chain-client . 8.32 MB 8.32 MB +63 B (+0.0%) 0 B 0% (was 0%)
🟢 @parity/product-sdk-cloud-storage . 8.50 MB 8.50 MB +63 B (+0.0%) 0 B 2% (was 2%)
🟠 @parity/product-sdk-host . 93.7 KB 161.7 KB +68.0 KB (+72.5%) +2.7 KB 5% (was 9%)
🟢 @parity/product-sdk-local-storage . 60.1 KB 60.4 KB +354 B (+0.6%) 0 B 100% (was 100%)
🟢 @parity/product-sdk-react-renderer new package
🟢 @parity/product-sdk-signer . 190.5 KB 192.0 KB +1.6 KB (+0.8%) 0 B 1% (was 1%)
🟠 @parity/product-sdk-statement-store . 105.4 KB 172.3 KB +66.9 KB (+63.5%) 0 B 6% (was 10%)

Thresholds — 🟡 ≥10% or ≥5.0 KB · 🟠 ≥20% or ≥15.0 KB (bundled). Percentage only applies once the baseline is ≥ 10 KB. Informational — this check never blocks merge.

TarikGul pushed a commit that referenced this pull request Aug 31, 2026
…tocol

getChatManager() falls back to a native ChatManager when no truapi host is
present (isNativeChatHost() detects the container global), wrapping
@novasamatech/host-api-wrapper's createProductChatManager — which speaks the
legacy container __container__ protocol — behind the unified ChatManager
interface. The wrapper is loaded via dynamic import() so truapi-only products
never bundle the novasama tree.

The truapi and novasama TS shapes for the same wire data diverge and are each
translated explicitly (never a blind cast):
- custom-renderer node (toNovasamaNode): PascalCase->dotted enums,
  struct->tuple Dimensions, {text}->bare String, unwrapped modifier values,
  the exact inverse of the renderer's serializer; throws on an unmapped enum;
- ChatMessageContent: Text {text}<->bare string, Custom payload hex<->Uint8Array;
- ActionTriggered.payload: hex<->Uint8Array.

The host-initiated render handler is bridged to the novasama (params, render)
callback. Validated end to end on the iOS simulator against the native runtime.

Adds a transitional dependency on @novasamatech/host-api-wrapper; blocked on the
same truapi release as the rest of #279.
TarikGul pushed a commit that referenced this pull request Aug 31, 2026
…tocol

getChatManager() falls back to a native ChatManager when no truapi host is
present (isNativeChatHost() detects the container global), wrapping
@novasamatech/host-api-wrapper's createProductChatManager — which speaks the
legacy container __container__ protocol — behind the unified ChatManager
interface. The wrapper is loaded via dynamic import() so truapi-only products
never bundle the novasama tree.

The truapi and novasama TS shapes for the same wire data diverge and are each
translated explicitly (never a blind cast):
- custom-renderer node (toNovasamaNode): PascalCase->dotted enums,
  struct->tuple Dimensions, {text}->bare String, unwrapped modifier values,
  the exact inverse of the renderer's serializer; throws on an unmapped enum;
- ChatMessageContent: Text {text}<->bare string, Custom payload hex<->Uint8Array;
- ActionTriggered.payload: hex<->Uint8Array.

The host-initiated render handler is bridged to the novasama (params, render)
callback. Validated end to end on the iOS simulator against the native runtime.

Adds a transitional dependency on @novasamatech/host-api-wrapper; blocked on the
same truapi release as the rest of #279.
TarikGul and others added 3 commits August 31, 2026 10:45
#283)

* feat(host): native-backend chat adapter over the legacy container protocol

getChatManager() falls back to a native ChatManager when no truapi host is
present (isNativeChatHost() detects the container global), wrapping
@novasamatech/host-api-wrapper's createProductChatManager — which speaks the
legacy container __container__ protocol — behind the unified ChatManager
interface. The wrapper is loaded via dynamic import() so truapi-only products
never bundle the novasama tree.

The truapi and novasama TS shapes for the same wire data diverge and are each
translated explicitly (never a blind cast):
- custom-renderer node (toNovasamaNode): PascalCase->dotted enums,
  struct->tuple Dimensions, {text}->bare String, unwrapped modifier values,
  the exact inverse of the renderer's serializer; throws on an unmapped enum;
- ChatMessageContent: Text {text}<->bare string, Custom payload hex<->Uint8Array;
- ActionTriggered.payload: hex<->Uint8Array.

The host-initiated render handler is bridged to the novasama (params, render)
callback. Validated end to end on the iOS simulator against the native runtime.

Adds a transitional dependency on @novasamatech/host-api-wrapper; blocked on the
same truapi release as the rest of #279.

* fix(host): clear implicit-any on native chat render node; add changeset

Annotate the `node` param in the native chat render bridge as the
novasama-boundary `Any` `toNovasamaNode` already consumes, clearing the
noImplicitAny typecheck failure. Add the missing @parity/product-sdk-host
minor changeset (umbrella minor per re-export policy) for the native chat
fallback.

---------

Co-authored-by: tarikgul <tariksnow37@gmail.com>
…ction

Make mount() render synchronously (updateContainerSync + flushSyncWork) to
match unmount() and fire onRender before it returns; the default-lane
updateContainer deferred to a microtask, landing onRender a tick late and
letting a same-tick unmount discard the pending mount. Omit the props key on
widgets that have none (Spacer) so the serialized node matches truapi's union
instead of carrying props: undefined behind the cast, and assert its absence.
Gate useAction registration on a callback so the registered id and the
serialized clickAction share one source of truth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants