Clojurians
#cljs-dev
<
2017-07-01
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

anmonteiro01:07:49

@dnolen I’m seeing an issue where js->clj doesn’t convert under Node.js for objects that are the result of JSON.parse

anmonteiro01:07:15

I wonder if we need to change that check under *target* "nodejs" a la https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L204

dnolen01:07:25

@anmonteiro is there a better way to check for Object in modern JS?

dnolen01:07:28

if so we can use that

anmonteiro01:07:39

not that I know of

anmonteiro01:07:00

I’ll open a ticket and do some research

dnolen01:07:46

cool thanks

dnolen01:07:46

feedback welcome on automatically loading js transforms

anmonteiro02:07:39

oh wow this is even weirder than I thought

anmonteiro02:07:53

I think js/Object is different across V8 contexts

anmonteiro02:07:22

and identical? fails because I’m moving the JSON.parsed object across 2 contexts

dnolen03:07:07

@anmonteiro well all natives types are different across JS contexts

dnolen03:07:12

nothing to do w/ V8 really

dnolen03:07:33

this is analogous to the multiple classloader problem on the JVM

dnolen03:07:40

I’m inclined to say not worth it

anmonteiro03:07:24

Yeah I guess not a bug after all

anmonteiro03:07:45

Just didn't realize it sooner that that was the problem

mfikes03:07:29

FWIW, another “meta” observation: :advanced is probably still a useful thing for hybrid mobile apps for the time being. React Native launch latency—from icon tap to UI active—is 3 seconds with :simple, but 2 seconds with :advanced on an iPad 2. My older Goby-based app (pre-React Native) has a 1-second launch latency with :advanced so, a lot of that 2 seconds is not ClojureScript but React Native itself.

dnolen03:07:08

@mfikes also not surprised if V8/JSC haven’t different characteristics here

metametadata13:07:53

I think I've found a regression in 1.9.671:

(find (hash-map) 1)
fails with:
core.cljs:7536 Uncaught TypeError: Cannot read property 'inode_find' of null
    at cljs.core.PersistentHashMap.cljs$core$IFind$_find$arity$2 (core.cljs:7536)
    at Object.cljs$core$_find [as _find] (core.cljs:551)
    at cljs$core$find (core.cljs:2246)
    at core.cljs:6
although (find {} 1) works fine. Shall I report an issue?

mfikes14:07:04

I've added a git bisect to ^

dnolen15:07:33

I believe fixed in master now w/ more tests. Good catch @metametadata

mfikes20:07:33

Messing around a little with aget warning:

cljs.user=> (aget #js {:a 1} "a")
WARNING: cljs.core/aget, first argument must be an array and remaining arguments must be numbers, got [object string] instead. at line 1 <cljs repl>
1

mfikes20:07:23

It seems pretty straightforward to do. Added a patch for general feedback to https://dev.clojure.org/jira/browse/CLJS-2148 (just to ensure going in right direction)

mfikes20:07:06

(No rush, as I'll probably be AFK for a weeklong vacation soon.)

mfikes21:07:38

Perhaps even such a warning could suggest goog.object/get (or the variadic variant, based on argument count)

dnolen21:07:46

yeah that would be nice

metametadata22:07:47

@mfikes @dnolen awesome, thank you