untangled

NEW CHANNEL: #fulcro
keatondunsford 2016-12-15T04:17:34.000375Z

I think I know the answer(s), but it’s been a while since I’ve touched on CLJS stuff and I’d like to hear it from you guys, since you’ve been committing so much time towards building a framework to make Om Next succeed: What does Om Next buy you that Reagent doesn’t? Performance wise, “simplicity” wise, query wise, etc. As the Reagent guys point out themselves, they’re very “buzzword-compliant”. And it’s certainly better than Redux by default. But I’m still trying to wrap my head around Redux vs. Relay or Reagent vs. Om Next.

keatondunsford 2016-12-15T05:46:30.000377Z

@ianchow That was exactly what I was looking for. Thank you!

mitchelkuijpers 2016-12-15T08:31:14.000381Z

I will turn that story into a more coherent thing and put it in a blog @keatondunsford @ianchow 😄

🦜 1
tony.kay 2016-12-15T16:37:50.000388Z

@keatondunsford In my opinion, I'd sum it up as: Om Next makes applications simpler in-the-large. Any webdev system is easy/simple in the small. Start mixing in all of the complications larger applications run into and you find yourself wanting to put your eyes out every time you look at code. Untangled makes some of the necessary decisions that Om Next leaves open, making the use easier. So, Untangled is aimed at that sweet spot of minimal incidental complexity, maximal ease. There is a learning curve...so don't mistake that part for the ease 😉

tony.kay 2016-12-15T16:38:09.000389Z

nothing anyone can do about needing to learn in this profession

tony.kay 2016-12-15T16:38:30.000390Z

at least until we have the complete set of software legos 😉

keatondunsford 2016-12-15T16:39:04.000391Z

Totally, and I love that. I’m totally sold and have been for months. Just need to come up with a way to convince my new team to embrace Om.

tony.kay 2016-12-15T16:40:39.000392Z

sadly I've found the hardest problem is the interest in learning. If you can get them to do the getting started videos and the dev guide exercises, then you have a chance.

tony.kay 2016-12-15T16:41:21.000393Z

If you're trying to show examples and convince them, you'll likely fail. They have to get their hands dirty to get it....it is just too different from everything else. FP + co-located queries + rendering as a pure function + graph database on the client + ...

keatondunsford 2016-12-15T16:45:34.000395Z

Luckily my startup chose to use React and Flux for their MVP, so they’re at least in the ballpark. Also, our product is pretty unique and literally functional by nature. I’m now working for Urbit. Urbit’s building a “personal server” that’s as easy to use as an iPhone on top of a clean-slate functional operating system running on an combinator interpreter whose spec gzips to 340 bytes.

1
tony.kay 2016-12-15T16:46:04.000396Z

I mean, you should be having discussions about how this-or-that compares in the long-term maintenance, testability. Maybe a discussion on the pros/cons of cljs itself. Instead you end up talking about isolated features in small contexts because no one knows enough to talk about the large.

keatondunsford 2016-12-15T16:46:10.000397Z

The entire OS is built in a purely functional language we created, called Hoon, which is like Haskell without category theory.

tony.kay 2016-12-15T16:46:56.000399Z

@keatondunsford well, then you at least are in the ballpark 🙂 Way ahead of most, and having done a lot more work than we have, probably. We just assembled the parts.

keatondunsford 2016-12-15T16:47:02.000400Z

On the frontend, we’re essentially making the browser the UI, and need a strong API to be able to build frontends that interface with your Urbit. It seems obvious, if we’re going to redo the whole thing, to move in the GraphQL direction. And it makes even more sense to move in the CLJS direction. Hence, Om Next.

keatondunsford 2016-12-15T16:48:38.000401Z

Btw if anyone is interested in this, I made an #urbit channel here in the Slack. Urbit is a ridiculously cool project, and we need more frontend contributors. I’m spearheading the frontend initiative.

keatondunsford 2016-12-15T16:48:48.000402Z

(shameless plug)

tony.kay 2016-12-15T16:53:54.000403Z

So, since your staff already "gets" FP, it should really be a pretty easy sell. What kind of resistance are you getting?

tony.kay 2016-12-15T16:55:40.000404Z

some of the key things that raised our eyebrows were: Bruce Hauman's talk/demo on figwheel (showing hot code reload in running apps), his devcards stuff (I need to make a video on how we use it...so cool), the idea of rendering as a pure function (which react + fp + immutable data leads to).

tony.kay 2016-12-15T16:56:00.000405Z

Getting a "support VCR viewer" for nearly free.

tony.kay 2016-12-15T16:56:37.000406Z

clj/cljs (one language and data format for front, back, and network xmit)

tony.kay 2016-12-15T16:57:06.000407Z

elimination of controllers, REST, explicit plumbing, state in the UI (Untangled provides plumbing and some add-ons Om Next leaves unspecified)

tony.kay 2016-12-15T16:58:14.000409Z

LISP homoiconic: macros rock when you need them. Other languages suck at this.

tony.kay 2016-12-15T16:59:28.000410Z

Ability to write a specification framework that can render on any number of browsers at once (untangled-spec). The combo of cljs.test, clojure.test, figwheel, and a little bit of glue code led to a very nice result for testing. Works on server same way.

tony.kay 2016-12-15T17:01:04.000412Z

Possible to write all nearly everything as pure functions, which are much easier to test (when written well)

tony.kay 2016-12-15T17:02:13.000413Z

open source language and libraries all on JVM and JSVM.

tony.kay 2016-12-15T17:02:35.000414Z

clj/cljs popular enough to not be too risky

tony.kay 2016-12-15T17:03:13.000415Z

Full interop with React, though you want to be careful what you import, because...you know...state 🙂

tony.kay 2016-12-15T17:04:23.000416Z

Tends to encourage job applicants that are excited about learning and FP...which is a big plus IMHO

tony.kay 2016-12-15T17:05:23.000417Z

Really good developer tooling for an alternative language: (Cursive or NREPL + vim/emacs)

tony.kay 2016-12-15T17:06:55.000418Z

Dynamic language with great interactive dev support: REPL, figwheel, devcards, live updates of specs, IDE features like refactoring, navigation, structural editing.

tony.kay 2016-12-15T17:07:39.000419Z

Google closure compiler integration/optimization/minification/modules

tony.kay 2016-12-15T17:08:31.000420Z

And that's just a list of features....like I said, there are also a lot of real benefits in-the-large.

currentoor 2016-12-15T18:17:59.000421Z

@keatondunsford all of these points are great (especially for people that already believe them) but it’s so hard to convince people with rhetoric alone IMO

tony.kay 2016-12-15T18:18:16.000422Z

yep...that's why I said get your hands dirty

currentoor 2016-12-15T18:18:29.000423Z

at my company i just went ahead and made a prototype of the product we were going to build in my own time

currentoor 2016-12-15T18:18:34.000424Z

using om next

currentoor 2016-12-15T18:19:37.000425Z

then after showing off a prototype that had promise, it was easy to ask for a one week spike to see how far we could get and how the team would feel about it, most of that week was spent with me doing hands on teaching

currentoor 2016-12-15T18:20:23.000426Z

maybe you could try building a prototype first also?

currentoor 2016-12-15T18:20:42.000427Z

i think that was main catalyst for us

tony.kay 2016-12-15T18:21:15.000428Z

I'd highly recommend using Untangled for the prototyping...otherwise you'll get bogged down in the weeds

currentoor 2016-12-15T18:21:28.000429Z

^ this is so true

currentoor 2016-12-15T18:22:21.000430Z

IMO it’s best to fork a working full stack demo project of untangled (TODO list mvc maybe?) and go from there

keatondunsford 2016-12-15T18:23:08.000431Z

I can definitely work on a kind of prototype. That sounds fun. I think the question we’re trying to weigh is how effective we can rally a shared component ecosystem for our platform using Om versus JavaScript. To me it seems like the timing is right as a result of JavaScript/React fatigue, functional programming becoming mainstream, way better performance with the Closure compiler, etc.

keatondunsford 2016-12-15T18:23:55.000432Z

I’m also kind of interested in the ReasonML/Ocaml approach that Sean Grove (has been involved in the ClojureScript community for a while) has been evangelizing recently.

currentoor 2016-12-15T18:24:59.000433Z

what do you mean by shared component system?

keatondunsford 2016-12-15T18:25:11.000434Z

Like, if the platform is good enough (which it is), as history’s shown with people writing Emacs extensions or CoffeeScript plugins for Atom, I think people would be able to accept the newness of Om.

currentoor 2016-12-15T18:25:47.000435Z

oh i see

currentoor 2016-12-15T18:26:15.000436Z

FWIW we don’t use any om next component libraries in our app

currentoor 2016-12-15T18:27:19.000437Z

but we’ve been able to use js stuff like this just fine https://facebook.github.io/fixed-data-table/example-object-data.html https://hacker0x01.github.io/react-datepicker/

currentoor 2016-12-15T18:27:31.000439Z

just wrote some om next components to wrap them

tony.kay 2016-12-15T18:27:35.000440Z

we've used victory charts

tony.kay 2016-12-15T18:28:18.000441Z

there are even demos of that in the devguide advanced UI section

tony.kay 2016-12-15T18:28:52.000442Z

and d3, which is also covered some in the UI sections of devguide

tony.kay 2016-12-15T18:29:31.000443Z

we're slowly working on an untangled-components library, which will leverage the CSS tools in untangled-stylekit. Neither of those is close to production-ready yet, though.

tony.kay 2016-12-15T18:29:43.000444Z

The form support in components is going to rock

gardnervickers 2016-12-15T18:29:51.000445Z

Our project uses ~20 other projects from the React ecosystem, from CodeMirror to ReactColor. It was all golden once we figured out how to use Webpack 😉

tony.kay 2016-12-15T18:29:52.000446Z

it's really close, actually

tony.kay 2016-12-15T18:30:07.000447Z

@gardnervickers Dude! You have to share that knowledge!

tony.kay 2016-12-15T18:30:23.000448Z

I have not had time to figure it out, but desperately want to

gardnervickers 2016-12-15T18:30:30.000449Z

Gladly!

tony.kay 2016-12-15T18:30:37.000450Z

did you get it so you can just require stuff and closure picks it up?

tony.kay 2016-12-15T18:30:41.000451Z

and optimizes it?

tony.kay 2016-12-15T18:31:30.000452Z

@gardnervickers BTW, I'm pushing an update to 0.6.1-SNAPSHOT that should fix your app state problem

gardnervickers 2016-12-15T18:31:32.000453Z

Unfortunately it’s left out of advanced compilation but we generate externs with a plugin, lein extern that just searches for method calls.

keatondunsford 2016-12-15T18:32:00.000454Z

So the way web/mobile development works today is you build your "app", which by definition comprises both a backend and a frontend. On Urbit, we want to change this paradigm towards an API-centered development ecosystem, whereby all you have to do to build a new service is construct a new API, or add on to an existing one. For example, you might want to add support for a new cryptocurrency in your wallet app, or emoji type in your messaging app, both of which are just general streams of data to which you can overlay any kind of personalizable UI to run these, since all of this application logic is being run on your personal server which you control, whereby you can do things like integrate your Facebook, Twitter and iMessage feeds into one app, or ls your Gmail from the command line, or drag and drop your Google Docs into Evernote. So on the frontend, ideally Urbit would have a kind of Github-style repository of cross-platform, purely functional Om components that you can just drop into your app without worrying about the details of what they do, and allowing for a uniform design feel across your apps that looks really clean and just works. So a bit like WeChat or Material Design in that sense. React Native comes into play because it ultimately allows you to "write once, run anywhere" with just a few tweaks for each platform. I.e. for web apps, you wouldn't even write pure React.DOM code. you'd just use React Native components, or ClojureScript-ified RN components, and port them to the web using a library like react-native-web by the twitter guys, i.e. <view> becomes <div>, <text> becomes <p>, and so on. https://github.com/necolas/react-native-web CSS styling also becomes ClojureScript-ified, and potentially in the future we could integrate something like Facebook's new Yoga library.

gardnervickers 2016-12-15T18:32:27.000456Z

I saw that the clojurescript compiler now can handle different module types and (presumably?) run them through advanced compilation. We’re excited to try that out.

2016-12-15T18:33:13.000457Z

Do you use cljsjs at all, or rely on webpack externally for everything?

gardnervickers 2016-12-15T18:33:19.000458Z

We use a mix

currentoor 2016-12-15T18:33:36.000459Z

@gardnervickers please share your webpack secrets 😄

gardnervickers 2016-12-15T18:33:59.000460Z

Making a gist one sec 🙂

currentoor 2016-12-15T18:34:06.000461Z

thanks

tony.kay 2016-12-15T18:35:20.000462Z

0.6.1-SNAPSHOT on clojars. It changes merge-state!, which affect initial-state. It has test coverage, but I've not tried it much with existing apps. Let me know if anyone sees problems. Should clear up litter in app state.

gardnervickers 2016-12-15T18:35:38.000463Z

https://gist.github.com/gardnervickers/bb01fff5a3a14406ba2f00042bdae33e We wanted to bring in react.cljsjs and friends so that Untangled and Om wouldn’t complain about it missing. So our webpack has some externals that are kinda like leiningen :provided dependencies from what I can gather. It essentially tells webpack to replace any calls to require(‘react’) with window.React.

gardnervickers 2016-12-15T18:37:41.000466Z

Then we have a file under /src/js/main.js which is the top-level file webpack reads from. It’s just a bunch of clauses like

import ReactList from ‘react-list’;
window.ReactList = ReactList;

tony.kay 2016-12-15T18:38:34.000467Z

hm. I was hoping for details on the new support for using other module systems with Closure...it's supposed to work at this point, I think...but I don't know how to set it up.

gardnervickers 2016-12-15T18:39:32.000468Z

I think I saw a tweet from David Nolen about that but not much else, I was planning on researching it more. I think with that we won’t need Webpack anymore.

tony.kay 2016-12-15T18:39:46.000469Z

that's my hope

gardnervickers 2016-12-15T18:47:48.000472Z

Cool, looks like that could be a template to work from.

gardnervickers 2016-12-15T18:50:36.000473Z

Btw thank you guys for fixing up my issue!

tony.kay 2016-12-15T18:50:58.000474Z

looks good...it would be nice to see an example trying to use something where the overall library is spread out across a lot of files...maybe you just point at each file?

gardnervickers 2016-12-15T18:51:21.000475Z

It’s usually just in a node_modules/ directory, no?

tony.kay 2016-12-15T18:51:27.000476Z

I may try that out this afternoon and write up a devguide bit for it

tony.kay 2016-12-15T18:51:51.000477Z

yes, but possibly a whole bunch of small files that is meant to be post-processed into one

tony.kay 2016-12-15T18:52:06.000478Z

be nice if we can skip the post-process (webpack/browserify)

tony.kay 2016-12-15T18:52:21.000479Z

but curious if we have to point to each individual file in our project.clj

tony.kay 2016-12-15T18:52:38.000480Z

and how/if cross-requires work from the externals

tony.kay 2016-12-15T18:53:01.000481Z

like I said, I'll just try it out now that I see an example

mitchelkuijpers 2016-12-15T21:43:29.000486Z

@tony.kay I think there is a branch in the om repo where they show it off

tony.kay 2016-12-15T21:43:49.000487Z

really? That would be nice.

mitchelkuijpers 2016-12-15T21:44:09.000488Z

Yeah where they consume react this way

mitchelkuijpers 2016-12-15T21:44:54.000489Z

I am on my phone right now, but I think it was done bij @anmonteiro

anmonteiro 2016-12-15T21:46:18.000490Z

Not following the conversation but you might be looking for: https://github.com/anmonteiro/om/tree/js-modules

tony.kay 2016-12-15T21:46:33.000492Z

thx

mitchelkuijpers 2016-12-15T21:46:38.000493Z

Yes that's the one thnx