dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Cross platform dynamic assets

Open ealmloff opened this issue 2 years ago • 2 comments

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

ealmloff avatar Dec 29 '23 14:12 ealmloff

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

jkelleyrtp avatar Jul 25 '24 02:07 jkelleyrtp

Do we have any progress with this feature?

Sitin avatar Jun 19 '25 04:06 Sitin