resonance-cascade / cache-component

DEPRECATED: Use nanocomponent. Will continue to operate as normal
https://github.com/choojs/nanocomponent
MIT License
16 stars 2 forks source link

Merge cache-component and nanocomponent (6.0.0) #18

Closed bcomnes closed 7 years ago

bcomnes commented 7 years ago

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:

bcomnes commented 7 years ago

Also renames this._element to this.element.

toddself commented 7 years ago

I definitely like render more than mount in this context since we're not dealing with a virtual dom. THis looks good!

blahah commented 7 years ago

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?

blahah commented 7 years ago

actually render comes before paint - generating the graphics in memory vs drawing on the screen

bcomnes commented 7 years ago

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.

bcomnes commented 7 years ago

@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

yoshuawuyts commented 7 years ago

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 .

bcomnes commented 7 years ago
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
yoshuawuyts commented 7 years ago

PR here https://github.com/hypermodules/cache-component/pull/19

toddself commented 7 years ago

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?

bcomnes commented 7 years ago

I'm not familiar with how glitch works, but I'm open to it 👍

toddself commented 7 years ago

@bcomnes here's a little choo in glitch! https://glitch.com/edit/#!/choo-todo

it's like codepen, but way cooler

bcomnes commented 7 years ago

I was going to do a component showcase but that sounds easier tbh

bcomnes commented 7 years ago

Closing and moving over to https://github.com/choojs/nanocomponent/pull/38