Skip to content

Commit

Permalink
Update Code
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe.zkk committed Jan 11, 2024
1 parent 6699a93 commit ad60511
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 48 deletions.
48 changes: 0 additions & 48 deletions _posts/2024-01~03/2024-01-10-virtualdom-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,51 +108,3 @@ html`
* [tagged_templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)
* [ecmascript-language-lexical-grammar](https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#sec-template-literal-lexical-components)

# Virtual DOM 核心作用



* DSL vs JSX
* Ecosystem
* Three.JS
*
*

> The big improvements that React brought to the mainstream were componentization, and popularizing declarative rendering.
> https://news.ycombinator.com/item?id=34621279
> For some reason I thought the virtual DOM was a native feature of the browser
> https://news.ycombinator.com/item?id=34633339


### RTED

> RTED requires O(n2) space as the most space-efficient competitors, and its runtime complexity of O(n3) in the worst case is optimal.

# Virtual DOM 简写

使用 JSX 简写


# References

* https://news.ycombinator.com/item?id=34612162
* https://svelte.dev/blog/virtual-dom-is-pure-overhead
* https://github.com/mbasso/asm-dom
* https://github.com/patrick-steele-idem/morphdom
* https://zhoukekestar.github.io/notes/2017/08/07/webcomponents-demo.html
* https://zhoukekestar.github.io/notes/2017/08/07/beyond-framework.html
* https://github.com/WebReflection/hyperHTML
* https://github.com/AFASSoftware/maquette

* https://en.wikipedia.org/wiki/Virtual_DOM
* https://svelte.dev/blog/virtual-dom-is-pure-overhead
* https://auth0.com/blog/face-off-virtual-dom-vs-incremental-dom-vs-glimmer/


* [RTED: A Robust Algorithm for the Tree Edit Distance](https://vldb.org/pvldb/vol5/p334_mateuszpawlik_vldb2012.pdf)
* [Minimal Edit-Based Diffs for Large Trees](https://dl.acm.org/doi/pdf/10.1145/3340531.3412026)
* [Detecting Changes in XML Documents](https://people.cs.rutgers.edu/~amelie/papers/2002/diff.pdf)
* [Google String diff-match-patch](https://github.com/google/diff-match-patch)
32 changes: 32 additions & 0 deletions _posts/2024-01~03/2024-01-11-virtualdom-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ tags: [note]

### React

批量更新使用 Fiber 优化,将原有的递归不可中断更新,变成循环可中断更新。

* https://github.com/maoxiaoxing/react-study/tree/master/Fiber
* https://juejin.cn/post/6993973502852202503
* https://github.com/acdlite/react-fiber-architecture


# Diff 算法
Expand All @@ -56,12 +59,20 @@ tags: [note]

一个典型的 Diff 算法复杂度为 O(n^3)

![image](https://github.com/zhoukekestar/notes/assets/7157346/66b183db-a3af-421f-8445-65e471419a7c)


* [https://github.com/acdlite/react-fiber-architecture](https://github.com/acdlite/react-fiber-architecture)
* [https://legacy.reactjs.org/docs/reconciliation.html](https://legacy.reactjs.org/docs/reconciliation.html)
* [https://github.com/facebook/react/issues/6170](https://github.com/facebook/react/issues/6170)
* [A Survey on Tree Edit Distance and Related Problems](https://grfia.dlsi.ua.es/ml/algorithms/references/editsurvey_bille.pdf)


### RTED

> RTED requires O(n2) space as the most space-efficient competitors, and its runtime complexity of O(n3) in the worst case is optimal.

# 权衡

React 引入 VirtualDOM 及其出现,另外一个主要原因是 [React Native](https://reactnative.dev/docs/handling-text-input) 的存在。
Expand All @@ -71,9 +82,30 @@ tags: [note]
这是【跨端需求、多端开发效率】与【单端性能、单端开发效率】之间平衡,并没有绝对的优劣,正如 VirtualDOM 的一棵树和二棵树的区别,也是一种平衡。

> Note that a virtual DOM is pure overhead if you already have a real DOM to work with.
>
> https://news.ycombinator.com/item?id=34616031


# Virtual DOM 核心作用



* DSL vs JSX
* Ecosystem
* Three.JS
*
*

> The big improvements that React brought to the mainstream were componentization, and popularizing declarative rendering.
> https://news.ycombinator.com/item?id=34621279
> For some reason I thought the virtual DOM was a native feature of the browser
> https://news.ycombinator.com/item?id=34633339



# References

* https://news.ycombinator.com/item?id=34612162
Expand Down

0 comments on commit ad60511

Please sign in to comment.