Fork me on GitHub
#clojurescript
<
2016-08-23
>
dimovich05:08:53

@shaunlebron they have a blending filter (two of them are multiply and one is overlay).

magnars16:08:16

Since cljs modules only work with optimizations turned on, and figwheel only works with them turned off, how do I go about developing a cljs code base with two entry points (two mains, if you will) ?

magnars16:08:41

that might be so 🙂 but how do I make it work in the first place even?

arohner16:08:55

don’t try to make modules work with figwheel

arohner16:08:17

make the app work ‘normally’ with figwheel, then switch to the optimizations build and do it the hard way

magnars16:08:39

so I can't rely on :main to do my requires any more then, I guess

magnars16:08:08

there is no "normally", since there are two very different paths using some common elements

arohner16:08:08

right. I don’t think that works in a normal :optimizations :advanced anyways?

magnars16:08:23

:main works nicely with advanced

arohner16:08:25

you might be able to do two figwheel builds

favila16:08:47

I think if you depend on a module, you should require it in any namespace that uses it

magnars16:08:26

two figwheel builds sounds like an idea

magnars16:08:58

@arohner thanks for the input, I'll give the two figwheel idea a shot in dev, and use modules in prod 🙂

arohner16:08:22

let me know how it goes

thheller16:08:44

@magnars @arohner since you are talking about it: shadow-build does modules for :none as well (shameless plug)

arohner16:08:13

thheller interesting. What I really need is a way to reload code from an :optimizations :whitespace build

arohner16:08:29

my current project is injecting a CLJS file into an already-loaded page, over SSL

thheller16:08:43

I mean why pay the overhead for :whitespace while developing?

arohner16:08:45

:noneuses document.write

arohner16:08:59

so you get the ‘cant use document.write on a completed page` error

thheller16:08:04

it doesn't have to?

thheller16:08:51

@arohner shadow-build also has a compact mode that emits a single file but :none

thheller16:08:58

so no delay for closure

thheller16:08:28

but is at odds with live reloading somewhat

arohner16:08:13

I’ll look into compact

arohner16:08:15

I would really love to make C-c C-k work

thheller16:08:32

what is that? 🙂

thheller16:08:41

(not using emacs)

arohner16:08:57

eval the current file

thheller16:08:21

that would be easy

thheller16:08:03

I assume it is a load-file call under the hood?

arohner16:08:27

in Clojure, yeah

magnars17:08:29

@arohner: two figwheel builds works nicely, even in the same repl with (start-autobuild ...). I end up with 2x of the shared files as well, but that's fine for dev - and I'll just use modules in prod.

kingoftheknoll17:08:57

It seems goog.net.cookies doesn’t exist in cljs 1.8.51.

kingoftheknoll17:08:01

or in most recent cljs 1.9.x

kingoftheknoll17:08:24

I feel like I might be doing something wrong at this point because I know other libs depend on goog.net.cookies

thheller17:08:05

@kingoftheknoll I believe it is goog.net.Cookies?

kingoftheknoll17:08:43

I’m thinking it’s because I’m trying it in the repl and not actually importing the lib into a namespace so it’s not sending it to the browser. Testing that now...

thheller17:08:59

yeah you'll need the require

kingoftheknoll17:08:37

huh that’s interesting, I wouldn’t thought all of goog would be available globally and only pruned under optimization. Thanks!

thheller17:08:58

you'd probably spend 10mins loading "all of goog", there is sooo much stuff in there 😛

potetm20:08:02

Recommendations: Best "Learning Clojure" frontend framework

potetm20:08:42

I was asked about om/om.next. I use om professionally, and I think it's great for large, long-term applications. But there are quite a few, somewhat complex concepts. So I'm wondering if others have found something more in the sweet spot for people learning the lang.

dnolen20:08:18

@potetm Reagent is pretty popular

jaccarmac20:08:05

I really loved Hoplon when I used it for a couple tiny school projects. Granted, I cam in with a bit of knowledge about Lisp and Hoplon's a little different to the other frameworks, but... I found it great for getting how good code-as-data is for the web. And who doesn't understand spreadsheets?

potetm20:08:19

@dnolen Yeah that came to mind.

dnolen20:08:54

Hoplon also looks cool, but also a little more full stack conceptually

dnolen20:08:19

my impression is people starting out really enjoy Reagent + Figwheel

dnolen20:08:30

not too many things to think about and a lot of immediate feedback

potetm20:08:55

Nice. I'll tell him about Hoplon. That was my impression as well @dnolen. Hadn't looked at it in some time though. Means a bit more coming from you 🙂

dnolen20:08:24

I might not be the best person to ask, there’s a lot of cool things going on these days and it’s hard to keep up 🙂

dnolen20:08:33

all I know is that the #reagent and #hoplon channels seem super friendly

shaun-mahood20:08:32

@potetm: My intro to cljs was reagent with re-frame, it was a really easy way to start (this is about a year ago). Gives a bit of a framework for architecture around reagent that took away a lot of the initial questions I had.

potetm20:08:55

Hey @shaun-mahood! Long time no talk!

potetm20:08:05

(Met at last year's conj 🙂 )

potetm20:08:15

nice I'll look at re-frame too

shaun-mahood20:08:16

Ahh, I was trying to figure out why you seemed so familiar. 🙂

shaunlebron20:08:38

@potetm: rum is really good. very simple approach to choosing your react wrapper style (om, reagent, quiescent) with mixins: https://github.com/tonsky/rum

potetm20:08:16

@shaunlebron Have you used both rum and reagent? I've used neither, but my impression is that rum might be simpler, but overall has more concepts to learn.

shaunlebron20:08:46

@potetm: I haven’t used reagent, but I started using rum about a month ago

shaunlebron20:08:38

maybe I don’t understand it all, but it seems straightforward

shaunlebron20:08:43

ha, I just realized I haven’t used any of the preset mixins

shaunlebron20:08:06

just a toy project without perf considerations: https://github.com/shaunlebron/t3tr0s-slides

shaunlebron20:08:53

i stick with atoms, and just call (rum/mount …)with add-watch

potetm20:08:59

haha, yeah that was where I was like "this seems well thought out, but not as easy as: Here's your state, here's your views. GO"

potetm20:08:27

ah yeah, well if you put it thaaat way 🙂

shaunlebron20:08:42

but it seems like rum let’s you start simple, which was the big appeal to reagent I think

shaunlebron20:08:44

and it has a pretty good avenue to adding features with a nice mixin model, I wrote some mixins for a canvas component, was just like hooking lifecycle events in Om or plain React. didn’t lose any power there

potetm20:08:45

Cool. I'll pass the word on that one too.

arohner21:08:53

CLJs go loops ‘yield’, right? I have a long intensive function, and other stuff (webRTC) appears to be breaking because I’m not giving control back. If I converted to a go loop, would that solve the problem?

shaunlebron21:08:56

that really depends, you still have to park a go-loop so it doesn’t block the JS event loop

shaunlebron21:08:48

as long as the go-loop periodically comes up for air by reading from a channel with (<! …), yeah that’ll work

dnolen21:08:19

the dispatch mechanisms hooks into the browser event loop, we defer to goog.async.nextTick

arohner21:08:18

thanks. Does only parking yield, or does recur as well?

shaunlebron21:08:56

recur does not yield