This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-04
Channels
- # admin-announcements (1)
- # alda (2)
- # beginners (52)
- # boot (8)
- # cider (14)
- # cljs-dev (7)
- # cljsrn (5)
- # clojure (4)
- # clojure-belgium (2)
- # clojure-brasil (1)
- # clojure-dev (8)
- # clojure-greece (6)
- # clojure-russia (34)
- # clojure-spec (42)
- # clojurescript (20)
- # cursive (5)
- # funcool (1)
- # hoplon (313)
- # immutant (1)
- # lambdaisland (24)
- # mount (1)
- # om (26)
- # perun (1)
- # planck (2)
- # proton (1)
- # protorepl (6)
- # pure-frame (15)
- # re-frame (14)
- # specter (17)
- # spirituality-ethics (1)
Thanks ! I found the fix and had to go. Will try when I encounter another error... thanks a lot @micha
@micha @leontalbot i was literally going to ask the same thing. Castra errors are very cryptic 😛
@micha you should probably write something in the wiki about performance
i see people constantly asking the same questions
Posted michas explanations from yesterday to Reddit, https://www.reddit.com/r/Clojure/comments/4mi64q/hoplon_vs_react/
Everyone get flame retardant suits on
also, i just wanted to say that i’ve done a few things recently quite fast in hoplon and with minimal bugs
now that i’m feeling a bit more comfortable with it i’m feeling pretty productive 🙂
i built a dashboard at work where i grabbed all the tickets and state transitions from pivotal tracker
and all the ideas from prod pad
and made a “conveyer belt” with live updates showing the in/out for each state
so we could see any bottle necks in our delivery process
i also made boot tasks to give cli tools to get the same info
and made one to spit out all our release notes for anything deployed on a given day
yeah, i did the whole thing in under a week, including general meetings and managing the team getting in the way as well
yeah, i’m still learning about how i like to do hoplon
like, i tried a new file structure last week and that helped, although i had to refactor a bunch of stuff
i now have a folder for each “thing” and stick dom.cljs
, state.cljs
and wire.cljs
in it
well, i got the thumbs up from my gf when she wanted to do some sassing
she said “oh great, now i can see which bits i’m allowed to change” 😛
well, if i learn how to use clojars
i might start putting the “things” up
so then i have like general type components that can be one day separated out into a library, and ui stuff that's specific to the application, etc
so i can pull them in on projects
like, i have a spinny wheel where you can add and remove “things that are loading"
and it will gain a data attribute when at least one thing is loading
that could be useful on any project really
and i have another one that puts system messages in a datascript db
and you can flag each message as “seen"
with a little X icon
and one that captures “last down” and “last up” keys pressed as the events bubble through it...
so yeah, i want to move these somewhere at some point
the user needs to have an event log where they can see the progress of asynchronous processes
like in our application the user can request reports and things that might take some time to complete
so we need to have an event log like you made to give the user access to those jobs that might be running in the cloud
makes sense
having a solid custom element for that would be very useful in all of the things we make
atm, things that are just dom and state can probably go anywhere
and it would be nice to get feedback on them and make them more general
i gotta think about how something that has wire
might be portable
like, anything that goes remote
network
even if i’m not using castra, i take the cell approach as much as possible
i have found that defining that kind of thing in terms of a more abstract state machine helps
ah yeah
so i haven’t got anywhere near that complicated
i spend most of my time in state and dom
and just put the bit that will probably break in wire
so at least i know where to look when something breaks 😛
and hoplon helps keep things sane by exposing all the knobs as attributes that can take cells or functions as values
like as long as you provide a cell with the same type of values you'll be portable in other apps
yeah actually that’s true
i can just provide instructions on how to put the data coming from your wire into my state
hook the attribute up to a cell and the method is called whenever the cell's value changes
@micha here’s an example https://github.com/thedavidmeister/estimate-work/tree/master/src/cljs/project
that’s not useful outside this project at all
but if it actually was, you could totally BYO wire and hook it into project.state/all
and project.state/current
there is of course a pretty clear distinction between "application" and "supporting library code" that evolves over time
if you are the type to refactor things when you add new features, as i think most people who like lisp are
lol, i refactor things to achieve new features
i’m finding clojure and hoplon very natural to the way i like to think
now that i know how it actually works...
i was basically doing a lot of this stuff manually and buggily in js for years
reinventing the same wheel >.<
yes, this is very normal for web dev...
like "why does this button show up in this state, that's confusing. we should move it over there when the user has done this weird thing, and over there when the user did this other thing"
although today i was saying to my gf “yeah, just tell me whatever you want and i’ll build it, no worries"
which was refreshing
and in the end i'd have a crappy thing that wasn't really a result of an architecture, more like an organic mass of special cases
at the same time though, it’s hard to get the right info on hoplon as a n00b
knockout.js and angular.js, when those came out and still didn't solve things that's when we decided to just make hoplon and see if it would help
i knew zero cljs when i started, so reading through the codebase wasn’t an option
i can write docs 🙂
i’ll try to find some time to write up something tomoz
i got a few things on my todo
there’s the same performance q's
i think the summary should just be “cells in memory are faster than dom, and they stop propagation as soon as they can, so stop stressing, it’s faster than your hand coded special cases"
yep and also ui elements that encapsulate their own state means that you don't need to touch them as often from your application
and i want to write about the confusing things that happen if you don’t explicitly reset cells to a default case, so kind of “default states, and dosync"
the missile-command game is a good example of how encapsulation of local state makes things perform well
because that really confused me for ages, and it tripped up a bunch of people in chat too
and i want to write about storage atoms too 🙂
actually, @micha do you have any information about how cells work with animation frames, etc.
is there anything going on there, or in jquery?
we for missile command you have missiles that are coming in from outer space toward your cities
if the icbm is in the radious of the blast from your anti-missile then you destroy the icbm
ah yeah
and you did that in hoplon?
i hadn’t thought of canvas elements
that encapsulation of state in those elements allows us to leverage the gpu as much as possible
like if we needed to update the position of every missile via javelin cells we would get terrible performance
but because of the dependency graph and so on that cells provide you can use higher level abstractions
you probably need both
you probably need the high-end tech demo
that makes perfect sense to me
and you probably need the “nobody got fired for choosing hoplon” style summary/disclaimer
i feel that’s reading between the lines of the constant performance questions
it’s like when you eat something delicious you assume it must be bad for you somehow 😉
also it's the worst when you don't see performance problems until you have a huge application with a lot of time invested in it
yeah, i’m still hoping that doesn’t happen to me
i’m not building anything that complicated
i’m trying to make an app to help people estimate how much work goes into something
so it’s not on that scale, i don’t think
once we create the application it needs to do very little additional work when you interact with it
i got loading
i’m working on an overlay to make it a bit friendlier
yeah i have a gist of what we have for http://app.adzerk.com
oh, actually it’s super easy, the overlay
i’m just using an if-tpl
on a “things are loading” cell
very similar to the spinny wheel
but it looks like shit 😛
so when i say “i’m working on it"
i mean “i’m waiting for the pretty"
we're loading a ton of css, so we ran into issues with flashing unstyled content and whatnot
i’m really not too bothered by the idea of an overlay like what you have
i think it’s getting more and more normal
i see it around the place
the bad thing is taking a long time to load and having memory leaks so you need to refresh all the time lol
i agree
if you put the loading screen
it better be fast once it loaded
you have to pick
it’s either a traditional page refreshy site
or you have a loading period and then keep things snappy after that
like either one large js program and few refreshes, or many tiny js programs and refresh a lot
surely cljs can fix this somehow
with the whole “code is data” thing
aaaah yay
i just did a release
and it works with a real db
ah cells are cool
i got a “current project” cell, and then a function that gets all the data for a given project
and a cell= hooking the two up
so neat
(j/cell= (if (and sente.state/ws-first-open? project.state/current)
(fetch-all! (:id project.state/current))))
anyway, i’m gonna cruise now that i have that up
@micha one day i’ll bug you about how to put things on clojars, then we can share “things"
@thedavidmeister: sure anytime
@micha, I read the todomvc for all of the examples in https://github.com/gadfly361/cljs-todomvc, and hoplon's seemed to be the most elegant and straightforward! Brilliant!
also if you do make that change, don't forget to update the todoFRP-html demo as well to match it
especially since you'd think of todomvc as relatively simple, why would all that be necessary?
it's interesting, because i think something small like todomvc is useful as a sort of yardstick
because being able to do simple things simply, without a lot of boilerplate nonsense is the key building block for making more complex things
if you can't do a simple thing simply, then you won't be able to build a more complex thing out fo simpler things
whenever I try out a new tool or technique I always search for a todo-mvc equivalent to probe for that kind of property
ah, it just links from https://github.com/gadfly361/cljs-todomvc to the hoplon demos repo