Ember.js: Angle Bracket Invocation Syntax

Created on 25 May 2018  路  4Comments  路  Source: emberjs/ember.js

Summary

Now that the Angle Bracket Invocation RFC has been merged (馃帀) this issue aims to track landing the functionality proposed there behind the EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION feature flag.

Where possible individual items will cross link to the related section of the RFC.

Features

  • [x] Static invocation of existing Ember.Component based components via angle brackets with "capital case" component naming (e.g. <FooBar></FooBar> would find app/components/foo-bar.js). Relevant RFC Section
  • [x] Allowing single word component names (as long as they begin with a capital letter). Relevant RFC Section
  • [x] Support for passing named arguments into the component being invoked (e.g. <FooBar @foo={{somethingSpecial}}></FooBar>).
  • [x] Support for passing HTML attributes Relevant RFC Section

    • [x] Should add the specified attributes to an element containing ...attributes

    • [x] Should add the specified attributes to the wrapping element when tagName is not ''

    • [x] Attributes should be added _after_ those specified by the component itself (and therefore "overridable")

    • [x] class attribute should be merged with those in the specified element

  • [x] Block support

    • [x] Block can be passed to the invoked component and yielded to.

    • [x] has-block should be false for "self closing" invocations (e.g. <FooBar />)

    • [x] has-block should be true for normal (not self closing) invocations (e.g. <FooBar></FooBar>)

  • [x] Dynamic Invocations Relevant RFC Section

    • [x] Allow invocation of block params within scope (casing rules are not applicable)

    • [x] Allow invocations that are path lookups (e.g. <this.foo></this.foo>)

    • [x] Allow invocations that are named blocks (e.g. <@foo></@foo>)

Implementation TODO's

Meta

Most helpful comment

This is now enabled by default on canary, and barring any additional issues will be included in the 3.4 series of releases.

All 4 comments

Updated checklist to mark off items from #16686.

Marked has-block support completed (as of https://github.com/emberjs/ember.js/pull/16697) as well as one of the implementation TODO's.

Updated for items completed in https://github.com/emberjs/ember.js/pull/16704.

This is now enabled by default on canary, and barring any additional issues will be included in the 3.4 series of releases.

Was this page helpful?
0 / 5 - 0 ratings