modulojs / modulo

A drop-in JavaScript framework for modular web components, kept to about 2000 lines
https://modulojs.org/
GNU Lesser General Public License v2.1
13 stars 1 forks source link

Reconciler improvements and API finalization #20

Open michaelpb opened 1 year ago

michaelpb commented 1 year ago

key=, modulo-ignore

Finalize tag loading, directives, and these sort of attribute directives. Document API and refactor handling.


rerender() API

Finalize when rerender() gets called on subcomponents

Relevant TODO:

    1892                         // TODO: Instead of having one big "rerender" patch,
    1893                         // maybe run a "rerender" right away, but collect
    1894                         // patches, then insert in the patch list here?
    1895                         // Could have renderObj = { component: renderContextRenderObj ... }
    1896                         // And maybe even then dataProps resolve like:
    1897                         // renderObj.component.renderContextRenderObj || renderObj;
    1898                         // OR: Maybe even a simple way to reuse renderObj?

slotting and directive context

There are still bugs around slotting and directive context that might get fixed by a look into here.

michaelpb commented 1 year ago
1509 // TODO: 
1510 //  - Then, re-implement [component.key] and [component.ignore] as TagLoad
1511 //  - Possibly: Use this to then do granular patches (directiveMount etc)

1606     getMatchedNode(elem, keyedElems, keyedOthers) {
1607         // IDEA: Rewrite keying elements with this trick: - Use LoadTag
1608         // directive, removed keyed rival from DOM
1609         /// - Issue: Cursor is scoped per "layer", and non-recursive reconcile
1610         //    not created yet, so reconciler will need to keep keyed elements
1611         /// - Solution: Finish non-recursive reconciler