Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 25 23:07
    nojvek commented #502
  • Feb 25 23:07
    nojvek commented #502
  • Feb 25 21:26
    nojvek commented #502
  • Feb 25 20:41
    jbwyme commented #502
  • Feb 22 16:10
    mightyiam review_requested #559
  • Feb 22 16:06
    mightyiam opened #559
  • Feb 22 16:06

    mightyiam on renovate

    chore: add a renovate.json conf… (compare)

  • Feb 22 01:57
    mightyiam synchronize #558
  • Feb 22 01:57

    mightyiam on some-eslint-rules

    style: enable eslint rule comma… style: enable eslint rule semi style: enable eslint rule no-un… and 3 more (compare)

  • Feb 22 01:50
    mightyiam commented #558
  • Feb 22 01:48
    mightyiam synchronize #558
  • Feb 22 01:48

    mightyiam on some-eslint-rules

    style: enable eslint rule semi style: enable eslint rule no-un… style: enable eslint rule no-un… and 2 more (compare)

  • Feb 22 01:40
    mightyiam commented #558
  • Feb 22 01:39
    mightyiam commented #558
  • Feb 22 01:38
    mightyiam synchronize #558
  • Feb 22 01:38

    mightyiam on some-eslint-rules

    style: enable eslint rule prefe… chore: upgrade eslint stack style: enable @typescript-eslin… and 6 more (compare)

  • Feb 21 16:25
    paldepind commented #558
  • Feb 21 15:58
    paldepind commented #549
  • Feb 21 06:41
    kuraga commented #552
  • Feb 21 02:02
    mightyiam commented #558
siassaj
@siassaj
Crazy considering how well snabbdom actually works
Mike Reinstein
@mreinstein
my initial impression is definitely one of delight :)
delight, intermingled with terror trying to convert a jquery spaghetti code monster into declarative, snabbdom based UI
siassaj
@siassaj
Good luck mate haha
Mike Reinstein
@mreinstein
maybe someone could give me some pointers on how to do this with snabbdom
I'm dealing with an asynchronous event in the rendering process
I want to inline the contents of an svg file, which I fetch via ajax
here's my complete program, about 50 lines. bare minimum example of where I'm stuck
would someone mind taking a look and giving me a sense of the right way to structure/deal with the solution please?
siassaj
@siassaj
@mreinstein looks more like this
you want to rebuild the entire graph each time state changes
that doesn't mean you have to regenerate the entire graph
but you do need to take the entire vnode graph & throw it into the patcher
also, don't try to 'reuse' graph you've generated previously unless you are careful to deep clone
this is what i mean by 'regenerate'
you might think it's costly to create a whole entire huge piece of vnode graph when the state that changed won't have affected it. So you can have various caching mechanisms in place. But snabbdom internally mutates the vnode graph you throw at it. So make sure that your caching mechanism spits out a cloned copy of the cached subgraph
Mike Reinstein
@mreinstein
hmm, thanks for the thoughtful response!
is svgXml expected to be a text string in this example?
it's actually a DOM node
(fetchSvg generates a dom element)
I guess this is easy to fix, just having fetchSvg omit the lines that parse the svg xml into a dom element is the answer
siassaj
@siassaj
Make a strong
Strong
Strong
Fuuuuuck
String
But actually I’m not 100% sure
Innerhtml might take a node?
Mike Reinstein
@mreinstein
oh
yeah maybe
I guess this isn't an important part of the demo, just wanted to make sure I'm not missing something with the snabbdom api
it looks like a straightforward prop passthrough
the only other thing I've noticed is this code embeds an svg inside an image tag
I guess in reality I'd want to do something more like return h('button', { props: { innerHTML: svgXml } })
thanks again for your help! This is great :)
siassaj
@siassaj
Yeah I didn’t check
I just adjusted the tag
David Boyer
@mangr3n
Are you guys actively working on the code? There's a change to the thunk code which would allow the caller to specify his own value comparison function. I need that.
Mike Reinstein
@mreinstein
Hey I was wondering if anyone would be willing to critique/code review a little app I made based on snabbdom?
I'm still learning and I'd love to hear from the experts and see what people think
Ionut Achim
@monojack
Is there a way to do fragments in snabbdom?
siassaj
@siassaj
@monojack i think you can just return them as an array?
unless i'm imagining something
@mreinstein what would you like to hear?
i don't see any issues with your code quality
siassaj
@siassaj
i would definitely switch to typescript if only to handle the model type properly