Fork me on GitHub
#fulcro
<
2017-10-24
>
wilkerlucio11:10:51

Hello people, today I like to share a video with you, this video shows a way that you can get auto-complete exploratory features for your Om.next graphs. This is a combinations of technologies, being Pathom a backend library that helps you write your parsers, and OgE, that's a web interface to explore your graph. I made a video to demonstrate how you can combine those and have a good exploratory solution for your graphs, I hope you enjoy it: https://www.youtube.com/watch?v=60i9uStI9As

roklenarcic13:10:33

when I changed my clojure version to 1.8.0 to 1.9.0-beta2, fulcro stopped working.

roklenarcic13:10:08

I get bunch of warnings like: WARNING: qualified-keyword? already refers to: #'clojure.core/qualified-keyword? in namespace: clojure.future, being replaced by: #'clojure.future/qualified-keyword? WARNING: any? already refers to: #'clojure.core/any? in namespace: clojure.future, being replaced by: #'clojure.future/any? WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.future, being replaced by: #'clojure.future/boolean? WARNING: inst? already refers to: #'clojure.core/inst? in namespace: clojure.future, being replaced by: #'clojure.future/inst?

roklenarcic13:10:24

And then Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.future/ident?

roklenarcic13:10:46

So I'm guess I need to exclude clojure-future-spec from fulcro dep

roklenarcic14:10:45

Solved it. Just in case someone else runs into it: you need to add :exclusions [clojure-future-spec] to fulcro, fulcro-sprec and fulcro-sql then add [clojure-future-spec "1.9.0-beta2"] as dependency

roklenarcic14:10:08

is there some way to use fulcro.ui.bootstrap3/labeled-input in fulcro forms? It's nicer than f/form-field input field.

roklenarcic14:10:46

The fix above I mentioned will allow you to run the REPL, but fulcro-sql will now crash: ClassCastException clojure.spec.alpha$and_spec_impl$reify__14123 cannot be cast to clojure.lang.IFn clojure.spec.alpha/spec-impl/reify--44590 (alpha.clj:876)

wilkerlucio14:10:29

@roklenarcic you can remove the clojure-future-spec entirely when using 1.9, the clojure-future-spec is to use spec with old clojure versions

roklenarcic14:10:34

doesn't work because things try to import clojure.future namespace

roklenarcic14:10:48

normal spec doesn't have that same namespace

roklenarcic14:10:24

The final solution was to remove all exclusions and added deps I described earlier, downgrade clojure from beta2 to alpha17 and to reduce fulcro-sql from 0.2.0 to 0.1.0. This seems to work.

wilkerlucio14:10:27

that's weird, I never had to do any of that

wilkerlucio14:10:41

who is requiring the clojure.future namespace?

tony.kay15:10:41

yeah? Nothing should be doing that.

tony.kay15:10:22

clojure future spec is supposed to “auto-retract”. It should be ok for it to be on classpath with 1.9

tony.kay15:10:37

it is only supposed to inject itself if it is on 1.8

tony.kay15:10:05

but clojure-future-spec is a required dependency for both 1.8 and 1.9 for fulcro to work, but it should be a no-op if using 1.9.

tony.kay15:10:43

you cannot just exclude it. You have to resolve it, but it can co-exist with clojure 1.9.

tony.kay15:10:19

@wilkerlucio FYI: It is needed in order to ensure things like boolean? exist…so you do have to require it, but the namespace you require does nothing in 1.9

wilkerlucio15:10:20

humm, gotcha, I though it could be removed, my bad

tony.kay15:10:23

@roklenarcic It could be the version of clojure-future-spec you’re getting in the result is too old

tony.kay15:10:04

let me update all of the deps on the libs and push snapshots of them all

roklenarcic15:10:57

Try to use CLJ 1.9 beta 2 with fulcro and its clojure-future-spec alpha 17

roklenarcic15:10:17

you won't be able to run a REPL

tony.kay15:10:46

You should be able to “pin” clojure-future-spec to beta2

tony.kay15:10:56

in your own deps. That will override the incoming

roklenarcic15:10:59

I also thought that the code in clojure.future was supposed to stop namespace from doing anything in 1.9

tony.kay15:10:59

just specify it

roklenarcic15:10:17

but it didn't for some reason

roklenarcic15:10:27

if you “pin” clojure-future-spec to beta2, then something else fails, some spec code somewhere

roklenarcic15:10:46

Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/defn- did not conform to spec: In: [2 0] val: schema fails spec: :clojure.core.specs.alpha/arg-list at: [:args :bs :arity-n :bodies :args] predicate: vector? In: [2 1] val: ({:keys [:fulcro-sql.core/depth], :or {:fulcro-sql.core/depth 1}, :as filtering} table-set) fails spec: :clojure.core.specs.alpha/arg-list at: [:args :bs :arity-1 :args] predicate: (cat :args (* :clojure.core.specs.alpha/binding-form) :varargs (? (cat :amp #{(quote &)} :form :clojure.core.specs.alpha/binding-form))), Extra input :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__988 0x2ed7a513 "clojure.spec.alpha$regex_spec_impl$reify__988@2ed7a513"]

tony.kay15:10:48

well, then that might be a bug

tony.kay15:10:08

hm…I’ve seen spec do that on hot code reload when you have too many things in the refresh dirs list

roklenarcic15:10:24

I have what's basically your template

tony.kay15:10:43

ok, I’ll spin it up

roklenarcic15:10:44

anyway, if you play around with CLJ and clojure-future-spec versions for a bit, you'll see that only a specific combination works. I was using fulcro-sql 0.2.0 too, maybe that was a prob

tony.kay15:10:23

were you analyzing lein deps :tree? or just guessing?

tony.kay15:10:43

the latter rarely gives good results

tony.kay15:10:57

I just started a CLJ REPL on template. worked fine with beta2…starting cljs builds

tony.kay15:10:12

let me add fulcro-sql and see

tony.kay15:10:29

Here are my deps:

:dependencies [[org.clojure/clojure "1.9.0-beta2"]
                 [org.clojure/clojurescript "1.9.946"]
                 [fulcrologic/fulcro "1.0.0" :exclusions [commons-codec]]
                 [fulcrologic/fulcro-sql "0.2.0"]
                 [org.clojure/core.async "0.3.443"]
                 [org.omcljs/om "1.0.0-beta1"]
                 [kibu/pushy "0.3.7"]
                 [bidi "2.1.2"]
                 [ring/ring-core "1.6.2" :exclusions [commons-codec]]
                 [bk/ring-gzip "0.2.1"]
                 [http-kit "2.2.0"]
                 [com.taoensso/timbre "4.10.0"]
                 [fulcrologic/fulcro-spec "1.0.0" :scope "test" :exclusions [commons-codec fulcrologic/fulcro commons-fileupload]]]

tony.kay15:10:52

I didn’t have to do anything about future spec at all

roklenarcic15:10:58

I had a working build. I just upgraded to CLJ 1.9.0-beta2 and it broke

tony.kay15:10:22

not surprising…that can change a lot…I’m just saying that it doesn’t seem like fulcro is doing something wrong 😉

roklenarcic15:10:38

I guess it was something else maybe

tony.kay15:10:03

did you use lein deps :tree? Also did you look at your other pinned deps?

roklenarcic15:10:45

fulcro was using clojure-future-spec 1.9.0-alpha17

tony.kay15:10:54

If you change dependencies much, I recommend this procedure: 1. Remove all exclusions (comment them out) 2. Make your additions/changes 3. Then go through lein deps and carefully fix the warnings, but usually not the way they suggest 🙂

tony.kay15:10:33

it is using alpha17 in mine right now…but since I’m using clojure 1.9, it is not having any effect

roklenarcic15:10:47

why does your fulcro-spec have that many exclusions?

tony.kay15:10:53

So, exclusions are good when there is a conflict and you want to let some other library take precedence. You have two choices: pin the library in your own deps (which you should probably comment if doing, since it can mess things up later), or exclude it from the one that uses and older conflicting version.

tony.kay15:10:26

It probably doesn’t need fulcro in it’s exclusions

tony.kay15:10:50

since fulcro is pinned due to local use

roklenarcic15:10:24

ok I'll try again

tony.kay15:10:52

That defn error you were getting: I’ve seen it before in a non-fulcro project. I was puzzled by it, but narrowing my refresh dirs for tools-ns seemed to clear it up.

tony.kay15:10:25

I have no clear theory for why the compiler would suddenly start failing such a common well-known form due to spec

roklenarcic15:10:19

I only changed fulcro-sql from 0.2.0-SNAPSHOT to 0.1.0 and fulcro-spec 1.0.0-beta9 to 1.0.0

roklenarcic15:10:27

shouldn't matter

tony.kay15:10:38

I’m using sql 2.0.0 (it is released)

roklenarcic15:10:55

oh well... another day another mystery snafu

tony.kay15:10:51

never hurts to ask. the state of spec seems a bit fragile to me at the moment, which is unfortunate

roklenarcic15:10:30

Yeah I was putting off learning spec till 1.9 release, but it's taking so long that it's used a lot already

roklenarcic15:10:59

that's going to end up affecting many libraries using these backports

tony.kay20:10:16

Anyone have Jekyll experience? I’ve got the new website source on github, but my assets (images) are not showing up

tony.kay20:10:14

ah, I thnk I see the problem

tony.kay20:10:48

yeah, nvm…stupid error