- If the CDN fails, download an asset from the original domain
- If SRI validation fails, fall back to a different resource
- If an asset fails to load, retry
- Compact: halfway small so to be directly included in each page: it’s 1.6K right now and it’s likely gonna shrink. This is why it does not have (and should not have) any external runtime dependencies
- Familiar: Sane defaults to not offer too many surprises
- Recognizable: offers a Promise based API for asynchronicity
Full disclosure: DYAL is mostly an excuse for me to learn some TypeScript but maybe it’s also useful.
yarn installwill the relevant development dependenciesyarn buildwill outputdist/loader.jswhich is meant to be usedyarn testbedwill build a development version and run a webserver onlocalhost:8081to serve a testbed (open the developer console to see if things work)yarn fmtwill format all the codeyarn devwill run rollup in watch mode