-
Notifications
You must be signed in to change notification settings - Fork 0
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
POC: add a sprite #4
base: main
Are you sure you want to change the base?
Conversation
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.
Thank you very much.
Could you find the difference between costumes and sprites? Must we create both json files?
Also, can you update this PR to get json data from a mock API?
If you can, we can create a sprites database on the Concrete CMS side.
@hissy do you mean an API to return sprites.json? |
Yes.
Yes. Please check this sequence diagram, this is what I thought about loading sprites |
@hissy The other way would be to save the json in redux. As it might be a big file, I am not sure if is good way, what do you think? Will there be frequent update in the sprites and costumes? is it an option to keep the file locally without the request to server? |
I think there's no problem. sprites.json is not small, but the same size will be removed from the built JS file.
If API returns json data with cache-control header, your browser will keep it locally. |
@hissy I committed the code to get json from API, could you review please? Also uploaded the routes and files to drive: |
Thanks, it looks fine for now. Let's wait for the API 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 change to get from the APIs instead of mock APIs.
Please check the design doc.
https://docs.google.com/document/d/1m8f_VfWhc2BbnyFnzLbr4iE4WsF2NjJ-uiD8b1_P6wY/edit?usp=sharing
What this PR does?
Adds a sprite to library:
Reference: https://gist.github.com/summerscar/586b88772c598efdbfecffa3c1212b79
How to setup mock API?
We are using Mockoon for API mock
Here are the files you need to set the mock API:
route-get-image.json
60f720956ab1840431dcf0616ce98f14.svg
Link to drive: https://drive.google.com/drive/folders/1ASWqP-JZXjmFqD_akaFnZ5IdqY4hKGRQ
To import the route to Mockoon, you copy the contents of the json file, then in Mockoon you select from the menu
Routes>Add routes from clipboard
https://mockoon.com/docs/latest/mockoon-data-files/environment-clipboard-copy/#create-a-new-route-from-clipboards-data
After you import the route, you need to update the file path to point to the image you downloaded: