-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Currently project saving is handled in GUI/project-saver-hoc, which basically does the following on a save:
- Use
storage.storeon all dirty assets - Use
xhrmodule to POST/PUT againststorage.projectHost/projectId- The
storeProjectfunction is called with request params like title, is_remix, is_original depending on if it is creating a new project, remixing, copying, etc. - Expects {id: projectId} in response
- The
- Use (passed in)
props.onUpdateProjectThumbnail(projectId, thumbnailBlob)to update the thumbnail
Step 3 is easily configurable externally. I believe step 1 can be configured by customizing a storage helper to do this (although I haven't tried it, so not 100% on this). But step 2 is not configurable.
Depending on how we want this to look in the future, we could do a few things to make project saving more configurable.
- Use scratch-storage to store project JSON, so it can be configured the same way asset saving can be configured. There is a consistency to this, but project JSONs would be pretty different to save on the web because of authentication, so might be a fair bit of work that wouldn't really be used elsewhere.
- Add a
onUpdateProjectData(or similar) prop that can be called that acts like this promise. Then www can pass in that same function, but other consumers of GUI can handle project data saving differently. - ... other ideas?
/cc @rschamp @chrisgarrity @cwillisf since you probably have thoughts on the approach for this.
Reactions are currently unavailable