You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Files can be specified as a JSON object, without IDs using just the filename. The name is used to enforce the uniqueness of a file in a directory, and directories support nesting.
The server would be responsible for creating IDs and converting to the structure required by mongodb.
Overall, this looks go to me! To answer your questions:
Do we need to limit how nested the files can be?
Right now, there is no limit; however, one data point for this is that the Sidebar styling breaks if a file is more than four levels nested, see _sidebar.scss. Given that this hasn't come up, ever, I think it makes sense for the sake of simplicity to limit the level of nesting. For the relatively small sketches that folks will upload to the web editor, I don't think they'll need more than four or five levels of nesting, anyway.
How do binary files get uploaded? I think this format doesn't handle it, and there's an endpoint to upload individual binary files.
My instinct is that this should be a separate endpoint—a user could upload a file or a folder of files, and get back the S3 URL, or some other ID, and then use to build the sketch JSON. We could also allow users to use their own media hosting, e.g. they can use whatever media url they want as long as it's properly CORS configured. For the p5.js examples uploaded to the editor, the media files are hosted on GitHub and using jsdelivr.
Uh oh!
There was an error while loading. Please reload this page.
Nature of issue?
Feature enhancement details:
As part of the Sketch upload API work, we want a nicer way of specifying file trees.
Below, "file" means file or directory, as they're mostly the same for this discussion.
Current approach
The current API shape closely mirrors the shape of the data stored in mongodb:
children
array on the relevant objectExample
New approach
Files can be specified as a JSON object, without IDs using just the filename. The name is used to enforce the uniqueness of a file in a directory, and directories support nesting.
The server would be responsible for creating IDs and converting to the structure required by mongodb.
Example
Open questions
The text was updated successfully, but these errors were encountered: