Skip to content

Commit

Permalink
Merge pull request #11776 from martndemus/remove-each-as-transform
Browse files Browse the repository at this point in the history
[CLEANUP beta] Remove deprecated `{{each foo as bar}}` AST transform
  • Loading branch information
mmun committed Jul 16, 2015
2 parents 7d15fbc + af870bb commit 96e08c3
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 139 deletions.
17 changes: 0 additions & 17 deletions packages/ember-htmlbars/tests/helpers/each_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,22 +448,6 @@ QUnit.test('it supports {{itemViewClass=}} with {{else}} block (DEPRECATED)', fu
equal(view.$().text(), 'No records!');
});

QUnit.test('it supports non-context switching with {{itemViewClass=}} (DEPRECATED)', function() {
runDestroy(view);
registry.register('view:foo-view', EmberView.extend({
template: compile(`{{person.name}}`)
}));

view = EmberView.create({
template: compile(`{{each person in view.people itemViewClass="foo-view"}}`),
people: people,
container: container
});

runAppend(view);
equal(view.$().text(), 'Steve HoltAnnabelle');
});

QUnit.test('it supports {{emptyView=}}', function() {
var emptyView = EmberView.extend({
template: compile('emptyView:sad panda')
Expand Down Expand Up @@ -1042,5 +1026,4 @@ QUnit.test('pushing a new duplicate key will trigger a useful error (temporary u
);
});

testEachWithItem('{{#each foo in bar}}', false);
testEachWithItem('{{#each bar as |foo|}}', true);
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,8 @@ QUnit.test('a quoteless string parameter should resolve actionName, including pa
var lastAction;
var actionOrder = [];

ignoreDeprecation(function() {
view = EmberView.create({
template: compile('{{#each item in allactions}}<a id="{{item.name}}" {{action item.name}}>{{item.title}}</a>{{/each}}')
});
view = EmberView.create({
template: compile('{{#each allactions as |item|}}<a id="{{item.name}}" {{action item.name}}>{{item.title}}</a>{{/each}}')
});

var controller = EmberController.extend({
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 TransformEachInToBlockParams from 'ember-template-compiler/plugins/transform-each-in-to-block-params';
import TransformWithAsToHash from 'ember-template-compiler/plugins/transform-with-as-to-hash';
import TransformEachIntoCollection from 'ember-template-compiler/plugins/transform-each-into-collection';
import TransformSingleArgEach from 'ember-template-compiler/plugins/transform-single-arg-each';
Expand All @@ -23,7 +22,6 @@ import DeprecateViewHelper from 'ember-template-compiler/plugins/deprecate-view-
import 'ember-template-compiler/compat';

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

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/node/template-compiler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ test('uses plugins with precompile', function() {
var templateOutput;
var templateCompiler = require(path.join(distPath, 'ember-template-compiler'));

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

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

0 comments on commit 96e08c3

Please sign in to comment.