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
Mikko Ahlroth
@Nicd
so this.data is a list of objects which have days key that is a list of days which have xp key that I'm updating
and RE:DOM updates a table I render based on that automatically
how does it detect the change? or does it rerender on every update call?
like the whole table
Juha Lindstedt
@pakastin
It detects new items, reordered items and removed items
And calls update on every item yeah
But don’t worry, most of the DOM updates will just be skipped natively if unchanged
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 😅