Fork me on GitHub
#om
<
2015-10-14
>
wilkerlucio13:10:13

@dnolen: using the Om setup from the tutorials, how do you setup REPL on Cursive?

dnolen13:10:47

@wilkerlucio: Cursive has supported starting a plain REPL with a script for a long time

dnolen13:10:06

I just create a REPL that starts with script/figwheel.clj

wilkerlucio13:10:46

@dnolen: could you please send a screenshot of your configuration? I'm not sure how to set the start script

wilkerlucio13:10:55

@dnolen: thank you very much simple_smile

a.espolov16:10:04

Hello Such a question in using :optimizations :none work together react custom mixins and om, can't use react custom mixins and om at compile time :optimizations :advanced The way it should be?) https://groups.google.com/forum/#!topic/clojurescript/1tLOY6eYjU8 tested both variants: 1. Om-tools: https://github.com/Prismatic/om-tools/#mixin-tools 2. Javascript interop: https://github.com/swannodette/om/blob/master/examples/mixins/src/core.cljs

bensu16:10:04

Hi @a.espolov Can you post the error? Problems with :optimizations :advanced are usually about you using some JavaScript code (presumably the mixins) and then calling it from ClojureScript without providing externs for it

a.espolov16:10:00

@bensu: Uncaught TypeError: M.qf.vm is not a function

bensu16:10:07

Right, then it means you have some call from clojurescript to javascript which gets transformed into M.qf.vm, while the original javascript code is not transformed.

bensu16:10:45

this is not om specific, are your react mixins written in javascript? did you provide externs for them?

a.espolov16:10:15

no externs( use defmixin from om-tools

a.espolov16:10:04

not much distracted I understand correctly that you fail to create a component from two custom mixins implement methods with the same name?

bensu16:10:24

I don't use mixins, but while two mixins with the same name might cause problems, that wouldn't show only in :advanced.

bensu16:10:28

are you getting the mixin methods with goog.object? or just with (.mixinMethod component)?

a.espolov17:10:09

@bensu: (.mixinMethod component)

bbss17:10:23

I've been trying to run the om next examples using figwheel and cursive but I've been running into several errors. Now when running the script/figwheel.clj old dependencies get fetched like om 0.9.0-snapshot and cljs 122 in stead of 145 and most annoyingly the 12.2 version of react which breaks om. Is there some clean command (like lein clean which I've tried) that I need to run?

bensu17:10:41

@a.espolov: where is .mixinMethod defined? try to use something like (let [m (goog.object/get component "mixinMethod")] (m)) and see if anything changes.

bensu17:10:20

@bbss make sure that lein clean is actually cleaning the paths to which the script compiles to

dnolen17:10:32

@bbss: seems unlikely

bensu17:10:52

sometimes you need to add them to :clean-targets in your project.clj file

bbss17:10:22

Okay, and when I said get fetched I meant that with the verbose flag it "analyzes" that version

bbss17:10:11

:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"]

dnolen17:10:18

getting the wrong the deps if you’re following the instructions exactly

dnolen17:10:28

you should not be providing your own project.clj if you want to be productive simple_smile

bbss17:10:16

I've started with a devcards set-up, not of just figwheel so yes it is a custom project.clj. But I'd like to understand where the old deps come from. When I ran lein deps :tree I saw nothing that depended on React.

thomasdeutsch17:10:15

at the moment, i am using the simple react-wrapper (rum) with datascript. I would like to switch to om.next just so i do not need to re-implement a minimal "should-update" strategy for all components. Has anyone made a simple example on datascript + om.next with minimal rerendering? For example, i do not know if i should implement "om/Ident" ?

dnolen17:10:08

@thomasdeutsch: none of the normalization bits apply to DataScript

dnolen17:10:13

DataScript is already normalized

dnolen17:10:28

however you may want om.next/Ident if you want 2 components backed by the same entity to change together.

dnolen17:10:36

2 or more rather

thomasdeutsch17:10:35

in om.next, how can i measure the time it took for the reconciliation + rendering ?

dnolen17:10:07

there’s not a great way to do that at the moment

dnolen17:10:17

but it’s also going to be very uninteresting

dnolen17:10:23

in nearly every case React time will dominate

dnolen17:10:44

reconciliation is seriously a couple of map lookups and some ops on simple data

bbss17:10:25

I think it might be related to cursive, running via the lein run command works as expected. Bummer, I love the send to repl of cursive feature. I have the same set-up as the screenshot except I notice there is no "synchronize lein" before build task available.

dnolen17:10:54

@bbss it sounds like you have Cursive misconfigured somehow

dnolen17:10:00

I’ve never had problems like that

bbss17:10:30

Okay. Going through the cursive guides again and updating lein.

curtosis18:10:50

recognizing that the pages are still under heavy flux... are you wanting issues reported against them yet?

curtosis18:10:56

(for om next)

dnolen18:10:46

@curtosis: can report here

dnolen18:10:58

actual bugs feel free to file in GH issues

curtosis18:10:19

ok. I'll see if this one is a bug here.... the very first example (pre-om-specific) fails for me, with 404's for goog/base.js and cljs_deps.js. Like :asset-path isn't getting picked up?

curtosis18:10:21

oh :ffs - total operator error. I had a typo that didn't look like a typo, just the wrong keyword. never mind. I'll go sit in the corner of shame.

curtosis18:10:11

oh, that's devious....... simple_smile

curtosis18:10:00

no, mine was that :output-dir and :output-path are not, in fact, the same thing.

curtosis18:10:28

but I brained them as semantically checking off the same box.

dnolen18:10:55

@curtosis I don’t write these code samples for myself simple_smile

dnolen18:10:01

they are there for copy and pasting

curtosis18:10:04

of course. simple_smile which I usually do. Except in this case I tried typing it myself to improve my cognitive engagement. Ironically.

sander18:10:03

same here, wanted to 'get om.next in the fingers', like with new piano pieces

curtosis18:10:11

though I think I did just find an actual bug, with the multiple-hellos example. The guide says "Feel free to change (range 3) to something else." Doing so triggers: "Error: Invariant Violation: processUpdates(): unable to find child 0 of element."

curtosis18:10:44

perhaps because the hello <div>s don't end up inside the <p>

dnolen19:10:30

@curtosis: that doesn’t make sense a to me

dnolen19:10:41

a few people have gone through the Quick Start w/o issue at this point

curtosis19:10:47

@dnolen: hmmm... I copied and pasted the whole chunk several times, just to make sure it wasn't me. 😉 I can duplicate it Chrome and Safari, including after cleaning and restarting figwheel.

dnolen19:10:29

Ok I'll take a look in a bit

curtosis19:10:34

I'm trying to look at it more to see if I can see what's going on.

curtosis19:10:30

no worries.... it's one tiny aside line in the quickstart that not many people may have actually tried

curtosis19:10:40

(and it's really not important to understand om, which is the point of the quickstart)

noonian19:10:43

I've been messing around with om next a little bit and I'm looking for a little feedback. I'm trying to make a component that renders a sub-component that is not known statically (depends on application state). I'm currently computing the current sub-component's query in my root components IQueryParams implementation. Anyway, I'm just wondering if I'm on the right track here for what I'm trying to accomplish. Heres a refheap of a basic example: https://www.refheap.com/110624

dnolen20:10:40

@noonian: yeah if you can’t statically figure it out, then some other component will have to make that choice

noonian20:10:12

Do I need to worry about telling Om when to re-index a component if the query may have changed since Om is indexing the components by their queries?

dnolen20:10:59

@noonian: working on that problem right now

noonian20:10:36

Hehe great. I'm really liking the direction Om next is going in.

bstiles21:10:36

@dnolen: @curtosis: As an additional data point, I had the same problem when changing (range 3) to something else. After replacing dom/p with dom/div, it worked as expected.

dnolen21:10:53

@bstiles: ah right will fix that typo

bstiles21:10:21

@dnolen: Thank you for all you do with Om. We’re not a ClojureScript/Om shop (yet!), but following the evolution of Om/Om.next and understanding the concepts exemplified has very positively impacted our thinking about the architecture and implementation of our application.

dnolen21:10:02

@bstiles: sweet, and to be honest in the end I think that’s far more important

dnolen21:10:13

half the the fun is creating a vehicle to validate the ideas

curtosis21:10:59

@dnolen: @bstiles thanks! though now (as an om/react newbie) I'm curious why dom/p doesn't work.

curtosis21:10:18

and I'll second what @bstiles said ^^

dnolen22:10:08

@curtosis: it’s actually a noob-ish mistake on my part, it’s just how the actual p tag works simple_smile

curtosis22:10:49

I actually think I vageuly remember having run into that years ago.