Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea of this PR is to be able to register files in the fake filesystem but without loading their contents until actually accessed. This means that a directory list will show the file as present, but on actually opening the file the usual callback is called.
The motivation behind this is to reduce the size of toplevels - so rather than compiling in all of the cmi files as is currently done we just register the files lazily. The compiler is pretty good at not actually opening the files until they're needed so this seems to end up reducing the amount of data transferred quite a bit.
The end goal is to produce a javascript toplevel for each and every library in opam to be hosted on v3.ocaml.org, so keeping the size down is an important part of this.
Does this approach make sense?