Fork me on GitHub
#cljs-dev
<
2018-12-13
>
favila00:12:44

add dataify/nav impl to Object that looks for the magic react element symbol?

lilactown00:12:26

I’m afraid this could cause unexpected behavior with non-react objs 😕

lilactown00:12:40

I’m writing a library that might use this

mikerod00:12:27

when using clj 1.10.x, what sort of expectation should you have concerning what version of cljs to use? should you only expect/assume it to work with 1.10.x cljs?

mikerod00:12:14

I believe a pattern I’ve seen is that cljs 1.10 stuff seems to begin to embrace clj 1.10 additions, but cljs 1.9 wouldn’t do that

mikerod00:12:14

but it is also the case that I can use the latest clj 1.10 (RC) release with lower cljs versions at least back into the 1.9's. So I just am not sure what sort of upgrade flow is expected to be followed

mikerod00:12:39

Side note: not sure if I should have thi son #cljs-dev or #clojurescript - it may be the latter - if so, sorry

mfikes00:12:02

@mikerod ClojureScript currently depends on Clojure 1.8.0

mikerod00:12:28

I’m confused how to match up compatible numbers across the 2

mikerod00:12:33

in both directions

mikerod00:12:08

eg. I jumped a project to Clojure 1.10.0-RC5 to try it out, had an old ClojureScript v1.7.x - and it failed with spec issues (not super surprised)

mikerod00:12:22

but then I tried a ClojureScript v1.9.x and it was fine

mikerod00:12:32

but in general, I don’t know what is expected to be a combination that should work

mikerod00:12:32

I guess you’re saying ClojureScript “currently” requires Clojure 1.8.0+

mikerod00:12:45

That partially addresses it in one direction for me. Just was trying to have a better feel for the relationship. Perhaps there isn’t a really direct one. I tend to just dig around in cljs changes.md to see if something seems to depend on something of a more recent clj or have been fixed to be compatible with some newer clj

dnolen00:12:22

@mikerod I think expecting alpha features to work across releases is unlikely to ever lead to good results

dnolen00:12:39

other than that there is no expectation beyond aggregation only

mikerod00:12:52

Interesting

mikerod00:12:04

I think macro-spec breaking stuff was sort of a rare case

mikerod00:12:12

made newer clj not be able to compile older cljs

dnolen00:12:13

we don't believe in semantic versioning

dnolen00:12:20

all 1.10.X tells you is that

mikerod00:12:23

so there is some barrier there now

dnolen00:12:27

won't break backwards for a lot of the time

dnolen00:12:50

and you'll get Clojure 1.10 features (some of which may be under development, so proceed with some caution)

mikerod00:12:20

> we don’t believe in semantic versioning Yeah, I’ve heard the Rich talk on it. I’m in agreement with the points presented there.

mikerod00:12:49

So I guess the thing that is weird is the breaking newer clj that happened due to specs

mikerod00:12:01

but when that happens, you just have to find the incompatibility point

dnolen00:12:14

it's actually more subtle than that

dnolen00:12:43

Clojure may close thing that were underspecified which people knowingly or unknowingly abused

dnolen00:12:07

in other cases, ClojureScript may have a few additional patterns that don't exist in Clojure etc.

dnolen00:12:33

so there's a some grey areas - but c'est la vie

mikerod00:12:47

Fair enough. Thanks for providing the clarifications.

Alex Miller (Clojure team)14:12:37

just a heads up on http://clojurescript.org … the cloud CI product we use for site builds is being turned off this weekend and so the auto-builds will not exist anymore. I am working on a replacement, but it will probably not be ready immediately. I am able to build and deploy either site locally so I can do it on demand, but you will need to poke me to do so. Sorry for the inconvenience! I’ve known about this for a while but of course it’s never urgent until it’s actually urgent… :)

dnolen15:12:43

Thanks for the heads up!

lilactown16:12:06

digging more into datafy. I think this line is supposed to check if we can add meta data to the value from datafy, but it seems to not work as I expect:

lilactown16:12:34

ex from Clojure:

user=> (def x (with-meta [1 2 3] {`clojure.core.protocols/datafy (fn [_] [2 3 4])}))
#'user/x
user=> (d/datafy x)
[2 3 4]
user=> (meta (d/datafy x))
#:clojure.datafy{:obj [1 2 3], :class clojure.lang.PersistentVector}
(def x (with-meta [1 2 3] {:clojure.datafy/datafy (fn [_] [2 3 4])}))

(d/datafy x)
;; => nil

(meta (d/datafy x))
;; => nil

lilactown16:12:11

there’s also the case where the datafied value is a JS object and it throws:

(def x (with-meta [1 2 3] {:clojure.datafy/datafy (fn [_] #js {})}))

(d/datafy x)
;; => Error: No protocol method IWithMeta.-with-meta defined for type object: [object Object]

lilactown16:12:11

I’ll create an issue for this. I think if I create patch for it I could probably also try my hand at addressing CLJS-2999

dnolen17:12:20

@lilactown first question, is what does the Clojure implementation do

dnolen17:12:48

before opening issues around this probably useful to have a few back and forths here first

lilactown17:12:00

ack, apologies

lilactown17:12:02

the Clojure implementation seems to work fine with arbitrary Java objects AFAICT:

user=> (def x (with-meta [1 2 3] {`clojure.core.protocols/datafy (fn [_] (Object.))}))
#'user/x
user=> (d/datafy x)
#object[java.lang.Object 0x3381b4fc "java.lang.Object@3381b4fc"]
user=> (meta (d/datafy x))
nil

lilactown17:12:39

the current Clojure impl uses this to check whether to add meta to the datafied value: (instance? clojure.lang.IObj v)

dnolen17:12:30

@lilactown link to the relevant source?

mfikes17:12:37

Yeah, I probably mis-ported that check as a call to object?

mfikes17:12:22

My hunch is that it probably should have been (satisfies? IWithMeta v)

dnolen17:12:56

@mfikes I think in this case it should be implements?

dnolen17:12:05

I think the instance? in the Clojure implementation is intentional

lilactown17:12:56

thanks 😄 I’ll probably spend the day figuring out the contribution process

dnolen17:12:38

@lilactown it's really not so bad, did you submit your CA already?

dnolen18:12:03

the rest is pretty boring

dnolen18:12:09

make a defect ticket, etc.

lilactown18:12:01

awesome! thx 🙂 I created CLJS-3010

lilactown20:12:51

how do I run tests in src/test/cljs/clojure/?

richiardiandrea21:12:04

@lilactown there are scripts in script if I remember correctly, or you bootstrap a REPL

richiardiandrea21:12:58

folks, can I do something else in order to have the breaking change release note addition merged in? https://github.com/clojure/clojurescript-site/pull/279