Fork me on GitHub
#reagent
<
2017-10-12
>
juhoteperi10:10:39

What do people think, should I release 0.8.0 as is or try to understand first if there are some problems still we could fix?

juhoteperi10:10:08

Proper release would probably encourage more to try this

juhoteperi10:10:24

There is probably problems with running this on Node, but I think this is caused by bug in Cljs

mikethompson13:10:54

I would release a beta version

mikethompson13:10:27

With an expectation for full release in a month

mikethompson13:10:32

For some the risk of React 16 will be worth it. And they can help to identify problems.

juhoteperi13:10:48

React 16 support is not merged yet

juhoteperi13:10:58

But I could try fixing the problems with it, but keep the 15 as default

mikethompson13:10:12

Sorry, i misunderstood

juhoteperi13:10:51

Made some progress with improving test runner just now, found some strange cases where some React things work differently UMD build vs. Node module and Browser vs. Node 😄

Petrus Theron13:10:08

Trying to use reagent with React Native + Expo. Getting this error:

No such namespace: cljsjs.react, could not locate cljsjs/react.cljs, cljsjs/react.cljc, or JavaScript source providing "cljsjs.react" in file ..boot-expo/zbu/-d8mh6z/main.out/reagent/impl/util.cljs
Dependencies:
[reagent "0.6.0-SNAPSHOT" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]
[re-frame "0.7.0"]
I have shim namespaces under reagent too. Been stuck on this for a few hours 😕

Petrus Theron13:10:59

package.json deps:

"dependencies": {
    "babel-preset-expo": "^4.0.0",
    "expo": "^21.0.0",
    "react": "16.0.0-alpha.12",
    "react-native": ""
  },

kennytilton14:10:52

Been digging, cannot figure out how Reagent supports closures as callbacks, as in this component from the “simple” example:

kennytilton14:10:01

(defn color-input []
  [:div.color-input
   "Time color: "
   [:input {:type "text"
            :value @time-color
            :on-change #(reset! time-color (-> % .-target .-value))}]])

kennytilton14:10:40

Starting to think React is doing that since it has a custom event mechanism.

kennytilton14:10:03

Anyone have a clue or pointer to some relevant doc?

mccraigmccraig15:10:37

what do you mean @hiskennyness - react doesn't have to do anything special to support closures as callbacks - they are just plain js functions

kennytilton15:10:07

Thx, @mccraigmccraig. I was assuming the initial page got generated as a big wodge of string HTML. I thought I read that somewhere as being a performance win vs assembling the nodes in JS. But I think something interesting is going on: inspecting a React page in the debugger the only listeners I see are on the document. And the input element above does not show any event listener, just a ‘react_id” or sth.

mccraigmccraig15:10:13

uh, well you can render server-side... i've heard of some react/reagent users doing that - i've no idea if it's very common to do it though

mccraigmccraig15:10:09

although the http://sentry.io client, raven.js, is rather obscuring their origin

kennytilton15:10:28

OK, I’ll keep digging. Thx for the datapoints.

kennytilton19:10:15

Looks like little if any advantage to building page initially by dumping a big string of HTML into innerHTML. That makes things easier.

mikethompson23:10:15

@hiskennyness Yes, it is React that puts all listeners on the highest DOM level, not the lower levels in the DOM.