Clojurians
#cljs-dev
<
2018-04-04
>

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

mfikes12:04:47

Revisiting an older question: Is this program valid?

(let [a (into-array [0 1])] (aset a 2 2) a)

dnolen12:04:41

@mfikes no but I don’t think there’s an efficient way to invalidate that

mfikes13:04:14

@dnolen Cool. My reason for asking is that :checked-arrays catches it (which is sufficient). This pattern is used in Reagent, thus raising the question as to whether it is even viewed as a correct program.

dnolen13:04:30

it’s not a correct program

dnolen13:04:06

but it’s also sufficiently host-y where it’s a bit of an edgecase

mfikes14:04:41

I’ve commented downstream in the relevant Reagent PR regarding ^

juhoteperi15:04:16

Nice, latest Closure-compiler seems to fix problems I had with some react-dom/server objects being removed. Preparing patch.

andrewboltachev16:04:40

Hello. Speaking of Google Closure Compiler and ReactJS, is it possible that on :advanced this line would be optimized away https://github.com/facebook/react/blob/master/packages/react/src/ReactBaseClasses.js#L26?

juhoteperi16:04:03

@andrewboltachev Possible. But I think unlikely. Why do you think it would be optimized away?

andrewboltachev16:04:43

@juhoteperi In my case I have an instance of a component (`AnimateHeight`) which's prototype.`proto__ (explored in a devtools) has isReactComponent` property in Figwheel but not it production version of generated JS bundle

andrewboltachev16:04:21

by "instance" I mean that it's a result of createElement

juhoteperi16:04:26

Did you try running with :pseudo-names true? isReactComponent is not mentioned in externs so it will be renamed.

andrewboltachev16:04:55

@juhoteperi yes I'm running with :pseudo-names true

andrewboltachev17:04:29

@juhoteperi btw what I see that it's rather eliminated, not renamed

juhoteperi17:04:20

@andrewboltachev Did you try with new Closure-compiler as I mentioned on other channel?

andrewboltachev17:04:10

@juhoteperi well sorry, it's a great mystery for where does the Closure compiler come from. I.e. how do I change it?

juhoteperi17:04:40

Just add this dependency to your project, after cljs: [com.google.javascript/closure-compiler-unshaded "v20180319"]

andrewboltachev17:04:39

will try in a sec, thanks

andrewboltachev17:04:39

seems the same...

juhoteperi17:04:57

And this problem only exists with React Animate Height?

andrewboltachev12:04:21

Not sure. Would possibly try other modules in a test environment/project