feat: add @parity/product-sdk-react-renderer ported from @novasamatech/product-react-renderer - #279
Open
eugypalu wants to merge 6 commits into
Open
feat: add @parity/product-sdk-react-renderer ported from @novasamatech/product-react-renderer#279eugypalu wants to merge 6 commits into
eugypalu wants to merge 6 commits into
Conversation
…h/product-react-renderer
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
📦 Bundle size impactComparing
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. |
added 2 commits
August 6, 2026 18:34
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.
#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.
TarikGul
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thispackage, with the same shape — no transport dependency left
scale-ts→ the single runtime use (str.dec) now comes from@parity/truapi/scaleWhat remains:
@parity/truapi(catalog) +react-reconcileras dependencies,react ^19.2as peer.