Closed bcomnes closed 7 years ago
Also renames this._element
to this.element
.
I definitely like render
more than mount
in this context since we're not dealing with a virtual dom. THis looks good!
render
to me implies generating the graphics (like paint
in the browser devtools), where mount
implies attaching it to the DOM. Does that interpretation match other people's?
actually render
comes before paint
- generating the graphics in memory vs drawing on the screen
I changed it to render from mount because all cache-component does by those points is hand the fully rendered element off to the caller. It might not be mounted yet. You have to use _load to know for sure its in the dom.
In practice though with choo, its in the dom by the time didRender is called.
@yoshuawuyts and I are debating if we should keep these lifecycle hooks.
@yoshuawuyts do you want to move nanocomponent to the choo org, and I can merge this branch with that repo? Its not quite ready for release yet but we can at least get this going in the correct repo
Nanocomponent is part of the choo org ✨ https://github.com/choojs/nanocomponent
On Wed, Jul 12, 2017 at 10:10 AM Bret Comnes notifications@github.com wrote:
@yoshuawuyts https://github.com/yoshuawuyts do you want to move nanocomponent to the choo org, and I can merge this branch with that repo? Its not quite ready for release yet but we can at least get this going in the correct repo
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hypermodules/cache-component/pull/18#issuecomment-314689040, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlelD5GHJDLKIIQovhIjCoM5En0jHUks5sNH-BgaJpZM4OQeMb .
bret: for example: we could remove the ES6 example, and put it together with the constructor bind under the same heading
09:35 bret: most of what's different is the way it's constructed, and from there it makes sense - copying the whole initial example makes it trickier to maintain I think
What about putting the examples up on glitch? It would make them very easily runable and people could even easily clone them to mess around?
I'm not familiar with how glitch works, but I'm open to it 👍
@bcomnes here's a little choo in glitch! https://glitch.com/edit/#!/choo-todo
it's like codepen, but way cooler
I was going to do a component showcase but that sounds easier tbh
Closing and moving over to https://github.com/choojs/nanocomponent/pull/38
This adds optional
_load
and_unload
lifecycle methods to cache-component. It also removes_willUpdate
since its redundant with_update
(anything you can do in update you can do in didUpdate).It also renames
_{will,did}Mount
to_{will,did}Render
. We might remove those though, although didRender is still a handy observer free way to interact with a dom node that is freshly mounted in the page, and the on-load hooks are mounted at the same scope as willMount, so maybe those can be merged somehow.Things left to do: