Protocolize compiler access to the file system
Description
Environment
Activity
David Nolen February 25, 2022 at 4:10 PM
The description of this problem is just too dated. Any changes along these lines should be a new namespace that provides a different strategy. Bootstrapped already did much of the preparation work to decouple from the file system.

alandipert February 4, 2015 at 5:36 PM
I too think it would be totally awesome to have builds based on sources from disparate places.
One alternative in this spirit I have been thinking about is a "SourceSet" approach. The idea is, instead of teaching CLJS how to consume various place-types directly via protocols, provide an API for building a "SourceSet" value and also a build function that takes the SourceSet as input. I imagine the SourceSet in its simplest form as a map of namespaces to string sources.
With a value to represent sources that is place-agnostic and immutable, 3rd party tools can consume/emit/transform these values before invoking a compile without knowledge or interest in CLJS internals. Conversely CLJS need not be concerned with how SourceSets are constructed.
This whole idea is inspired by boot's FileSets, which work basically the same but can't have the "it fits in memory" assumption.

Thomas Heller December 3, 2014 at 3:31 PM
This and some other issues opened recently (CLJS-900, CLJS-851, CLJS-899, ...) have some overlap with what I have done in shadow-build [1]. Memory based builds are actually already possible cause it will only touch the disk when asked to, although the API could use some cleanup.
Anyways, might be worthwhile to coordinate these efforts to make CLJS more accessible for everyone.
Currently builds are based on files on disk. It is desirable to be able to instead get in memory builds, WebDAV based builds, S3 based builds, etc. Many of these alternative strategies are not in scope for the ClojureScript compiler but this does not mean we should not supply the needed hooks for users to control the behavior.