Open grod220 opened 5 months ago
we should likely bundle all icons into the extension, this probably takes about 12MB given approach in #392 of crushing all icons to 100x100png
it may be desirable to dynamically acquire unknown icons at runtime, but this would unavoidably leak interest in the asset
for serving from the extension we could
1) serve icons via web accessible resources. these must be declared in the manifest. there are about 1000 icons so this might be undesirable
2) serve icons via rpc in data uri. this requires no spec change, but now we're serving base64 image blobs in rpc. in this situation, icons should probably live as files in the extension that are blobbed at runtime.
we could probably have a new web package with a script to convert the icons present in the cosmos registry, and then submodule the cosmos registry or git-lfs the script output.
We could:
Agree that we only ever use SVGs — not PNGs, etc. This makes their use more flexible, and reduces file size.
in practice this is not true for the set of icons in the registry.
also, we use a very limited number of small icon sizes, and these will get served as blob in rpc anyway. prerendering png should be fine.
- Thereby bundle all icons we use into the repo (probably via a barrel import).
using svg icons in barrel import would bundle dozens of mb
@turbocrime
in practice this is not true for the set of icons in the registry.
What's not true? That it reduces file size?
serve icons via rpc in data uri
Just saw this comment above — this seems like a great approach.
This can be closed now that we're building an asset registry, right? (Assuming the asset registry contains base64-encoded icons?)
The asset registry will contain links to all the assets. So this issue is still relevant. I'll drag this in as this relates to my ongoing work with the registry.
We'll need prax to download the assets and replace those external links with internal ones pointing to the local assets in the extension.
Currently our asset registry has entries with icon urls from github. That means, when loaded in the web app, it leaks to github what user balances are.
At extension build time, we should download these SVGs, sanitize them for any scripts, and store them locally. Then the frontend can load them directly from the extension.
See: https://github.com/penumbra-zone/web/issues/392
Alternative from @turbocrime, make them data uri blobs: https://discord.com/channels/824484045370818580/1044457038886998137/1212847319909662720