Skip to content

[CONTINUED] Self-host ClojureScript support#97

Merged
tolitius merged 5 commits intotolitius:masterfrom
arichiardi:self-host-support
Apr 9, 2018
Merged

[CONTINUED] Self-host ClojureScript support#97
tolitius merged 5 commits intotolitius:masterfrom
arichiardi:self-host-support

Conversation

@arichiardi
Copy link
Contributor

@arichiardi arichiardi commented Apr 7, 2018

This patch makes mount self-host compatible so that it can be used in
environments like lumo, planck, etc.

It is a duplicate, and most of the work has been done by @dm3 in #85.

The patch also adds a package.json file, which can be used for deploying to npmjs, which is the JS/node equivalent of Maven Central.

Lumo can currently read sources for npm, see here.

Finally, I have added minimal testing and lein-tach plugin to project.clj, it can be tested with:

npm install -g lumo-cljs
lein tach lumo

@arichiardi arichiardi changed the title Support self-host ClojureScript WIP - Alternative self-host ClojureScript support Apr 7, 2018
@arichiardi arichiardi changed the title WIP - Alternative self-host ClojureScript support [CONTINUE] Self-host ClojureScript support Apr 7, 2018
@arichiardi arichiardi force-pushed the self-host-support branch 4 times, most recently from 307e954 to 66cec8a Compare April 7, 2018 05:28
This patch makes sure we use a separate namespace for macrovich and that macros
are correctly loaded. It avoids having warnings under :advanced.  It also puts
vars back where they were before as they look in the right order.
@arichiardi
Copy link
Contributor Author

Done, this seems to work fine with no warnings in boot test-cljs-advanced.

@arichiardi arichiardi changed the title [CONTINUE] Self-host ClojureScript support [CONTINUED] Self-host ClojureScript support Apr 7, 2018
@tolitius
Copy link
Owner

tolitius commented Apr 9, 2018

niice. thank you @arichiardi and @dm3.

tests do run. I have a question about package.json, how is the version used (i.e. "version": "0.1.12") would it need to increment for every subsequent release?

@arichiardi
Copy link
Contributor Author

Yeah well npm publish usually takes care of bumping so you can try and play with that. Ideally they follow the same versioning.

The nice thing is that package.json is very easy to parse and could be used as centralized version, read by lein...up to you though :)

@tolitius
Copy link
Owner

tolitius commented Apr 9, 2018

I see.
since I have a very limited self hosted cljs experience, do we need any additional docs / samples (maybe via lumo) to expose this support?

@arichiardi
Copy link
Contributor Author

Well ideally yes but it is ClojureScript after all...
A nice addition would be to describe how to use it through npm, or point to the lumo wiki.

I will for sure add mount in here

@tolitius
Copy link
Owner

tolitius commented Apr 9, 2018

sounds good. thanks again for the time spent on this.

@tolitius tolitius merged commit a4552fc into tolitius:master Apr 9, 2018
@arichiardi arichiardi deleted the self-host-support branch April 9, 2018 02:57
@arichiardi
Copy link
Contributor Author

Thanks for merging and for mount!

Let me know if you need some assistance for npm npm pack creates the tarball so you can see what you are deploying.

@tolitius
Copy link
Owner

tolitius commented Apr 9, 2018

released as @tolitius/mount

@birdspider
Copy link

so does it matter now if one includes

mount {:mvn/version "0.1.12"} via deps.edn
or
:npm-deps {"@tolitius/mount" 0.1.12"} via build.clj

furthermore is (mount/in-cljc-mode) needed, how does the npm and clojars versions differ in usage ?

@arichiardi
Copy link
Contributor Author

So there is a caveat, the npm deps can be read natively only by lumo.

The JVM compiler does not know how to read sources from it.

It can be a feature request though.

tolitius added a commit that referenced this pull request May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants