Skip to content

Commit

Permalink
Merge pull request #12024 from rwjblue/remove-component-template-depr…
Browse files Browse the repository at this point in the history
…ecation

[CLEANUP beta] Remove `ComponentTemplateDeprecation` mixin.
  • Loading branch information
rwjblue committed Aug 9, 2015
2 parents 16e064a + e75a442 commit bccb1e0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 105 deletions.
58 changes: 0 additions & 58 deletions packages/ember-views/lib/mixins/component_template_deprecation.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/ember-views/lib/views/component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember-metal/core'; // Ember.assert, Ember.Handlebars

import ComponentTemplateDeprecation from 'ember-views/mixins/component_template_deprecation';
import TargetActionSupport from 'ember-runtime/mixins/target_action_support';
import View from 'ember-views/views/view';

Expand Down Expand Up @@ -113,7 +112,7 @@ function validateAction(component, actionName) {
@extends Ember.View
@public
*/
var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, {
var Component = View.extend(TargetActionSupport, {
isComponent: true,
/*
This is set so that the proto inspection in appendTemplatedView does not
Expand Down
34 changes: 0 additions & 34 deletions packages/ember-views/tests/views/component_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,6 @@ QUnit.test('The controller (target of `action`) of an Ember.Component is itself'
strictEqual(component, component.get('controller'), 'A component\'s controller is itself');
});

QUnit.test('A templateName specified to a component is moved to the layoutName', function() {
expectDeprecation(/Do not specify templateName on a Component, use layoutName instead/);
component = Component.extend({
templateName: 'blah-blah'
}).create();

equal(component.get('layoutName'), 'blah-blah', 'The layoutName now contains the templateName specified.');
});

QUnit.test('A template specified to a component is moved to the layout', function() {
expectDeprecation(/Do not specify template on a Component, use layout instead/);
component = Component.extend({
template: 'blah-blah'
}).create();

equal(component.get('layout'), 'blah-blah', 'The layoutName now contains the templateName specified.');
});

QUnit.test('A template specified to a component is deprecated', function() {
expectDeprecation(function() {
component = Component.extend({
template: 'blah-blah'
}).create();
}, 'Do not specify template on a Component, use layout instead.');
});

QUnit.test('A templateName specified to a component is deprecated', function() {
expectDeprecation(function() {
component = Component.extend({
templateName: 'blah-blah'
}).create();
}, 'Do not specify templateName on a Component, use layoutName instead.');
});

QUnit.test('Specifying both templateName and layoutName to a component is NOT deprecated', function() {
expectNoDeprecation();
component = Component.extend({
Expand Down
14 changes: 5 additions & 9 deletions packages/ember/tests/component_registration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ QUnit.test('If a component is registered, it is used', function() {
});


QUnit.test('Late-registered components can be rendered with custom `template` property (DEPRECATED)', function() {
QUnit.test('Late-registered components can be rendered with custom `layout` property', function() {
Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>there goes {{my-hero}}</div>');

expectDeprecation(/Do not specify template on a Component/);

boot(function() {
registry.register('component:my-hero', Ember.Component.extend({
classNames: 'testing123',
template: compile('watch him as he GOES')
layout: compile('watch him as he GOES')
}));
});

Expand Down Expand Up @@ -137,22 +135,20 @@ QUnit.test('Component-like invocations are treated as bound paths if neither tem
equal(Ember.$('#wrapper').text(), 'machty hello world', 'The component is composed correctly');
});

QUnit.test('Assigning templateName to a component should setup the template as a layout (DEPRECATED)', function() {
expect(2);
QUnit.test('Assigning templateName to a component should setup the template as a layout', function() {
expect(1);

Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{#my-component}}{{text}}{{/my-component}}</div>');
Ember.TEMPLATES['foo-bar-baz'] = compile('{{text}}-{{yield}}');

expectDeprecation(/Do not specify templateName on a Component/);

boot(function() {
registry.register('controller:application', Ember.Controller.extend({
'text': 'outer'
}));

registry.register('component:my-component', Ember.Component.extend({
text: 'inner',
templateName: 'foo-bar-baz'
layoutName: 'foo-bar-baz'
}));
});

Expand Down
4 changes: 2 additions & 2 deletions tests/node/app-boot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ if (canUseInstanceInitializers && canUseApplicationVisit) {
QUnit.test("It is possible to render a view in Node", function(assert) {
var View = Ember.Component.extend({
renderer: new Ember._Renderer(new DOMHelper(new SimpleDOM.Document())),
template: compile("<h1>Hello</h1>")
layout: compile("<h1>Hello</h1>")
});

var view = View.create({
Expand Down Expand Up @@ -194,7 +194,7 @@ if (canUseInstanceInitializers && canUseApplicationVisit) {
});

registry.register('component:foo-bar', Ember.Component.extend({
template: compile("<p>The files are *inside* the computer?!</p>")
layout: compile("<p>The files are *inside* the computer?!</p>")
}));

var view = View.create();
Expand Down

0 comments on commit bccb1e0

Please sign in to comment.