Skip to content

Heavy petting for the contextual component RFC#85

Merged
mmun merged 1 commit intoemberjs:contextual-component-lookupfrom
mixonic:cc-lookup-rewrite
Aug 15, 2015
Merged

Heavy petting for the contextual component RFC#85
mmun merged 1 commit intoemberjs:contextual-component-lookupfrom
mixonic:cc-lookup-rewrite

Conversation

@mixonic
Copy link
Member

@mixonic mixonic commented Aug 15, 2015

@mmun for you to consider.

@mixonic mixonic force-pushed the cc-lookup-rewrite branch 5 times, most recently from f240b64 to 5674aae Compare August 15, 2015 17:18
@mixonic mixonic force-pushed the cc-lookup-rewrite branch from 5674aae to df48cce Compare August 15, 2015 17:19
@workmanw
Copy link

👍 I could definitely see several places in our we could use this.


One question, what about proving class references, rather than strings, to the component helpers. For private component classes? For example:

// app/components/special-button.js
var MyPrivate = Ember.Component.extend({ /* ... */ });

export default Ember.Component.extend({
  myPrivateComponent: MyPrivate

  /* ... */
});
{{!-- app/templates/components/special-button.hbs --}}
{{!-- passed by class, not string --}}
{{component myPrivateComponent}} 

We've got a lot of components in our app that aren't used in block form and have "private" sub-components. It gets kind of messy to have every component in it's own .js file sometimes.


I was secretly hoping to see some mention of a splat-like-operator, but I realize it's probably outside the scope of this RFC.

@mixonic
Copy link
Member Author

mixonic commented Aug 15, 2015

@workmanw splat is being discussed at handlebars-lang/handlebars.js#1050 We're waiting for wycats to clear his stack. Hopefully we green light soon :-)

@mmun has concerns about how we handle the container (and therefor injections etc) on bare classes. I think it may be surmountable. If he is hesitant I would at least like to get the un-controversial version of this rolling so we can land it soon, maybe 2.2 if core approves on Friday.

mmun added a commit that referenced this pull request Aug 15, 2015
Heavy petting for the contextual component RFC
@mmun mmun merged commit 3896108 into emberjs:contextual-component-lookup Aug 15, 2015
@mixonic mixonic mentioned this pull request Aug 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants