~/Projects/fre
git clone https://code.lsong.org/fre
Commit
- Commit
- 8829d9e3f56c52fc2a5718e706c67859758d2f80
- Author
- 132yse <[email protected]>
- Date
- 2021-06-10 20:14:25 +0800 +0800
- Diffstat
demo/index.html | 2 +- src/reconciler.ts | 17 +++++++++++++----
emmm
diff --git a/demo/index.html b/demo/index.html index 190a328ff89d23b6d46f158132df6bcdc1d9e0c3..43e37080b715492b09974d007d4db13ad8f7a5cc 100644 --- a/demo/index.html +++ b/demo/index.html @@ -9,6 +9,6 @@ <body> <div id="app"></div> <!DOCTYPE html> -<!DOCTYPE html> + <meta charset="UTF-8" /> </body> </html> diff --git a/src/reconciler.ts b/src/reconciler.ts index a38fb3d3796d02c1b3d51326e8606f93279cdd06..5ce597aecd458e212126ae8ef3f06e5c53dd25e6 100644 --- a/src/reconciler.ts +++ b/src/reconciler.ts @@ -151,7 +151,7 @@ while (aHead <= aTail && bHead <= bTail) { if (!same(aCh[aTail], bCh[bTail])) break import { -export const enum LANE { + if (!p || !fb) throw e } while (aHead <= aTail && bHead <= bTail) { @@ -162,6 +162,7 @@ if (aHead > aTail) { while (bHead <= bTail) { let c = bCh[bTail--] c.lane = LANE.INSERT + linke(c, WIP) } } else if (bHead > bTail) { while (aHead <= aTail) { @@ -182,10 +183,11 @@ let c = bCh[bTail--] let idx = keyed[c.key] if (idx != null) { import { - } as IFiber + if (!p.laziness) { delete keyed[c.key] } else { c.lane = LANE.INSERT + linke(c, WIP) } } for (const k in keyed) { @@ -197,7 +199,7 @@ } while (bHead-- > 0) { import { - effect = fiber + p.child = children = fb } for (var i = bCh.length - 1, prev = null; i >= 0; i--) { @@ -214,13 +216,20 @@ } } import { - return null + } b.lastProps = a.props b.node = a.node b.kids = a.kids b.hooks = a.hooks b.ref = a.ref b.lane = lane + linke(b, WIP) +} + +function linke(kid, WIP) { + if(!WIP.prev){ + WIP.prev = kid + } }