Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP beta] Remove ComponentTemplateDeprecation mixin. #12024

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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