Fork me on GitHub

@joshua.d.horwitz I'm not sure you have this right


You equate re-frame's event handling with redux's creating actions.


But, as I understand redux (admittedly not much), that doesn't seem right. re-frame really doesn't involve actions, you just dispatch a vector like [:something a b]


event handling (Domino 2) is morethe equivalent of reducers in redux


AIUI, redux doesn't really have an equivalent to effect handlers.


Hmm. So really reducers is BOTH effect handlers and event handlers. Or something.

Josh Horwitz12:09:24

Essentially, I can go through the article again and I will try to clarify and make it map more clearly. Thanks for reading and the feedback @mikethompson


@andrea.crotti @henrik @samueldev What fantastic timing on the question about multiple SPAs in given project — I ended up doing multiple build targets, but I’m dissatisfied with that, because I have to remember to set up multiple figwheel builds, and CircleCI and Heroku takes 2x as long now to do the production builds. (8-9 mins feels so much slower than 4m) I’d love to figure out how to do it in one build, but I couldn’t get the :on-jsload to work for more than one. The modern-cljs tutorial suggests this can be done (they used /login and /shopping-card as an example), but I couldn’t figure out how to get it to work. (They used boot, I use lein.) Do you know of any examples of how to get re-frame to work with multiple SPAs? PS: @mikethompson: I say I’m “dissatisfied” above, but in actuality, I’m delighted beyond words with re-frame and that I have something working at all! The fact that I could share events, subs, and db, and just rewrite the core and views blows my mind.

👍 8

@genekim this may or may not help but figwheel.main has a new extra mains feature


but the overall pattern is very simple


you can do it without tooling


look at the main output-to file you are generating


and change the require for the entry namesapce


Thanks for all your great work, @bhauman! I read your amazing announcement (and the kudos from David Nolan <-- congrats on that notable achievement. 🙂 (Studying this link again, seeing if the lightbulb flickers on this time. Stand by. :)


and create some extra main js files and index.htmls to require them


@genekim I just provided instructions, making sure you didn’t miss them?


first look at your main output-to file


and copy it


and require the entry point namesapce


create an index to host it


Thanks — hang on, trying to get there… mental gears are grinding…


@bhauman I will write up an example when I finally get this to work, because I think a lot of other people may find it helpful. Okay, you can see the horribleness I did to create the new cljsbuild targets of iphone-dev and iphone-min here (the original SPA targets were just “dev” and “min”): Your instructions are: - copy the old build dev build target: (:output-to “app.js”). So, copy it to “iphone.js” - I have a new “iphone.html” that loads the “iphone.js” - in what file do I a require the new “src/trello_iphone/core.cljs”? Thanks much, Bruce!


@genekim you would require the what you would normally put in :main for the other build


If this helps…


@bhauman Ah!!! Okay! Got it!


trello_iphone.core ?


makes sense right?


get right of the main ns in the iphone.js and replace it with whatever main you need


Yes! Totally! That was actually the first thing I tried, but of course, before “extra-mains”, that totally did not work as expected. 🙂 I’ll try it out tonight, and I’ll post a minimal example. Thanks again, @bhauman


you have to munge the namespace and you have to make sure you are watching all the files


no worries and it will be much easier if you use figwheel.main 😉


but thats a bigger investment for sure


PS: that is super, super cool. Just curious: for most people, how would you rate the effort of migrating from figwheel to figwheel.main? (e.g., minutes, hours, days, weeks? :)


if you are not using to many features of lein figwheel I’d say an hour and a half, and that’s simply because you will need to understand how it works. so its mostly going to be time spent reading docs.


Okay!!! I’ll keep you posted on all fronts, @bhauman — catch y’all soon! 🙂

Jp Soares19:09:57

I'm thinking about the architecture of my SPA (to decouple my Business Rules) and I saw the suggested app structure here I'm wondering if it makes sense to have the Business Rules as one of the Panels in the suggested structure.