Hacker News new | ask | show | jobs
by swannodette 3886 days ago
Lots of new stuff in Om Next. Unlike Relay and Falcor we have recovered HTTP caching https://github.com/omcljs/om/wiki/Remote-Synchronization-Tut.... And due to the redesign Om Next now has a really fantastically simple automated testing story https://github.com/omcljs/om/wiki/Applying-Property-Based-Te...

Happy to take any questions.

2 comments

Could you clarify a bit the state of JS on ClojureScript land?

I just spend a weekend watching videos about Om Next and Devcards. I got Om Next inside Devcards working, but the journey from there to getting my JS based React components there was less than smooth.

I believe that things like GraphQL, Relay and Redux could provide what I have been missing on my web development story, namely code working with the data regardless of client/server separation. Om Next looks to give these things with a better language.

I'm now starting to build things with Om Next, since playing with Cljs on Devcards was really fun. I just had to rage quit a couple times trying to use my existing stuff.

I saw support for directly importing JS modules mentioned, but I could not find docs on how it could be used. Other option was to modify build configuration to get my JS files inserted into package space or converting them (I assume) to Clojure packages with CLJSJS. Finally I just mangled several build configs together which somehow worked.

I realize trying to keep one feet on JS land and other on Cljs side might not be high in your priorities, but my use case happens to require this. I keep trying, though, so thank you very much for what you've done.

Using the most popular JavaScript libraries is absolutely not a problem. However integrating random React components in a ClojureScript build is a work in progress (you could also just pre-build your React bits first and avoid this issue entirely). Maria Geller and others in the community have pushed the CommonJS integration forward an incredible distance, we're at the point now where the devil is in the details. I suspect in 6 months or so using a random React component in the ClojureScript build process will not be so challenging.
Ok, thank you.

I have to see how to go about making JS with Webpack -> Cljs a bit more automated.

Importing amd.js/umd/es6 modules would be preferred, but you could also include your .js files using the preamble option.
I think I used foreign-libs at the end. I might have had preamble there at one point, but that iteration did not work. Using Figwheel + Devcards build in Leininged seems to swallow compile information, or at least I couldn't see any error messages unless I broke the build very badly...
I have what could be a newbie/clueless question: with Om and Clojurescript, is there a way to automatically add dependencies in parts of a project, like 'npm i -S package_name> does for package.json rather than having to add those manually in a file together with the version number?

I also have a deeper question: you were saying Falcor's reliance on strings for the query types isn't ideal and Om Next would do that differently. How? Will it be a type of binary mapping for greater efficiency?

Also, a suggestion for the cljs quick start: make it a step-by-step which works straight away for newbies (and move the deliberate trip-up with a missing inclusion to the end, perhaps in an appendix for 'troubleshooting').

Kudos for all the great work on Om, cljs and the great presentations that I usually look for on Youtube. Your demo of an old Apple with BASIC reminded me of how I started in the 80's too: Oric Atmos 48K and BASIC with immediate feedback (and line numbers, RUN and GOTO!). This made me understand why I like REPLs and the immediate feedback environments so much and I even found an Oric Atmos emulator for Mac OS X that I installed and re-coded my first program in - a white circle on a black background (and thought the web/ui thing was badly engineered until the React guys came along) :P

Fun years ahead.