HTM 3's caching is really exciting. This video shows how only the dynamic parts of a UI are updated, even though the whole demo is a single function and "renders" every update in full. https://codesandbox.io/s/damp-snow-rjjrt?module=%2Fapp.js …pic.twitter.com/wz2zxdCv2n
-
-
It works in tandem. HTM can be used with anything that uses JSX, basically anything that does this: (type, props, ...children) => Thing The key is that HTM skips that function and returns cached results. UI libs can use this to skip rendering referentially-equal nodes.
-
ok here's a version of the demo innerHTML ("no framework"). I've affectionally dubbed it "innerHTM"http://codesandbox.io/s/innerhtm-v1ugh …
Kraj razgovora
Novi razgovor -
-
-
htm isn't doing diffing, but is now able to detect static parts and provide that info to the backing h() function so those can potentially skip diffing, etc. Wonder if Jason has already been playing around with Preact using this....
-
here's the public bit (iceberg yadda yadda)https://github.com/preactjs/preact/pull/2211 …
Kraj razgovora
Novi razgovor -
-
-
This is one way to give Preact/React/... more info for making those optimization decisions. Also repeated VDOM creation can be skipped for static subtrees. The PR had a rudimentary benchmark (w/ the usual microbenchmark caveats) illustrating some of this:https://github.com/developit/htm/pull/132 …
-
Oh, right: HTM is also used in settings like
@zeithq's integrations platform: https://zeit.co/docs/integrations#htm-support … At work we do something similar: HTM creates JSON structures that are then sent to the client for rendering (with Vue/Preact/...). So that's sort of a non-UI-library scenario
- Još 1 odgovor
Novi razgovor -
-
-
I'm curious about this too. Seems like it could be useful for custom elements.
-
Yup, HTM isn't really dependent on a specific UI framework, it just needs a function for building structures based on the template:https://twitter.com/_developit/status/1219723953771630595 …
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.