This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-07
Channels
- # admin-announcements (54)
- # announcements (1)
- # beginners (145)
- # boot (122)
- # cider (10)
- # cljs-dev (25)
- # cljsrn (20)
- # clojure (173)
- # clojure-art (4)
- # clojure-austria (1)
- # clojure-berlin (3)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-russia (117)
- # clojure-switzerland (1)
- # clojure-uk (3)
- # clojurebridge (6)
- # clojurecup (36)
- # clojurescript (218)
- # clojurex (1)
- # core-typed (17)
- # cursive (23)
- # data-science (1)
- # datavis (2)
- # datomic (28)
- # emacs (3)
- # flambo (1)
- # hoplon (28)
- # ldnclj (19)
- # lein-figwheel (2)
- # leiningen (1)
- # luminus (1)
- # off-topic (1)
- # om (158)
- # portland-or (1)
- # re-frame (72)
- # reagent (48)
- # remote-jobs (1)
- # slack-help (7)
Hi all. I was wondering if there is a way to get auto-completion of namespaces and vars in the figwheel repl?
richiardiandrea: at any rate, big thumbs up for replumb! here's what we ended up building using bootstrapped cljs: http://landofquil.we-do-fp.berlin
well, maybe we could discuss specifics, I know about the problem that once you step into macro land you have to stay there, but this does not seem to be a problem for chromex
I have this idea for a cljs devtools extension that provides a repl, namespace browser, test runner etc
and provide a way how to run standalone chrome instance with this devtools fork + some extension to aid cljs development
only reason do hook it into devtools really is to have it side-by-side with the browser window
IMO we should first focus to make best experience in chrome/devtools and maybe later think about supporting other platforms
it will send the command to figwheels via nREPL and echo results back, presented by cljs-devtools
that second part works already: https://github.com/binaryage/cljs-devtools/wiki/Figwheel-REPL-plugin
with that devtools fork, I can optionally inject cljs-devtools support and this figwheel REPL integration into js context automatically
also I will present figwheels, warnings and compilation errors in this separate chrome/devtools instance
the problem with this automatic approach is versioning, the code needs to be compiled agains some version of clojurescript, which one?
caching? Let me rephrase, cljs-devtools is implemented in cljs and has to be compiled, if I’m about to provide it automatically and inject into js context of running cljs app, I have to know which version of cljs compiler/library they used for the app, so cljs-devtools code snaps with it
ok, if you have control over the build that this is good approach, but in my model I don’t, I let people use whatever build tooling they wish
depends on goals, my goal is to aid clojurescript development/debugging on client side, user has to have his own nREPL for devtools to connect to it, same with error/warnings reporting, there must be some “provider"
but people can provide their own “providers”, devtools will connect to them as clients
so I don’t care that much how the code is compiled/built, the provider will have to tell me important events
same with testing, I’m going to write my own test reporting, but there must be something like karma, to report which tests were ran/failed
this is probably due to my poor google skills, but I can't find what differences are expected between JDK versions in advanced compilation output
I believe this all can be implemented into figwheel as proof-of-concept, and later broken into independent tools, if it can fly
I get different files on compiling the same project with the Oracle JDK and OpenJDK
but because it's advanced compilation output it's hard to tell
the file contents are different
the behaviour of both files seems the same
might be a closure issue, just not sure if there's somewhere I can look before I try to create a minimal repro
I get consistent results on different machines with the same version, I guess I was expecting builds to be reproducible
@mcgivernsa: pretty sure there are no such guarantees that builds will produce the exact same source
Ok, that's fine too 😃
@darwin: interesting stuff in cljs-devtools, never knew about custom formatters ... quite hard to find docs for it 😛
@thheller: https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/edit
there is some interesting development by some TypeScript guy from Microsoft, but I don’t want to wait for it anymore, the process it too slow and not necessarily fitting my ideas: https://code.google.com/p/chromium/issues/detail?id=484261
some pieces of it could be repurposed for clojurescript, but it is not clear how (at this point)
my original idea was to build an electron app, which would host devtools fork, but there is a better approach, I believe now: http://www.nowherenearithaca.com/2013/12/setting-up-debugging-of-chrome-devtools.html
that is better beceause Electron does not have Extension APIs available as they are in the full chrome, so you cannot really run devtools extensions or arbitrary chrome extensions in electron
it is not that bad, to require people to run another isolated instance of Chrome Canary as their “Electron-like” app hosting this cljs-devtools tooling, with all possible whistles
and I don’t have to maintain binary releases of packaged Electron app, they just go and grab latest Chrome
@thheller: do you know about cuttle? https://github.com/oakmac/cuttle, I'd to integrate something like this later
ok, so I have this nice, expressive language called EDN. Then I want to talk to my endpoint using GET
. What do I do?
According to the http spec, I’m not allowed to encode the EDN in the body of a GET request. The other alternative is to serialize everything as query parameters, but that just seems like a wasteful mapping
@darwin cuttle is nice idea although at the moment I'm trying to reduce the apps/windows I have running
@grav: if the data is small enough encode edn->base64 and just put one param into the url to GET
@thheller: that is my setup as well, I just make repl available in devtools as well, and start displaying figwheel’s alerts there too, plus improve some aspects of devtools (inline evaluated values will use custom formatters for example)
I just console.log
my app-state which is a map with records as keys and maps as values
@thheller - but then it just seems easier to use a POST, where I can rely on transit encoding and decoding stuff
@grav are you trying to figure out how to talk to an existing endpoint, develop and endpoint, or both?
It might need something like {:created some-date :location some-location}
, where both some-date and some-location might be ‘rich’ data types
if you use something like https://github.com/JulianBirch/cljs-ajax and pass your map as :query
it will serialize it
I think https://github.com/r0man/cljs-http has the same funcitonality
on the other side, you'll need https://ring-clojure.github.io/ring/ring.middleware.params.html#var-wrap-params to decode the params and get them as clojure data
Hi all, I’ve been looking at re-frame for a SPA. I really like the event driven pipeline, but would prefer to just use type-1 reagent components, instead of type-2 and the reactions etc. Is there a really good reason I couldnt just use the type-1 components?
@underplank: with type 1 components your subscriptions will always get re-created while rendering causing computation overhead
Hi all. Looking for a clientside DB. Found https://github.com/tonsky/datascript . Are there other alternatives you could recommend?
@polymeris: that’s the most popular and most mature solution
@martinklepsch: Ahh, so its an optimization then? In practice is it needed? Im just trying to weigh up the optimization with the simplicity of type-1 components.
I guess if they put it in there then its probably needed 😉
@underplank: it's not exactly an optimization
@underplank: there’s also #C073DKH9P btw
Oh! I didnt realize that. I might go and ask over there.
@jaen: Right, so in some cases its used for that. But for re-frame and subscriptions (i think thats the right thing) its a pattern that they advise.
Then I suppose you could call it an optimisation of sorts - you don't want to repeatedly call subscribe
and create a reaction if you can do it only once.
@jaen: Right. I was thinking of replacing the subscribe functionality with something else. And im basically trying to work out the tradeoffs atm.
Mainly because I think the type-1 components have a much easier testing story than the type-2.
Unless im missing something. It seems to get the datastructure out of type-2 I need to jump through more hoops.
Quite possibly, I royally suck at testing so I unfortunately can't offer more help in that regard.
Is there a way to enable-console-print!
that is valid for within go
blocks? Or basically just a way to set *print-fn*
globally?
hmmm it doesn't seem to be. I'm working w/ cider + figwheel, and I call enable-console-print!
and then try to do prn
in a go
block, and it throws an error
@bensu: thanks for the links! I’m currently using POSTs only. Very un-restful but apart from that it seems I get a lot of other stuff for free ...
thheller: well yes, if they're both within the go block. But the error is no *print-fn* defined
, so that's not the issue
thheller: if I do (enable-console-print!) (go (prn (<! c)))
then it doesn't work. If I do (go (enable-console-print!) (prn (<! c)))
then it works
As part of the recruiting process for devs for an upcoming client project my firm will do, I’m looking for some sample code that converts what we’re doing with React + Ruby on Rails to Om-Next (or some other ClojureScript project): https://github.com/shakacode/reactrails-in-om-next-example/blob/master/README.md
@justin808: probably a bit too early to try that with Om Next seeing that we’re still in alpha
@justin808: probably late December or early January
@justin808: if you’re interested in following along there is an #C06DT2YSY channel
Thanks! My firm is doing lots in the react and Ruby on Rails space (http://www.shakacode.com) and we’re looking to support Clojure as well for our clients.
is there any nREPL client implementation in clojurescript? I want to connect to nREPL session from a web page.
@richiardiandrea: they don’t implement nREPL, they have some custom API for evaluating commands
oh, that's different yes
sorry about that, the only thing I can think of is Figwheel, which connects to nRepl with some fiddling but I don't know the innards
the closest so far is https://github.com/maxbrunsfeld/nrepl.js, will probably use that for now
https://github.com/shakacode/reactrails-in-reagent per @dnolen’s advice…Great way to get our attention, if you have the time.
My current goal was to connect to Figwheel's nREPL, I don’t want to implement nREPL client in clojurescript (seems like a bit of work which will become obsolete soon-ish)
I will probably cheat here and introduce new protocol into figwheel and use it as REPL command delivery for now
@dnolen: would you be interested in tests covering other compiler config options similar to https://github.com/clojure/clojurescript/commit/53fd5991a41f49e7dffdd891c445f48f0835e223?
@danielcompton: yep any and all tests welcome
yeah, I did notice that … 😊
Can anyone recommend a minimal, up-to-date cljsbuild-based template? I just need to put together an example project for something, and in this case it'll be valuable to have it use cljsbuild (otherwise I'd use Mies).
@eggsyntax: the figwheel template comes with cljsbuild and it's fairly up to date
@bensu: thanks. Not as minimal as I hoped for on this one, as much as I love it & use it for everything.
@eggsyntax: it will probably take you more time to look after the template than to delete the extra stuff from figwheel's project.clj
, it has only three extra deps after all.
Actually, taking a fresh look at it, it's pretty damn minimal. I'd misremembered. I'll go with it. Thanks, good call!
Either Bruce has simplified it further in the last six months, or my memory's going. Or both 😉
@eggsyntax: no problem. it might be that it has options to add stuff, without them there isn't much besides figwheel.