This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-09
Channels
- # alda (5)
- # aleph (10)
- # bangalore-clj (1)
- # beginners (168)
- # cider (68)
- # cljs-dev (263)
- # clojars (4)
- # clojure (66)
- # clojure-brasil (25)
- # clojure-china (1)
- # clojure-dusseldorf (1)
- # clojure-greece (4)
- # clojure-italy (3)
- # clojure-russia (4)
- # clojure-spec (12)
- # clojure-uk (16)
- # clojurescript (36)
- # community-development (12)
- # cursive (9)
- # data-science (1)
- # datascript (8)
- # datomic (20)
- # defnpodcast (6)
- # emacs (2)
- # figwheel (2)
- # fulcro (51)
- # graphql (62)
- # immutant (14)
- # keyboards (1)
- # lein-figwheel (10)
- # leiningen (5)
- # lumo (15)
- # off-topic (4)
- # onyx (3)
- # pedestal (4)
- # portkey (13)
- # protorepl (1)
- # re-frame (8)
- # reagent (2)
- # reitit (4)
- # shadow-cljs (71)
- # spacemacs (7)
- # specter (33)
- # sql (9)
- # unrepl (75)
- # vim (7)
If I am embedding a cljs repl in my application, and I already have something like reagent compiled into js as part of my app, should I be able to require reagent from my repl without having to do some kind of recompilation?
I'm struggling a bit with replumb because it is reloading and recompiling everything from files, although this could certainly be due to misconfiguration on my part.
@pmooser If you take the compiler analysis information associated with Reagent, and arrange to have it loaded into your compiler state at app launch time, then that will solve a big part of it. (In other words, the compiled JavaScript is insufficient because the self-hosted compiler will need to know information about the vars in the Reagent namespaces).
@mfikes Thank you! I'm trying to figure out if there's an easy way to do that with replumb. There are definitely hooks here if I provide a load-fn. I'm hoping I can just provide the base path of the compiler output, but I'm not quite there yet.
@pmooser It sounds like you want to bundle “precompiled” Reagent with your self-hosted app. One place for inspiration on how to do something like that might be how Klangmeister uses macros to bundle sources. https://github.com/ctford/klangmeister
(You want to go a little farther and bundle compiler analysis information. This is in the *.edn
or .cache.json
files that the compiler emits.)
You could also look at the way Lumo and Planck work—they bundle AOT compiled namespaces for use with the self-hosted compiler.)
Yeah, those .cache.json files are all available, I just have to figure out how to make replumb look at it. And yeah, I need to take a look at planck or lumo and see what they do.
Yeah, I suspect you will end up doing something that Replumb doesn’t currently support. (I’m speculating.)
Ok thanks. I have honestly been uncertain if I'm doing the right thing by using replumb (which was great for my initial integration), or if it would end up being easier just directly using cljs.js or whatever.
Self-hosted ClojureScript allows, as part of *load-fn*
for you to return analysis cache, and compiled JS. So you have the hooks.
Oh, if you are just doing self-hosted code, like Klangmeister, cljs.js
is fine. But if you are writing a self-hosted REPL it makes complete sense to look at or use Replumb.
in this article: http://swannodette.github.io/2013/08/31/asynchronous-error-handling I’m having trouble understanding this line: <? is just a touch of macro sugar that expands into something like (throw-err (<! [expr]))
I can’t find any information on the function throw-err
. Does anyone know where this comes from?
@lee.justin.m throw-err
would be something like:
@colindresj thanks. okay i get it now. this idea should have more mindshare.
I think there are a few different ideas around handling exceptions that end up on channels (I recall reading an article about using a transducer)
I find https://github.com/fullcontact/full.async is a good set of useful functions when doing core async stuff
Includes a <?
macro
The source is very readable too
I’m trying to figure out when you would not want to use go-try
+ <?
. If you screw up and throw an uncaught exception with normal go
block, the result is really hard to deal with, and the caller can’t clean up after you because exceptions obviously can’t cross go boundaries.
Sorry, forgot to hit enter @lee.justin.m
Take a look at http://martintrojer.github.io/clojure/2014/03/09/working-with-coreasync-exceptions-in-go-blocks
It’ll explain why in go
dealing with excpetions is tricky
go-try
aims to make it not
Has something changed in 1.10.145 that I’d suddenly get “goog.require could not found: cljsjs.react” after an optimized build?