Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Aron Gabor
    @ashnur
    and the one the clojurescript people use is even easier
    Aron Gabor
    @ashnur
    i am having this constant issue that some elements are reused
    instead of replaced
    Chris Vickery
    @chrisinajar
    have you tried using key?
    Daniel Buckmaster
    @crabmusket
    hyperscript is definitely a DSL. I meant that I was looking for something mostly HTML rather than something completely different. Even Vue's templates, which are implemented in entirely HTML syntax, are a form of DSL - I guess the difference is it's embedded in HTML rather than in JS
    Clément
    @kigiri
    @chrisinajar Can you point me to some documentation about the key ?
    Is it just a specific property used by the virtualdom ? We can simply set it in virtual hyperscript props then ?
    Chris Vickery
    @chrisinajar
    @kigiri yeah, it basically tells vdom that an existing element with this key should be reused when patching if possible. It's mostly great when you have lists of elements that you're reordering. https://github.com/Raynos/virtual-hyperscript#key
    Clément
    @kigiri
    Thx
    I use d3js inside a div and so i don't want the vdom to mutate it because it keeps the content
    Chris Vickery
    @chrisinajar
    @kigiri for that you probably need a thunk
    Clément
    @kigiri
    I tought thunks where for optimisation purpose
    Chris Vickery
    @chrisinajar
    they are, but it's also a way to say "Hey, vdom, ignore everything underneath this node"
    so that way you can manage it from outside of the loop
    like for d3 or highcharts or stripe or whatever
    Clément
    @kigiri
    Oh nice ok
    Daniel Buckmaster
    @crabmusket
    @chrisinajar do you mean widgets? @kigiri https://github.com/Raynos/mercury/blob/master/docs/widgets.md
    Evan Hackett
    @evanhackett
    Is this project still alive?
    Just found out about mercury and it looks cool. But I don't necessarily want to jump in if it is dead
    Daniel Buckmaster
    @crabmusket
    it's being used, but the repo isn't too active
    FWIW on the one large project I've used it on, we found the codebase was so small and sensible that it was pretty easy to manage even without support or development from others
    especially because so much of it is just virtual-dom, which is not dead
    Aron Gabor
    @ashnur
    @evanhackett afaik I know Raynos considers mercury a finished product that is done in the sense that it doesn't really worth building anything on the core.
    I think that the best way to think about mercury is an example microframework that you can just use as a template. You can add whatever other module you want and replace the things that you don't want. I for example replaced for a project this year all observe-* functions with datascript and added js-csp to it so I can handle all data flow nicely. It became a way more robust and scalable system than mercury is in its current form.
    Evan Hackett
    @evanhackett
    Ah I see. Cool, thanks all
    Jake Verbaten
    @Raynos
    "finished". "done"
    Aron Gabor
    @ashnur
    well, i hope i haven't misrepresented your views @Raynos :D
    Jake Verbaten
    @Raynos
    @ashnur I think you know what I know :D
    Aron Gabor
    @ashnur
    @Raynos I wish :D. But you see, I am putting together another quick frontend for a PoC and my colleagues are like, will you use Angular or React? :D and I am like "not going to waste time on those"
    I think that's my quote for the year with the expression "x is/are/am like" :(
    quota*
    Jake Verbaten
    @Raynos
    @ashnur I heard vue2.0 is simple :P
    Aron Gabor
    @ashnur
    i will have to check it out, maybe they figured something out
    the domdelegator business that's built into virtual-dom is still giving me a hard time time-to-time, but i still don't know any better approach
    i think its the DOM's fault
    (monday is blaming day)
    vuejs/vue#2873 looks good lol
    Daniel Buckmaster
    @crabmusket
    @ashnur I agree, dom-delegator is still the most impenetrable part of mercury for me
    Aron Gabor
    @ashnur
    it's not that complicated
    i think that mercury overconfigures this part, we shouldn't have magic that wraps the handlers, instead we should always wrap it manuall
    then you can just pass the handlerWrapper to the views and everything gets a bit simpler
    Daniel Buckmaster
    @crabmusket
    am I right in thinking that dom-delegator actually performs some kind of event delegation to save memory and not attach new listeners to every element? but that it needs support in virtual-dom to do this?
    Aron Gabor
    @ashnur
    @eightyeight not sure if you still need an answer, but it's not because of saving memory
    afaik
    the crucial problem is that you want static views that can be serialized, however event handlers are not static most of the time they need some bit of state. so dom-delegator wraps events to solve this problem
    Daniel Buckmaster
    @crabmusket
    huh. I can't say I fully understand, but thanks, that makes it a bit clearer. I'd seen a lot of advice about using event delegation (in jQuery, etc.) on pages with lots of elements to improve performance, and the name of the module suggested something similar.
    Steve Lacy
    @stevelacy
    Question regarding large app state.
    I'm on a large (100+ nested views and components) mercury app and would like to 'split out' features into their own render loops.
    I am currently using a hook on load to attach the child view to the dom via appendChild.
    Is there a current documented way of splitting an app into many separate state atoms?
    Grant Callaghan
    @gcallaghan
    hey all, I'm trying to implement the drag handler like in the geometry example. however, I don't enter a render loop until the mouseup event so elements "jump" to position. does this sound familiar to anyone? anybody know what I could be doing wrong?
    Grant Callaghan
    @gcallaghan
    I was able to work around this
    Grant Callaghan
    @gcallaghan
    Looks like it was a difference in behavior between observ-struct and observ-varhash. changes to a varhash value did not seem to invoke a render call
    Grant Callaghan
    @gcallaghan
    @ashnur do you have an example of where you used datascript with mercury? I couldn't find it easily trawling your github repos?
    Aron Gabor
    @ashnur
    @gcallaghan i will have to put it there, so far i only have it elsewhere, and the version i can share is not very complete because it was a constantly evolving project :)