Fork me on GitHub
#fulcro
<
2018-01-19
>
levitanong06:01:09

in query-id, what is a qualifier?

tony.kay08:01:14

@levitanong see Dynamic queries. It allows you to have more than one instance of a given class that has a query from other instances of the same class.

tony.kay08:01:50

Fulcro's dynamic query system allows changing the query at runtime. It defaults to class-wide, but qualifier lets you target instances.

levitanong08:01:19

@tony.kay thanks! is there a special gotcha for dynamic queries on a union query? I’ve been playing around with it, and i’ve been getting some errors.

tony.kay08:01:27

shouldn't be, beyond the requirements for union queries in general

currentoor18:01:10

@tony.kay i added the fulcro router to my app and now i’m working on adding HTML5 URL routing, in the book i know you said > We do not provide direct support for this, since your application will need to make a number of decisions that really are local to the specific app

currentoor18:01:37

but do you think there should be something like the easy server that makes routing decision for you?

tony.kay18:01:40

did you look at the template?

currentoor18:01:50

yes i’m using that as an example

tony.kay18:01:02

basically you have to make the server serve index for every valid page

tony.kay18:01:24

and your setup has to make sure the initial state matches on first render

tony.kay18:01:27

SSR is optional

currentoor18:01:41

yes i totally understand that

tony.kay18:01:12

not sure what you mean by "makes the decision for you"

tony.kay18:01:20

you mean a pre-coded solution?

currentoor18:01:38

yes, like the easy server

currentoor18:01:43

just a thought

currentoor18:01:36

but then again maybe routing is too open ended for that?

tony.kay18:01:01

that's in the issues list already...the one about integrating route parsing with the routers

tony.kay18:01:19

I was thinking there should be a way to co-locate routing URL data with the routers

tony.kay18:01:38

so that each could "handle" part of the URL in a tree-like fashion

tony.kay18:01:50

the ideas are ill-formed at the moment, but worth experimenting with

currentoor18:01:32

yeah that would be even better

tony.kay18:01:07

that would eliminate the "routing tree" as a separate construct, and would make it possible to mostly automate the route handling

tony.kay18:01:46

thinking about splitting routing, bootstrap, and forms into a UI library again...these kinds of features probably belong in add-on libraries.

tony.kay18:01:24

always torn on that...bootstrap was a mistake to integrate...it would just be better as its own thing

tony.kay18:01:35

anyway, separate topic

currentoor18:01:16

why split routing and forms? if someone doesn’t use them, don’t they essentially vanish?

currentoor18:01:02

and it’s not like they bring in other dependencies right?

tony.kay18:01:44

that's the rub. part of it is just grokking everything that is there. and I'm wanting to simplify forms, so having it be a separate library and then make a new library that improves on it seems nice.

tony.kay18:01:49

separate evolution

tony.kay18:01:24

the down-side is separate maintenance, which was my motivation for combining them to begin with

currentoor18:01:50

right, maintaining separate libs is a pain

currentoor18:01:18

we have several apps that talk to each other at AdStage and i sometimes wish we had just put them all in the same repo

sundarj18:01:37

lots of stuff uses a monorepo to solve that problem

sundarj18:01:05

still published separately, but developed together

sundarj18:01:26

for example React

tony.kay18:01:24

the mono repo has it's own issues

tony.kay18:01:50

I find it to be the worst choice in this scenario 😉

tony.kay18:01:55

for my preferences

sundarj18:01:24

fair enough, i had heard it wasn't a panacea 😁

tony.kay19:01:59

yeah, harder to navigate, git histories convoluted, harder to do PRs, etc.

tony.kay19:01:06

one main readme

tony.kay19:01:38

issue tracker, etc, etc

tony.kay19:01:54

I'd rather do what I have now...at least it is cohesive

sundarj19:01:21

yeah, it's not a bad approach by any means

levitanong19:01:04

hi @tony.kay, trying out your new shadow-cljs template. before, I would run it via cider, run (go) and then (start-figwheel), then visit localhost:3000 where the webserver eventually serves the webapp. I’m aware that figwheel isn’t a shadow-cljs thing, so I’m at a loss at what to do after running (go)

thheller19:01:37

the same embedding would be possible with shadow-cljs but the recommended thing would be to run shadow-cljs watch main independently

levitanong19:01:52

@thheller would shadow-cljs also have a space to put jvm-opts?

thheller19:01:14

yes :jvm-opts ["--thing"] in shadow-cljs.edn

levitanong19:01:46

okay, great. ’cause i’ve been trying to run the shadow-cljs from lein, and since i’m on java 9, i’m getting a bunch of errors i shouldn’t be getting.

thheller19:01:15

the current clojurescript release doesn’t like java9 so I can’t do much about that

levitanong19:01:28

So i’ll try placing those options in the shadow-cljs.edn with the workarounds i’m using for java 9

thheller19:01:43

ah but the template uses lein, so you’d need to configure the jvm opts in lein

thheller19:01:55

via project.clj

levitanong19:01:00

yeah, that’s what i have so far

levitanong19:01:11

but oddly enough the error is still happening

levitanong19:01:20

maybe it’s time i figured out how to downgrade. 😛

thheller19:01:30

:jvm-opts ["--add-modules java.xml.bind"] in project.clj doesn’t work?

levitanong19:01:42

does not appear so.

thheller19:01:59

:jvm-opts ["--add-modules" "java.xml.bind"] like that probably

levitanong19:01:19

yeah that’s what i have

thheller19:01:41

what error do you get? something in cljs.closure I presume?

levitanong19:01:58

Exception in thread "main" java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(cljs/util.cljc:1:1)
	at clojure.lang.Compiler.load(Compiler.java:7526)
	at clojure.lang.RT.loadResourceScript(RT.java:379)
	at clojure.lang.RT.loadResourceScript(RT.java:370)
	at clojure.lang.RT.load(RT.java:460)
	at clojure.lang.RT.load(RT.java:426)

levitanong19:01:05

the rest is elided

levitanong19:01:17

Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
	at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)

thheller19:01:30

yeah .. thats fixed in clojurescript master but not in any release yet

levitanong19:01:46

so in my other project, that’s working fine in figwheel

thheller19:01:40

you can also add a :dependency to fix that

thheller19:01:48

forgot the exact artifact though

levitanong19:01:58

haha, probably simpler to just downgrade to java 8

thheller19:01:18

found it [javax.xml.bind/jaxb-api "2.3.0"]

thheller19:01:22

maybe your other project has this?

levitanong19:01:02

nope, it doesn’t

thheller19:01:34

maybe something adds it transitively? did you check lein deps :tree?

levitanong19:01:20

doesn’t seem to be there either 😮

levitanong19:01:03

thanks for the help though 🙂

thheller19:01:36

I downgraded to java8 myself since lein didn’t work with java9 at the time

thheller19:01:42

didn’t dare to upgrade again yet

currentoor20:01:55

bumping to fulcro 2.1.2 and using the builtin router (instead of our legacy way of doing things) gave us a 2X speed improvement on route transitions!

thheller20:01:36

@levitanong just checked. it is actually called :java-opts in project.clj. not :jvm-opts

levitanong20:01:29

@thheller well that’s mad, my other project is on :jvm-opts. has there been an API change in leiningen? o_O

thheller20:01:20

no idea. maybe both are supported in some way?

levitanong20:01:59

perhaps. anyway, good thing one can install several versions of java on a machine

levitanong20:01:09

and just set the active version on a session

thheller20:01:20

but I still can’t start properly on java9. no idea why java8 doesn’t get this error since its clojure not java Wrong number of args (0) passed to: core/juxt

levitanong20:01:42

that is indeed an odd error o_O

thheller20:01:20

@levitanong just released [email protected] which now properly runs on Java9 provided the --add-modules opt is set. not doing that automatically yet.

thheller21:01:28

was putting that off for way too long so thanks for bringing it up again 😉

levitanong21:01:36

oh btw, i noticed that if the name of the project in the template had a dash, it would generate javascript initialization code that includes the dash instead of an underscore