Open FurryR opened 3 months ago
The reason external libraries aren't allowed is because we cannot be sure whether the linked URL will always be up or not. For extensions that primarily utilize Scratch.fetch
, this is a necessary evil, however it's just easier to paste in a DataURI for any needed libraries to ensure it's always online when the extension is.
Implemented by #1591
however it's just easier to paste in a DataURI for any needed libraries to ensure it's always online when the extension is.
This proposal is for automatically converting await import URLs into data URLs when building so it makes reviewers easier to ensure the integrity of dependencies.
The reason external libraries aren't allowed is because we cannot be sure whether the linked URL will always be up or not.
This proposes that as part of the build process it will automatically convert the linked library to JS, since you're 100% right that we can't always rely on 3rd-party dependencies on such critical parts of projects.
In the grand scheme of things, this won't affect the front-end and will just make development a bit more readable.
Extensions are now able to require external libraries via
await import
. When the gallery starts, it downloads all dependencies (viaacorn
parser) and replace their URLs with downloaded data URLs.Example code:
After processing:
There will be a
cache
directory to store downloaded dependencies so that you do not need to download them twice.