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 {{with foo as bar}} support #11786

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
2 changes: 1 addition & 1 deletion packages/ember-htmlbars/lib/keywords/with.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {

Ember.assert(
'{{#with foo}} must be called with a single argument or the use the ' +
'{{#with foo as bar}} syntax',
'{{#with foo as |bar|}} syntax',
params.length === 1
);

Expand Down
16 changes: 7 additions & 9 deletions packages/ember-htmlbars/tests/helpers/with_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ function testWithAs(moduleName, templateString, deprecated) {
});
}

testWithAs('ember-htmlbars: {{#with}} helper', '{{#with person as tom}}{{title}}: {{tom.name}}{{/with}}', true);

QUnit.module('Multiple Handlebars {{with foo as bar}} helpers', {
QUnit.module('Multiple Handlebars {{with foo as |bar|}} helpers', {
setup() {
Ember.lookup = lookup = { Ember: Ember };
},
Expand Down Expand Up @@ -147,7 +145,7 @@ QUnit.module('Handlebars {{#with}} globals helper [DEPRECATED]', {
}
});

QUnit.test('it should support #with Foo.bar as qux [DEPRECATED]', function() {
QUnit.test('it should support #with Foo.bar as |qux| [DEPRECATED]', function() {
expectDeprecation(function() {
runAppend(view);
}, /Global lookup of Foo from a Handlebars template is deprecated/);
Expand All @@ -163,7 +161,7 @@ QUnit.test('it should support #with Foo.bar as qux [DEPRECATED]', function() {

QUnit.module('Handlebars {{#with keyword as |foo|}}');

QUnit.test('it should support #with view as foo', function() {
QUnit.test('it should support #with view as |foo|', function() {
var view = EmberView.create({
template: compile('{{#with view as |myView|}}{{myView.name}}{{/with}}'),
name: 'Sonics'
Expand All @@ -181,7 +179,7 @@ QUnit.test('it should support #with view as foo', function() {
runDestroy(view);
});

QUnit.test('it should support #with name as foo, then #with foo as bar', function() {
QUnit.test('it should support #with name as |foo|, then #with foo as |bar|', function() {
var view = EmberView.create({
template: compile('{{#with name as |foo|}}{{#with foo as |bar|}}{{bar}}{{/with}}{{/with}}'),
context: { name: 'caterpillar' }
Expand All @@ -201,7 +199,7 @@ QUnit.test('it should support #with name as foo, then #with foo as bar', functio

QUnit.module('Handlebars {{#with this as |foo|}}');

QUnit.test('it should support #with this as qux', function() {
QUnit.test('it should support #with this as |qux|', function() {
var view = EmberView.create({
template: compile('{{#with this as |person|}}{{person.name}}{{/with}}'),
controller: EmberObject.create({ name: 'Los Pivots' })
Expand All @@ -219,9 +217,9 @@ QUnit.test('it should support #with this as qux', function() {
runDestroy(view);
});

QUnit.module('Handlebars {{#with foo as bar}} with defined controller');
QUnit.module('Handlebars {{#with foo as |bar|}} with defined controller');

QUnit.test('destroys the controller generated with {{with foo as bar controller=\'blah\'}}', function() {
QUnit.test('destroys the controller generated with {{with foo as |bar| controller=\'blah\'}}', function() {
var destroyed = false;
var Controller = EmberController.extend({
willDestroy() {
Expand Down
2 changes: 0 additions & 2 deletions packages/ember-template-compiler/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import compile from 'ember-template-compiler/system/compile';
import template from 'ember-template-compiler/system/template';
import { registerPlugin } from 'ember-template-compiler/plugins';

import TransformWithAsToHash from 'ember-template-compiler/plugins/transform-with-as-to-hash';
import TransformEachIntoCollection from 'ember-template-compiler/plugins/transform-each-into-collection';
import TransformOldBindingSyntax from 'ember-template-compiler/plugins/transform-old-binding-syntax';
import TransformOldClassBindingSyntax from 'ember-template-compiler/plugins/transform-old-class-binding-syntax';
Expand All @@ -20,7 +19,6 @@ import DeprecateViewHelper from 'ember-template-compiler/plugins/deprecate-view-
// used for adding Ember.Handlebars.compile for backwards compat
import 'ember-template-compiler/compat';

registerPlugin('ast', TransformWithAsToHash);
registerPlugin('ast', TransformEachIntoCollection);
registerPlugin('ast', TransformOldBindingSyntax);
registerPlugin('ast', TransformOldClassBindingSyntax);
Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions packages/ember-template-compiler/tests/system/compile_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,3 @@ QUnit.test('the template revision is different than the HTMLBars default revisio

ok(actual.meta.revision !== expected.meta.revision, 'revision differs from default');
});

QUnit.test('{{with}} template deprecation includes moduleName if provided', function() {
var templateString = '{{#with foo as bar}} {{bar}} {{/with}}';

expectDeprecation(function() {
compile(templateString, {
moduleName: 'foo/bar/baz'
});
}, /foo\/bar\/baz/);
});
8 changes: 0 additions & 8 deletions tests/node/template-compiler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ test('can be required', function() {
ok(typeof templateCompiler.template === 'function', 'template function is present');
});

test('uses plugins with precompile', function() {
var templateOutput;
var templateCompiler = require(path.join(distPath, 'ember-template-compiler'));

templateOutput = templateCompiler.precompile('{{#with foo as bar}}{{/with}}');
ok(templateOutput.match(/locals: \["bar"\]/), 'transform with as to block params');
});

test('allows enabling of features', function() {
var templateOutput;
var templateCompiler = require(path.join(distPath, 'ember-template-compiler'));
Expand Down