Should app devs include the sandbox lib? Or should it be injected by DS? #57
Replies: 3 comments
-
Something that needs to be addressed is the entire set of versioned dependencies in a Dropserver + app:
If Deno std lib eventually stabilizes, then we can reduce to:
One reason for keeping deno sandbox code embedded in ds-host/ds-dev is that you can evolve ds-host/ds-dev, and use the sadnbox code to offer back-compat, as opposed to having to support all kinds of variations within ds-host/ds-dev. Note we can also probably have multiple versions of Deno installed, and use an older one if that is what the app expects. |
Beta Was this translation helpful? Give feedback.
-
There is potentially a third option:
With this, we can maybe effectively have a "compatibility layer" because the sandbox code import could include a version (that indicates the JS API the app is coded against), but DS could serve the latest version of the lib that works with that API version and with whatever DS expects in that particular build. Unfortunately this means that the app will have to have its deps loaded and compiled by DS. I can imagine doing that at app install time with the caching option of Deno? Except that since different parts of the app are loaded dynamically, there is a chance that we'll miss deps, and if we run the appspace with "cached only" then it will not work. |
Beta Was this translation helpful? Give feedback.
-
This discussion cascades into a number of open questions:
I suspect the easiest might be to have all route and exec code statically loaded during normal appspace sandbox invocations. If it's a migration, then maybe run a different entry point script, that loads all migrations? Let's establish that migrations should never access the net since we want migrations to be independent of external factors so that they'll always produce the same result (functional). This means we'll have to run migrations through pre-cache with no appspace connected, then run migration with |
Beta Was this translation helpful? Give feedback.
-
Currently the sandbox consists of Deno running
/denosandboxcode/ds-sandbox-runner.ts
.The runner starts an http server, and starts a twine client and connects. Then when a new request comes in it dynamically loads the necessary app module and passes the request along.
The key thing here is that
denosandboxcode
is embedded in the ds-host and ds-dev executables, and is therefore entirely tied to those executables at those versions.Lately I've been wondering if it would be better to just let the app dev import a published
dropserver-sandbox
module into their app. So sandbox code would live with the app. Some reasons this might be good:Some reasons it might be bad:
Beta Was this translation helpful? Give feedback.
All reactions