React Native example - #334
Conversation
e6da05c to
4311578
Compare
|
|
||
| This file mirrors the mobile library, but every `component` returns `null`. That lets the OpenUI CLI inspect the component definitions in a Node environment and generate `system-prompt.txt` without importing React Native. | ||
|
|
||
| Run `pnpm generate:prompt` any time you change: |
There was a problem hiding this comment.
given that we are already duplicating the types - do we need this?
cant we directly call library.toPrompt() on the backend in nextjs
There was a problem hiding this comment.
facing react-version mismatch issue in next. tried building it outside of pnpm-package, issue remained. we either ways need to fix the approach
|
|
||
| ### `backend/src/library.ts` - Node-compatible prompt source | ||
|
|
||
| This file mirrors the mobile library, but every `component` returns `null`. That lets the OpenUI CLI inspect the component definitions in a Node environment and generate `system-prompt.txt` without importing React Native. |
There was a problem hiding this comment.
can we have a common file that both backend and react-native imports that just has the zod types rather than duplicating it
There was a problem hiding this comment.
cli isn't working with react-native components and importing in next is also broken at the moment.
| root: "Card", | ||
| }); | ||
|
|
||
| export const promptOptions: PromptOptions = { |
There was a problem hiding this comment.
do we need this? Doesn't the toPrompt already handle this
| import { library } from "../library"; | ||
| import { useStreamContent } from "../store/streamStore"; | ||
|
|
||
| export function BotBubble({ messageId }: { messageId: string }) { |
There was a problem hiding this comment.
would it be better to call this AssistantBubble & AssistantMessage throughout rather than calling it Bot to keep it consistent with other examples
| // ─── Message types ──────────────────────────────────────────────────────────── | ||
|
|
||
| type UserMessage = { id: string; type: "user"; text: string }; | ||
| type BotMessage = { id: string; type: "bot" }; |
There was a problem hiding this comment.
same comment: Assistant rather than Bot
| "android": { | ||
| "adaptiveIcon": { | ||
| "backgroundColor": "#E6F4FE", | ||
| "foregroundImage": "./assets/android-icon-foreground.png", |
There was a problem hiding this comment.
can we add the iOS images and/or remove the android ones
Screen.Recording.2026-03-14.at.5.45.44.PM.mov