-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor to use ai/rsc #253
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Out of curiosity, what all was changed? Trying to decide if it's worth merging these changes into my clone of this repo! |
@Godrules500 we've migrated to using the new RSC + Server Action based API released in 3.0! |
display: | ||
message.role === 'function' ? ( | ||
message.name === 'listStocks' ? ( | ||
<BotCard> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems to me that only AI state is being updated for the whole project and UI state is converted from AI state via getUIStateFromAIState
Wondering what rationale is behind and design choices.
This makes me think about the pros and cons of maintaining "UIState and AIState" VS just "AIState" alone.
more specifically, why would we want an explicit UIState? instead of AIState with a bunch of function calls and their corresponding rendering methods (automatically convert it to UIState?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@li2109 The AI state must be serializable as it is shared between the server and client. The UI state is only on the client, and can contain functions and react nodes.
This reverts commit e85ba80.
@@ -0,0 +1,509 @@ | |||
import 'server-only' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I ask you to explain why both 'import server-only' and 'use server' are used? It seems that both have similar effects, yet 'use server' offers the flexibility to be applied per function rather than per module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.