ef4 / ember-elsewhere

Render elsewhere in the DOM, with nice composition, animation, etc. Based on 100% public API.
MIT License
184 stars 25 forks source link

feature - create `params` property and deprecate sending components in a hash #31

Closed jenweber closed 5 years ago

jenweber commented 5 years ago

Right now, you can send a hash that includes a component and other data/content. However, this causes issues with tools like embroider, which need to have some assurance that the component exists when it's used on the other end, in from-elsewhere.

Here's an example:

{{to-elsewhere named="modal"
               send=(hash body=(component "warning-message")
                          onOutsideClick=(action "close")) }}

What we could do is create a new property, params (or similar) that accepts the hash of models, actions, etc, and send is the only place where you could put a component:

{{to-elsewhere named="modal"
    send=(component "warning-message")
    params=(hash onOutsideClick=(action "close") someOtherThings)
}}

Then, sending a hash could be deprecated, with a very clear migration strategy for the future.