yapplabs / ember-wormhole

Render a child view somewhere else in the DOM.
MIT License
284 stars 68 forks source link

Refactor to public APIs for head/tail #54

Closed mixonic closed 8 years ago

mixonic commented 8 years ago

In the template for ember-wormhole, use helpers that register an element to the parent wormhole component. The wormhole component can then use those elements to move to the target. This lessens the private APIs used by wormhole, but still uses private APIs to access the DOM or Fastboot SimpleDOM based on where the code is running. This could use all private API if we made SimpleDOM a dependency, but that would just inflate the JS payload with little benefit.

This unblocks Fastboot rendering. It will also mean dropping support for Ember versions before 1.13. See https://github.com/yapplabs/ember-wormhole/issues/47 for discussion.

TODO:

mixonic commented 8 years ago

Another pass at the implementation here for review. @krisselden I did not refactor destinationElement away from being a CP. Can we punt that and the refactor away from observers to another pass?

The ember-try config here is updated, perhaps travis needs a cache flush.

I'll flesh out the docs changes later today.

chrislopresto commented 8 years ago

@mixonic I cleared the Travis cache and rekicked the build.

chrislopresto commented 8 years ago

@mixonic Ah, the travis.yml needs to be updated.

mixonic commented 8 years ago

This is pretty wrapped up- @bantic can you please confirm with your fastboot demo app that this PR functions correctly?

I'm actually quite curious what will happen upon initial re-render of the page. The idea for fastboot users might be that the nodes inside that part of the page are destroyed and re-rendered. But we should know what is happening for sure.

bantic commented 8 years ago

@mixonic Yeah, this works great with the demo app I was testing.

lukemelia commented 8 years ago

Nice work on this, all. Thanks for driving the implementation@mixonic! I'm +1 on merging and releasing 0.4.0 assuming @chrislopresto is as well.

bantic commented 8 years ago

Pushed the demo app to Heroku: https://ember-wormhole-fastboot-demo.herokuapp.com/

chrislopresto commented 8 years ago

Onward!