-
Approach#1
-
Approach#2
In theory this should speed up the process of running our users code because now we don't need to make that entire additional request
Another big upside to this approach is that now it would be a user's machine, it would up to a user to reach out to NPM and download an individual file as opposed to having tons and tons of requests coming from our server.
-
Remote
- We can cache downloaded NPM modules to bundle code faster
- Will work better for users with slow devices or limited internet connections
-
Local
- Removes an extra request to the API server - faster code execution
- We don't have to maintain an API server
- Less complexity - no moving code back and forth
-
IndexedDB
- A browser API for storing data inside the browser
- Can store large amounts of data
- Data persists even when you close the browser
- Data is organized by keys and values
- react
- esbuild
- localforage (helper library for indexedDB)