Comments (3)
Would it be possible to combine this with #50? I know from the examples provided that patching a DOM tree that does not have __incrementalDOMData
is possible. My idea is to inject the HTML generated by such interface via innerHTML
. The benefits I see are:
- Faster DOM node creation for an initial pass.
- Would mitigate problems with
<input>
andtype
definition for IE8 (most of the times,type
is kept constant, so just initializing it correctly the first time would solve the issue, see #60). - As stated in #50, this would also let you render in the server.
In any case, if this is the used approach, I think I would let this outside the standard incremental DOM implementation, so the library keeps its small size.
from incremental-dom.
Lots of good points. I had experimented with generating innerHTML'd strings a while ago. Some things to consider:
- If you are attaching things that are properties (e.g. extra objects you want to store), you may want to do a normal diff pass shortly after the initial render
- innerHTML is faster, but not hugely faster than pure createElement and setAttribute (something like 25% if I recall correctly)
- Need to have logic to escape attribute values and text nodes, in the worst case (lots of text data), this can be a significant amount of time and may cause pure createElement to be faster (a bit fuzzy on this one but I think that is what I saw)
As you said, it should probably be outside the core library. I'm not sure if this repo would be a good place (considering #141) or if perhaps it should be another project entirely.
from incremental-dom.
After looking at the high mutation case, it seems like solving that problem also helps solving the initial creation case (since that is really just a diff with everything as a mutation). It doesn't seem like having this in the core library is really desirable.
from incremental-dom.
Related Issues (20)
- Element Events list HOT 2
- Is Angular 8 Ivy render engine going to effectively replace this project? HOT 2
- Ignoring certain attributes HOT 6
- Update dependencies to remove security warnings
- Extended custom element creation HOT 5
- Issues with webpack and babel HOT 3
- Document: `elementVoid` is incorrect. HOT 2
- Setting prop using Boolean (to trigger prop over attribute) always sets true HOT 7
- DocumentFragment support HOT 5
- Create function loses content HOT 2
- [Performance Advice] Patching to single element or custom elements HOT 16
- Runnable in jsdom (server side rendering)
- Add a module build HOT 2
- Twing implementation HOT 6
- Relationship to Lit / Polymer? HOT 5
- Do not publish ts sources to npm HOT 4
- CDN version not up to date. HOT 2
- Test not launching on macOS 11.2 / Chrome 89
- Details disclosure element <details> adds and removes "open" attribute outside of incrementalDOM HOT 2
- [Performance Advice] `key` parameter for `text()` function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incremental-dom.