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 slash for a namespace in the {{render}} helper #11788

Merged
merged 1 commit into from Jul 17, 2015
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
7 changes: 0 additions & 7 deletions packages/ember-routing-htmlbars/lib/keywords/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ export default {
throw new EmberError('You must pass a templateName to render');
}

// # legacy namespace
let originalName = name;
name = name.replace(/\//g, '.');
Ember.deprecate(`Using a slash for namespacing with the {{render}} render helper has been deprecated.
Please replace "${originalName}" with "${name}" in your call to the {{render}} helper.`, !originalName.match(/\//g));
// \ legacy slash as namespace support

var templateName = 'template:' + name;
Ember.assert(
'You used `{{render \'' + name + '\'}}`, but \'' + name + '\' can not be ' +
Expand Down
30 changes: 0 additions & 30 deletions packages/ember-routing-htmlbars/tests/helpers/render_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,36 +528,6 @@ QUnit.test('{{render}} works with dot notation', function() {
equal(singletonController.uniqueId, view.$().html(), 'rendered with correct singleton controller');
});

QUnit.test('{{render}} works with slash notation', function() {
var template = '{{render "blog/post"}}';

var ContextController = EmberController.extend({ container: container });

var controller;
var id = 0;
var BlogPostController = EmberController.extend({
init() {
this._super.apply(this, arguments);
controller = this;
this.uniqueId = id++;
}
});
container._registry.register('controller:blog.post', BlogPostController);

view = EmberView.create({
container: container,
controller: ContextController.create(),
template: compile(template)
});

Ember.TEMPLATES['blog.post'] = compile('{{uniqueId}}');

expectDeprecation(() => { runAppend(view); }, /Using a slash for namespacing/);

var singletonController = container.lookup('controller:blog.post');
equal(singletonController.uniqueId, view.$().html(), 'rendered with correct singleton controller');
});

QUnit.test('throws an assertion if {{render}} is called with an unquoted template name', function() {
var template = '<h1>HI</h1>{{render home}}';
var controller = EmberController.extend({ container: container });
Expand Down