Support for self-hosted js-envs Lumo and Planck #179
Merged
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.
Fixes #116
This PR adds the ability to to
lein doo lumo
andlein doo planck
.Detailed notes:
Self-hosted ClojureScript doesn't require the ClojureScript compile build step (as
lumo
andplanck
operate directly on source, compiling in memory internally). So, in theory, while the build step is harmless, it could be omitted. But, it wasn't clear to me how this could be easily accomplished when theauto
mode is in effect (because the ClojureScript compiler's watch capability is used). So, this PR does nothing with respect to the build step and preserves the existing logic.Also, since
lumo
andplanck
don't need the results of the build, the(:output-to compiler-opts)
final script runner command line argument is conditionally omitted for the self-hosted testing case. (If you look at the waylumo
andplanck
are executed, they are directed to run the test by issuing arequire
on the(:main compiler-opts)
.I tried putting some of the self-hosted stuff into a separate namespace, with
defmethod
s for:lumo
and:planck
, which would be an appealing approach, but it is difficult to cleanly do this without wanting a circular dependency betweendoo.core
and that new separate namespace. So this PR just keeps it simple and puts the self-hosted support directly indoo.core
.This PR works with the current
lumo
release.For
planck
recently-released version 2.14.0 is required, otherwise two issue arise which could be worked-around indoo
but they are reallyplanck
defects:doo.runner
to be reloaded after having set thedoo.runner/*exit-fn*
. Adoo
workaround would be to employdefonce
, but this has been fixed in Planck 2.14.0.doo
complain that the*exit-fn*
hasn't been properly set, owing to an artifact where Planck internally uses exceptions whenplanck/exit
is called; this also has been fixed in Planck 2.14.0 thus making it compatible with the waydoo
catches:default