-
Notifications
You must be signed in to change notification settings - Fork 10
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
Can create new instance in playground #2162
Conversation
burieberry
commented
Feb 18, 2025
•
edited
Loading
edited
- separated next step into different pr to prevent blocker on turning feature flag off for playground: Add "create card instance" command #2180 convert create instance to command
eab8536
to
afbfc16
Compare
}, | ||
}; | ||
try { | ||
let card = await this.cardService.createFromSerialized(doc.data, doc); |
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.
please use CardResource to create new cards, not the CardService directly. failing to do so will result in an instance that doesn't consistently rerender for live updates
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.
thanks, will do
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.
Updated this to use card-resource. Had some trouble persisting the new card and adding it to recent-cards, so you'll see the note I made in createNew task.
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.
New instances should always be created via CardResource. Here is an example of what that looks like https://github.com/cardstack/boxel/blob/main/packages/host/app/lib/stack-item.ts#L55-L58
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.
Looks good!