Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api.stream/studio-kit",
"version": "3.0.31",
"version": "3.0.32",
"description": "Client SDK for building studio experiences with API.stream",
"license": "MIT",
"private": false,
Expand Down
10 changes: 10 additions & 0 deletions src/helpers/sceneless-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2333,3 +2333,13 @@ export const createCompositor = async (

return project
}

// In lieu of a versioning system, this can be used
// to update a ScenelessProject if its base structure changes.
export const updateToLatest = async (_project: ScenelessProject) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, there's a series of ensure* functions in this file that are called when a project loads. If this function isn’t much different from those, I'd recommend moving it to that list to keep things uniform. This way, we won’t need to call it manually from Studio-next.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I already did this, but maybe it got deleted during some revision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maddygoround

good point on the ensure(). The main problem is that these methods run asynchronously while the commands returns synchronously, so we're setting ourselves up for a race condition.

But I'd rather not have two different places where we handle this logic, so I'll keep this PR up as a reference until we decide on a unified solution

// const root = _project.scene.getRoot()
// const coreProject = getProject(_project.id)

// Update logic here:
// e.g. if (!root.children.find(x => ...)) await coreProject.compositor.insert({ ... }, root.id)
}