Precise DOM morphing
morphing typescript dom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move readme sections around

+9 -9
+9 -9
README.md
··· 4 4 5 5 Morphlex is a ~2.3KB (gzipped) DOM morphing library that transforms one DOM tree to match another while preserving element state and making minimal changes. 6 6 7 + ## What makes Morphlex different? 8 + 9 + 1. No cascading mutations from inserts. Simple inserts should be one DOM operation. 10 + 2. No cascading mutations from removes. Simple removes should be one DOM operation. 11 + 3. No cascading mutations from partial sorts. Morphlex finds the longest increasing subsequence for near optimal partial sorts. 12 + 4. It uses `moveBefore` when available, preserving state. 13 + 5. It uses `isEqualNode`, but in a way that is sensitive to the value of form inputs. 14 + 6. It uses id sets inspired by Idiomorph. 15 + 7 16 ## Installation 8 17 9 18 ```bash ··· 70 79 - **`beforeChildrenVisited`**: Called before an element's children are visited during morphing. Return `false` to skip visiting children. 71 80 72 81 - **`afterChildrenVisited`**: Called after an element's children have been visited and morphed. 73 - 74 - ## What makes Morphlex different? 75 - 76 - 1. No cascading mutations from inserts. Simple inserts should be one DOM operation. 77 - 2. No cascading mutations from removes. Simple removes should be one DOM operation. 78 - 3. No cascading mutations from partial sorts. Morphlex finds the longest increasing subsequence for near optimal partial sorts. 79 - 4. It uses `moveBefore` when available, preserving state. 80 - 5. It uses `isEqualNode`, but in a way that is sensitive to the value of form inputs. 81 - 6. It uses id sets inspired by Idiomorph.