dioxus
dioxus copied to clipboard
Cross platform dynamic assets
Specific Demand
Different platforms deal with creating dynamic assets differently. Dioxus should provide a way to create a dynamic asset (like a generated image) that works on any platform.
Implement Suggestion
Each renderer would need to implement dynamic assets differently:
- Web: use an object url
- Liveview: use a temporary asset url
- Fullstack: use a temporary asset url on the server, then if it is dynamically created on the client use a object url
- Desktop: use an asset url based on https://github.com/DioxusLabs/dioxus/pull/1719
Maybe as part of our work on overhauling the FilesEngine we can implement
VirtualFile::new()
for a slightly more consistent API?
We could also use the dirs crate for putting these resources into the appropriate system storage that also works on web (indexeddb / blob / localstorage) https://crates.io/crates/dirs
Do we have any progress with this feature?