dumberjs / dumber-gist

A lightweight online IDE to write JS SPA prototypes in your own GitHub gists.
https://gist.dumber.app
MIT License
28 stars 2 forks source link

TODO: bring jsdelivr package file reader from dumber to dumber-gist #7

Closed 3cp closed 4 years ago

3cp commented 4 years ago

So that we have more control over cache.

Need to cache data.jsdelivr.com files list as well. That will enable almost zero remote calls when user has local cache.

3cp commented 4 years ago

For zero remote calls, also needs to investigate some files being read but not traced/bundled. For example react/inferno/svelte, might have something to do with their way of referencing modules, or maybe browser field in package.json.

3cp commented 4 years ago

dumber v1.10.4 avoided some unnecessary file reads on lazy package. But there are still some reading on package.json and main file to determine the real main path (for example package.json main field ./lib could be file ./lib.js or ./lib/index.js). I can cache package.json in localforage, that's as far as I am willing to optimise. The main file could be cached by traced cache if main file is indeed in deps tree, otherwise, dumber-gist will always fetch the real file from remote during init.

3cp commented 4 years ago

done.