Fork me on GitHub
#untangled
<
2017-02-25
>
qqq00:02:29

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

adambrosio00:02:28

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

qqq00:02:54

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

qqq00:02:00

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

adambrosio00:02:12

umm, my guess is that they meant in your ui

adambrosio00:02:18

once you are in a mutation you kinda need to swap

tony.kay00:02:27

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

qqq00:02:58

@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

qqq00:02:09

@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.kay00:02:08

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

qqq01:02:59

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

qqq02:02:28

(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?

qqq02:02:24

got it working, the hd should be a h1

qqq02:02:54

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

qqq02:02:06

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

tony.kay02:02:26

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

tony.kay02:02:41

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

qqq03:02:35

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

qqq03:02:00

oh well, I ugess I accept it

qqq03:02:34

========== 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?

qqq03:02:53

@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?

qqq03:02:20

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.kay03:02:27

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

tony.kay03:02:48

but yes, of course you could do something like that

qqq03:02:23

yeah, this is probagly not worth doing

qqq03:02:25

premature optimization

tony.kay03:02:27

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.kay03:02:43

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

qqq03:02:04

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

tony.kay03:02:13

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

tony.kay03:02:28

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

qqq03:02:46

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

tony.kay03:02:58

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

qqq03:02:02

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

tony.kay03:02:08

closure only used by compiler

tony.kay03:02:24

that is built into Untangled Server

qqq03:02:53

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.kay03:02:54

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

qqq03:02:29

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

tony.kay03:02:31

in that one, it is in user.clj

tony.kay03:02:38

in dev source

tony.kay03:02:03

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

tony.kay03:02:16

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

tony.kay03:02:38

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

qqq03:02:47

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

tony.kay03:02:48

can you run your own server on a port?

qqq03:02:58

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

qqq03:02:07

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

tony.kay03:02:20

In that case you want the new modular support

tony.kay03:02:45

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

qqq03:02:58

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

tony.kay03:02:59

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

tony.kay03:02:12

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

qqq03:02:22

okay; thanks

tony.kay03:02:22

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

qqq05:02:17

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.kay05:02:06

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

tony.kay05:02:33

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.kay05:02:52

full stack, of course

tony.kay05:02:43

license done

qqq05:02:58

Today's a Mathew 7:7 day 🙂

tony.kay05:02:17

does that make me god ? 😜

qqq05:02:27

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

qqq05:02:47

make-untangled-server is simpler than I thought

tony.kay05:02:57

most of Untangled is 😉

qqq05:02:20

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.kay06:02:39

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

qqq06:02:09

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

tony.kay06:02:11

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

tony.kay06:02:51

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

qqq06:02:35

thanks for all your answers today; good night;

qqq07:02:19

========== 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.

claudiu11:02:38

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

qqq11:02:15

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

claudiu11:02:16

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

qqq11:02:04

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

qqq11:02:17

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

claudiu11:02:31

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

qqq11:02:05

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

qqq11:02:21

We should pool our efforts.

qqq11:02:12

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?

claudiu11:02:01

@qqq yep 🙂

claudiu11:02:06

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

qqq21:02:21

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

tony.kay21:02:06

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

qqq21:02:38

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

qqq21:02:47

0-content answer

qqq21:02:24

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

tony.kay21:02:31

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.kay21:02:39

defui, IQuery, Ident are ON

qqq21:02:47

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

tony.kay21:02:56

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

qqq21:02:55

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

tony.kay21:02:32

Think of Untangled as the Batteries Included version of Om Next

tony.kay21:02:34

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.kay21:02:46

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.kay21:02:24

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.kay21:02:58

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.kay21:02:10

at least to get finished and polished

qqq21:02:15

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

qqq21:02:35

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

tony.kay21:02:43

Try building one

tony.kay21:02:55

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.kay21:02:20

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

qqq21:02:37

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

qqq21:02:51

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

tony.kay21:02:03

It covers stock Om Next

qqq21:02:20

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.kay21:02:17

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.kay21:02:00

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.kay23:02:56

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

tony.kay23:02:23

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

tony.kay23:02:48

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

qqq23:02:50

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

tony.kay23:02:06

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