Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 19 04:03
    jon49 commented #257
  • Aug 11 19:02
    dependabot[bot] labeled #434
  • Aug 11 19:02
    dependabot[bot] opened #434
  • Aug 11 19:02

    dependabot[bot] on npm_and_yarn

    Bump path-parse from 1.0.6 to 1… (compare)

  • Aug 11 19:02
    dependabot[bot] review_requested #434
  • Jul 30 13:22

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Jul 30 13:22
    dependabot-preview[bot] closed #432
  • Jul 30 13:22
    dependabot-preview[bot] commented #432
  • Jul 30 13:22
    dependabot-preview[bot] labeled #433
  • Jul 30 13:22
    dependabot-preview[bot] review_requested #433
  • Jul 30 13:22
    dependabot-preview[bot] opened #433
  • Jul 30 13:22

    dependabot-preview[bot] on npm_and_yarn

    Bump rollup from 2.44.0 to 2.55… (compare)

  • Jul 28 13:35

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Jul 28 13:35
    dependabot-preview[bot] closed #430
  • Jul 28 13:35
    dependabot-preview[bot] commented #430
  • Jul 28 13:35
    dependabot-preview[bot] labeled #432
  • Jul 28 13:35
    dependabot-preview[bot] review_requested #432
  • Jul 28 13:35
    dependabot-preview[bot] opened #432
  • Jul 28 13:35

    dependabot-preview[bot] on npm_and_yarn

    Bump rollup from 2.44.0 to 2.55… (compare)

  • Jul 27 13:23
    dependabot-preview[bot] labeled #431
Juha Lindstedt
@pakastin
I mean textContent, classList.add/remove etc, ...
Mikko Ahlroth
@Nicd
so I guess in my case it's rendering every TD?
Juha Lindstedt
@pakastin
Yeah, but usually it’s ok and super fast
Mikko Ahlroth
@Nicd
yeah :) also it's not a big table
Juha Lindstedt
@pakastin
You can use Chrome dev tools to see purple flashes
Mikko Ahlroth
@Nicd
I just didn't expect it to work right away :D
good idea
Juha Lindstedt
@pakastin
It’s actually usually faster than for example virtual dom or some other diffing, since DOM is native and that way ”blazing fast” πŸ™‚
Mikko Ahlroth
@Nicd
Screen Shot 2018-04-06 at 22.30.19.png
what I just made
Juha Lindstedt
@pakastin
And even if you diff the changed, DOM would also make another diffing
So with RE:DOM you actually save an extra diffing..
However in your case it could be faster to update without the key..
Then it just inserts/removes based on index
Mikko Ahlroth
@Nicd
don't understand that part about the key. but I checked with devtools and at least any extra paints are avoided, it just paints the changed cell if it changed
Mikko Ahlroth
@Nicd
does RE:DOM remember the data last sent to update?
and skip update if it's the same
Juha Lindstedt
@pakastin
DOM remembers, and will skip
RE:DOM will loop through the items and check out the key. If same in the same place in the DOM, will just trigger update, and DOM will skip if there’s nothing to do
But no appendChild/insertBefore or creation of new items if no need
Without the key it’s even simpler: no need to check out any key, just compare with index
This is what happens:
Juha Lindstedt
@pakastin
Juha Lindstedt
@pakastin
maybe some temporary error – I'm seeing those..
An
@kcjpop
Hi @pakastin, does redom implement any auto-redraw mechanism?
Juha Lindstedt
@pakastin
What do you mean?
An
@kcjpop
like in React if I change this.state or props the UI will auto-redraw
I see in redom docs we use mount and setChildren to manually update the UI
that's redom's way to do I assume?
Juha Lindstedt
@pakastin
Yeah
The point is being logical, not magical πŸ™‚
An
@kcjpop
I see I see, still used to the React way so it's a bit unclear to me :)
Juha Lindstedt
@pakastin
The basic concept of RE:DOM is actually really simple; here I rewrite similar library in ~30min time: https://youtu.be/0nh2EK1xveg 😎
An
@kcjpop
this view is in my Watch Later list for a long time :joy:
Juha Lindstedt
@pakastin
πŸ‘
Mikko Ahlroth
@Nicd
Just released Code::Stats 2.0, so my RE:DOM work is now in production :)
Juha Lindstedt
@pakastin
Cool! I’ll go and see right away! πŸ‘
Looking good! So nice to see RE:DOM in production πŸ€©πŸ‘Œ
Mikko Ahlroth
@Nicd
Just don't look at the code πŸ˜…
Juha Lindstedt
@pakastin
Haha πŸ˜„
Jonas Hungershausen
@jonas-jonas
Hi there! I was wondering, what the best way is to load existing elements (including children) into the redom cache (?). I tried using el with a reference to the actual dom node. That works in part because it doesn't load children of the node.
I'm asking because we render our lists using thymeleaf (java html templating) on the server side but then I'd like to do some operations on the list using redom (after fetching data from the server using fetch). I'd rather not supply the list's content with some kind of rendered json and then render the actual html lists on the client side.
Joona Kulmala
@joona
@jonashungershausen best way I've found is just to initialize those references from DOM. if you are prerendering a list, in most cases you can probably recreate the whole list from the API response. in this case you only need to initialize references to it's ancestors
you can do this.el = document.querySelector('.your-prerendered-component') in the constructor of the component, and it should just work
Will Hoskings
@def14nt
Damn, I'm also making a dom library. In my opinion, the size of the bundled code doesn't matter, because it's designed to be tree shaken if it's written in es6 modules. Nice to be writing a library without coming into contact with a class, lol.
Also, I can't believe people prefer jQuery to this marvellous library. I really don't get it, this is better in every way. es6 modules, tree-skaing, minimal, clean code. Guess old habits really do die hard.