rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
grounded_sage 2018-03-22T08:09:12.000325Z

Is there a standard way to utilize React components in Rum?

rauh 2018-03-22T08:34:14.000079Z

@grounded_sage There is not, you can do it manually like (js/React.createElement js/Foo.bar.The.Component props child0 child1). Reagent provides a special syntax for this: [:> js/The.React.Component props child0 child1], but Sablono (used by Rum) does not provide it

rauh 2018-03-22T08:34:41.000042Z

Plug: With hicada you can do the same [:> ...] syntax

grounded_sage 2018-03-22T08:34:54.000336Z

Oh! I will check that out.

grounded_sage 2018-03-22T08:35:23.000186Z

The problem I have is I am actually very interested in doing React Native for Web. So I'm actually not needing Sablono theoretically.

rauh 2018-03-22T08:36:02.000194Z

Checkout hicada in this case, there is a few ideas to make RN easier in that case with a special config flag

rauh 2018-03-22T08:37:07.000199Z

Eg. define all your components in a single namespace and then just write [:Text {:foo "bar"} child0] and then specify :default-ns in the hicada config

grounded_sage 2018-03-22T08:38:06.000254Z

Have you much experience with RN code in cljs? @rauh

rauh 2018-03-22T08:38:23.000006Z

Nope, I've just toyed with it a few months ago

grounded_sage 2018-03-22T08:38:56.000118Z

I'm very new to the idea. However looking at the RN4W project I'm convinced it's the way forward so giving it a go.

rauh 2018-03-22T08:39:44.000273Z

I tried Flutter the other day. Very impressed. Super quick live reloads. Like 300ms... So very much a figwheel like experience. IDE support is also fantastic.

grounded_sage 2018-03-22T08:47:19.000010Z

Think it has a chance of getting developer mindshare?

grounded_sage 2018-03-22T08:48:09.000022Z

It looks like a fantastic project. Just react is so far ahead in this space I'm curious where people think it fits in.

rauh 2018-03-22T08:48:24.000124Z

I'd say it has more traction than ReactNative. Tons of great work happening.

rauh 2018-03-22T08:48:53.000273Z

Personally I would use Flutter instead of RN for a new project.

grounded_sage 2018-03-22T08:49:32.000403Z

Interesting. Even if you were using Cljs?

rauh 2018-03-22T08:52:05.000130Z

I mean i use CLJS a lot and I love it. But RN was just a pain to setup and the errors are super tough to debug. With Flutter it was just super easy. And by running a repl() function on ever reload I had very much an interactive dev experience. To get a nice UI it was just super easy and fast. I also really like tooling with Android-Studio. It's just so easy to get something on the screen quickly

rauh 2018-03-22T08:53:14.000185Z

It's super quick to get started in Flutter. If you already have the SDK and Android studio it's <10min to have a starting screen.

grounded_sage 2018-03-22T09:01:48.000435Z

Sorry I'm still a noob with Cljs/Clj. What do you mean by this Rum, simple overwrite the sablono.compiler/compile-html macro. ?

grounded_sage 2018-03-22T09:01:58.000398Z

@rauh

rauh 2018-03-22T09:07:09.000029Z

In your src directory you create a file: src/sablono/compiler.clj and write a defn compile-html that takes the hiccup and calls into hicada and returns the CLJS/JS code

rauh 2018-03-22T09:07:31.000479Z

It will be picked up instead of the sablono/compiler.clj file in the sablono jar

grounded_sage 2018-03-22T09:08:42.000405Z

ok

rauh 2018-03-22T09:13:27.000119Z

@grounded_sage In that case you will have to wrap your defc bodies in a call to that html macro.

rauh 2018-03-22T09:14:04.000517Z

When using the hack to overwrite sablono you can just write (defc [..] [:div ...]) instead of (defc [..] (html [:div ...]))

grounded_sage 2018-03-22T09:14:38.000515Z

So I just define it the as a defn with the same body as that macro?

grounded_sage 2018-03-22T09:14:51.000322Z

and called compile-html?

rauh 2018-03-22T09:15:02.000238Z

Yes, correct

rauh 2018-03-22T09:15:15.000309Z

Use a macroexand on the defc to verify it works

grounded_sage 2018-03-22T09:18:34.000189Z

Will be interesting to see if it works. I ended up using Shadow cljs because I was having issues with the library I am using and npm-deps

grounded_sage 2018-03-22T09:36:43.000227Z

Problems I see is not having the reach React has. Targets for desktop, vr. Plus accessibility is a WIP as well. It still needs some work but perhaps it's the better option when people have already fleshed out a prototype and want the perf? Not sure guess we will see.

grounded_sage 2018-03-22T09:39:05.000265Z

Looks like Shadow cljs doesn't like this approach

------ ERROR -------------------------------------------------------------------
 File: jar:file:/Users/wade/.m2/repository/sablono/sablono/0.8.1/sablono-0.8.1.jar!/sablono/core.cljs
Exception: No namespace: sablono.core found
	clojure.core/the-ns (core.clj:4128)
	clojure.core/ns-publics (core.clj:4155)
	clojure.core/ns-publics (core.clj:4155)
	shadow.build.macros/find-macros-in-ns (macros.clj:32)
	shadow.build.macros/find-macros-in-ns (macros.clj:30)
	shadow.build.macros/load-macros (macros.clj:80)
	shadow.build.macros/load-macros (macros.clj:50)
	shadow.build.compiler/post-analyze-ns (compiler.clj:44)