untangled

NEW CHANNEL: #fulcro
qqq 2017-02-25T00:38:29.004429Z

inside m/muate, is it safe to do (swap! state ...) instead of om/transact! ?

adambros 2017-02-25T00:39:28.004430Z

yes, as long as you are in the :action thunk and you shouldn’t transact in a mutation

qqq 2017-02-25T00:39:54.004432Z

okay, because earlier osmeone told me to always use om/transact! instead of swap!

qqq 2017-02-25T00:40:00.004433Z

but I guess that's only true for doing pure om/next

adambros 2017-02-25T00:40:12.004434Z

umm, my guess is that they meant in your ui

adambros 2017-02-25T00:40:18.004435Z

once you are in a mutation you kinda need to swap

tony.kay 2017-02-25T00:42:27.004436Z

@qqq you job from this point forward is to advocate for the screen casts to newbies that ask questions that they answer 😉

qqq 2017-02-25T00:43:58.004437Z

@tony.kay: we can run your videos through a speech->text system, build an index of keywords, and whenever someone asks a question, link them to the youtube video w/ correct timestamp

tony.kay 2017-02-25T00:44:14.004438Z

go for it!

qqq 2017-02-25T00:51:09.004440Z

@adambros : so you a "sane" setup: ui.cljs should have om/transact! but no swap!, while mutations.cljs should have swap! but no om/transact! ?

tony.kay 2017-02-25T00:53:08.004441Z

transact is about abstract transactions...mutations are the impl of those abstractions, so of course they do swap

qqq 2017-02-25T01:19:59.004443Z

for anyone else curious: if you want a basic minimal server: https://github.com/untangled-web/getting-started-video/tree/basic-server

qqq 2017-02-25T02:19:28.004445Z

(reset! c.m.core/app (uc/mount @c.m.core/app ui/Root "app"))) <-- I know that this line got executed (console logs before/after) however, nothing is installed in my div with id="app" how do I debug this?

qqq 2017-02-25T02:25:29.004446Z

why is this not rendering? https://gist.github.com/anonymous/ac3792c567783d798d574440bb6d078c (entire project)

qqq 2017-02-25T02:37:24.004447Z

got it working, the hd should be a h1

qqq 2017-02-25T02:49:54.004448Z

do I need org.omcljs/om on the server side?

qqq 2017-02-25T02:50:06.004449Z

(it pulls in a bunch of *.jars, which I don't want as it slows down deployment / jvm startup on GAE)

tony.kay 2017-02-25T02:59:26.004450Z

server-side: sort-of. You want the parser, though you could implement something yourself or just copy in that code.

tony.kay 2017-02-25T02:59:41.004451Z

The easiest thing to do is include it. Also server-side rendering requires it

tony.kay 2017-02-25T02:59:47.004452Z

of course

qqq 2017-02-25T03:04:35.004453Z

my server side depenency went form "just clojure.jar" to 43MB of JARS 😞

qqq 2017-02-25T03:05:00.004454Z

oh well, I ugess I accept it

qqq 2017-02-25T03:20:34.004455Z

========== where in https://github.com/untangled-web/getting-started-video/tree/basic-server/src/server/app is the line where we fire up a http handler to handle "/api" GET requests?

qqq 2017-02-25T03:39:53.004458Z

@tony.kay: regarding dependencies on server side; assuming I am willing to put in the work, would it be possible to parser queries into AST on the client side, send the raw AST over as edn, and rip out the om dependency on the server side?

qqq 2017-02-25T03:40:20.004459Z

is there any fundamental reason why queries must be parsed where the data is , or can we parse the queries statically without seeing the data?

tony.kay 2017-02-25T03:42:27.004460Z

I think you're making your life miserable for very wrong reasons

tony.kay 2017-02-25T03:42:48.004461Z

but yes, of course you could do something like that

qqq 2017-02-25T03:43:23.004462Z

yeah, this is probagly not worth doing

qqq 2017-02-25T03:43:25.004463Z

premature optimization

tony.kay 2017-02-25T03:43:27.004464Z

you still have to process the AST, which is what the parser already does. You'd be MUCH better off copying the parser out of Om Next

tony.kay 2017-02-25T03:43:43.004465Z

and you probably know how I feel about copy-pasted code 🙂

qqq 2017-02-25T03:44:04.004466Z

I actually don't; but the fact the omcljs pulls in google closure into my server side feels icky

tony.kay 2017-02-25T03:44:13.004467Z

you'd be better off specifying lein exclusions of the stuff you don't want/need

tony.kay 2017-02-25T03:44:28.004468Z

then as long as you don't load the namespaces that use that stuff in your app, no problem

qqq 2017-02-25T03:44:46.004469Z

@tony.ka: alright, one more question for tonight while you're here (perhaps more tomorrow):

tony.kay 2017-02-25T03:44:58.004470Z

well, then you can manage that with your project file.

qqq 2017-02-25T03:45:02.004471Z

where in the example code are you registering the api.clj to "localhost/api" rest handler ?

tony.kay 2017-02-25T03:45:08.004472Z

closure only used by compiler

tony.kay 2017-02-25T03:45:24.004473Z

that is built into Untangled Server

qqq 2017-02-25T03:45:53.004474Z

what's the function name for starting untangled server? (I have to force everyting to runinsid gae, so I need to take apart / reassemble parts of this)

tony.kay 2017-02-25T03:45:54.004475Z

it is baked in, though you can augment it with a prefix...or use the new server modular support and build your own. You'd also have to reconfigure the networking on the client side

qqq 2017-02-25T03:46:17.004476Z

sure, but where in https://github.com/untangled-web/getting-started-video/tree/basic-server/src/server/app is the Untangled Server started?

qqq 2017-02-25T03:46:29.004478Z

the two files are < 100 loc together, and I can't see where you're firing up a webserver

tony.kay 2017-02-25T03:46:31.004479Z

in that one, it is in user.clj

tony.kay 2017-02-25T03:46:38.004480Z

in dev source

tony.kay 2017-02-25T03:47:03.004481Z

you'd normally write a main to do deployment startup. In the example, it only has a dev mode.

tony.kay 2017-02-25T03:47:16.004482Z

See the Untangled Template for something that is more set up for deployment.

tony.kay 2017-02-25T03:47:38.004483Z

I don't use GAE...what are the requirements? Can you use an uberjar?

qqq 2017-02-25T03:47:47.004484Z

user.clj clarifies things up; will look into the UntangledTemplate too; thanks!

tony.kay 2017-02-25T03:47:48.004485Z

can you run your own server on a port?

qqq 2017-02-25T03:47:58.004486Z

it users uberwar; I'm running my own ring server inside gae

qqq 2017-02-25T03:48:07.004487Z

ideally, untangled just becoems a route that I can hand to ring

tony.kay 2017-02-25T03:48:20.004488Z

In that case you want the new modular support

tony.kay 2017-02-25T03:48:45.004489Z

@adambros is documenting that, but it already exists. It lets you define the server however you want

qqq 2017-02-25T03:48:58.004490Z

can you point me at the github page for "new modular support" ? is it a tag? (I can't find it vai google)

tony.kay 2017-02-25T03:48:59.004491Z

the "easy" server support does the whole ring stack for you

tony.kay 2017-02-25T03:49:12.004492Z

It is just part of the latest version of untangled-server

qqq 2017-02-25T03:49:22.004493Z

okay; thanks

tony.kay 2017-02-25T03:49:22.004494Z

just a sec...I'll PM you something

qqq 2017-02-25T05:22:17.004496Z

1) https://github.com/untangled-web/untangled-template is a template we "git clone", not a "lein template new ..." right? 2) assuming (1) is true, can we pease put a license on the template, say Public Domain? 🙂

tony.kay 2017-02-25T05:42:06.004499Z

Ah. Yes on (1) and I thought is said MIT

tony.kay 2017-02-25T05:42:16.004500Z

it should

tony.kay 2017-02-25T05:43:33.004501Z

FYI, I just pushed a branch on the cookbook that has an example: 1. That uses the new form support 2. To make a step-by-step survey (wizard) 3. Uses an SQL database for storage and query https://github.com/untangled-web/untangled-cookbook/tree/feature/sql-wizard/recipes/form-wizard

tony.kay 2017-02-25T05:43:52.004503Z

full stack, of course

tony.kay 2017-02-25T05:45:43.004504Z

license done

qqq 2017-02-25T05:55:58.004505Z

Today's a Mathew 7:7 day 🙂

tony.kay 2017-02-25T05:57:17.004506Z

does that make me god ? 😜

qqq 2017-02-25T05:58:27.004507Z

pretty sure God would not have forgotten to add the MIT license

qqq 2017-02-25T05:58:47.004508Z

make-untangled-server is simpler than I thought

tony.kay 2017-02-25T05:58:57.004509Z

most of Untangled is 😉

qqq 2017-02-25T05:59:20.004510Z

it gets passed a (make-web-server), so if I just "invert that", I should be able to "push untagled server into ring" rather than "untangled-server starts it's own webserver"

tony.kay 2017-02-25T06:00:39.004511Z

yep. that's the idea of the new support: make it easy to just plug into Ring

qqq 2017-02-25T06:01:09.004512Z

untangled/server/impl/components/handler.clj is most of where "the plubming" happens, with the /api path

tony.kay 2017-02-25T06:01:11.004513Z

our first draft was "get up quick n easy". Second draft: flexible

tony.kay 2017-02-25T06:02:51.004514Z

I'm turning into a pumpkin. happy server coding. 💤

qqq 2017-02-25T06:03:35.004515Z

thanks for all your answers today; good night;

qqq 2017-02-25T07:58:19.004516Z

========== I must be doing something terribly wrong. After going from "pure clojure.jar" to "untangled.jar + om.jar", my GAE deploy time went from < 30 seconds to 9-minutes 18 seconds.

claudiu 2017-02-25T11:19:38.004517Z

Hi. Is there any difference between template-workspace & template repo ?

qqq 2017-02-25T11:24:15.004518Z

I'm only aware of the untangled-tempalte repo, which worked fine for me.

claudiu 2017-02-25T11:27:16.004519Z

@qqq cool. All working well with untangled client/server on appengine ? 🙂

qqq 2017-02-25T11:29:04.004520Z

I got it working locally with the template. I don't have it working locally with the dev_appserver.sh

qqq 2017-02-25T11:29:17.004521Z

So by "working" I mean it's using the webserver from untangled, not the one from gae.

claudiu 2017-02-25T11:35:31.004522Z

🙂 cool. Pretty much convinced that untangled is the way to go. Trying now to get it all setup with appengine & datastore.

qqq 2017-02-25T11:36:05.004523Z

wait wait; you're trying to set this up on appengine & datastore too?

qqq 2017-02-25T11:36:21.004524Z

We should pool our efforts.

qqq 2017-02-25T11:38:12.004525Z

Just to clarify, your goal is: client side = cljs / untangled server side = clj / untangled / running on Google App Engine, actual data store of the [kw id] value triples via datastore correct?

claudiu 2017-02-25T11:42:01.004526Z

@qqq yep 🙂

claudiu 2017-02-25T11:43:06.004527Z

also server side rendering on appengine 🙂 for fast initial page loads

qqq 2017-02-25T21:04:21.004528Z

@tony.kay: I'm having a trouble seeing Om.Next ends and UnTangled starts. Do you have a talk comparing/contrasting the two?

tony.kay 2017-02-25T21:05:06.004529Z

Untangled is on top of Om Next. It provides the bits you need to glue it all together.

qqq 2017-02-25T21:05:38.004530Z

with all due respect, that's MBA speak, not tech speak 🙂

qqq 2017-02-25T21:05:47.004531Z

0-content answer

qqq 2017-02-25T21:06:24.004532Z

there's not a doc/talk somewhere contrasting the two?

tony.kay 2017-02-25T21:06:31.004533Z

I'm not sure how to answer it. Om Next is most of what you're interacting with. Untangled adds in a number of things: InitialAppState is Untangled

tony.kay 2017-02-25T21:06:39.004534Z

defui, IQuery, Ident are ON

qqq 2017-02-25T21:06:47.004535Z

I guess om/... is omnext, and uc/.... is untangeld

tony.kay 2017-02-25T21:07:25.004536Z

right

tony.kay 2017-02-25T21:12:56.004537Z

database format is the default Om Next format. I'm not sure how teasing apart each thing is necessarily helpful

qqq 2017-02-25T21:13:55.004538Z

If I'm asking weird questions, it's most likely because I have an incorrect mental model.

tony.kay 2017-02-25T21:14:32.004539Z

Think of Untangled as the Batteries Included version of Om Next

tony.kay 2017-02-25T21:15:34.004540Z

and in some ways, it is more focused and opinionated. This is a trade-off: the focus/opinion lets us solve lots of things for you that you would otherwise spend weeks polishing yourself

tony.kay 2017-02-25T21:16:46.004542Z

it also reduces some of the sheer learning curve by reducing the number of knobs you have to deal with down to the ones most people care about.

tony.kay 2017-02-25T21:19:24.004543Z

The model Om Next has you deal with is one where you build "parser emitters" to do basically everything from retrieve data locally to making decisions about remote communication. It's very flexible, but you'll end up needing to make lots and lots of decisions about the "how". For example, how do you lazy load something? You have to think through state manipualations and parser bits and pieces. Untangled solves those problems for you and gives you tools (like the data-fetch namespace) to handle those cases without having to think about the details.

tony.kay 2017-02-25T21:20:58.004544Z

My opinion (having worked through building all of this) is that all of that "glue" on top of Om next you'd have to build can takes man-months of effort and head-scratching.

tony.kay 2017-02-25T21:21:10.004545Z

at least to get finished and polished

qqq 2017-02-25T21:21:15.004546Z

hmm, for purely educational purposes, I should probably build a few apps without untangled just to see what om/next is missing

qqq 2017-02-25T21:21:35.004547Z

otherwise, it's hard to see what untanlged is offering

tony.kay 2017-02-25T21:21:43.004548Z

Try building one

tony.kay 2017-02-25T21:22:55.004549Z

you're right, I should probably make some kind of video showing the guts so you can see what you're getting. Mostly, it is glue around the data model and networking.

tony.kay 2017-02-25T21:23:20.004550Z

well, and the i18n, and the support viewer, etc. But most of those things are very small.

qqq 2017-02-25T21:23:37.004551Z

oh no, I'm not in anyway complaining about the untangled documentation

qqq 2017-02-25T21:23:51.004552Z

just for personal learning, I like to break everything into small pieces, understand them, then put them back together

tony.kay 2017-02-25T21:23:55.004553Z

You should watch my whiteboard talk https://www.youtube.com/watch?v=IlNrmKYA7Ig

tony.kay 2017-02-25T21:24:03.004555Z

It covers stock Om Next

qqq 2017-02-25T21:24:20.004556Z

the one nice thing about taking apart software vs taking about TVs is taht if you can't put it back together, you just to git clone again 🙂

tony.kay 2017-02-25T21:26:17.004557Z

Note all the stuff I end up talking about the reconciler, parsers, remote parsing, etc. Untangled eliminates having to deal with all of that.

tony.kay 2017-02-25T21:27:00.004558Z

You never have to write "read functions". You never have to worry about "remote read decisions" at a parser level. Then there's the merge story, tempid remapping,etc.

tony.kay 2017-02-25T23:44:56.004559Z

My apologies to whoever I've been talking with about modular server support. It is not actually in a release yet 😊

tony.kay 2017-02-25T23:45:23.004560Z

I just realized that we did an internal release on that feature, and didn't ever release it. So, will do so now

tony.kay 2017-02-25T23:45:48.004561Z

I'll also add a branch to the template that shows a simple use of it

qqq 2017-02-25T23:45:50.004562Z

@tony.kay: between this and not uploading the LICENSE to untangled-template, I think you should step down 🙂

tony.kay 2017-02-25T23:46:06.004563Z

oh, ok. I'll go skiing instead...