Skip to content

Commit b38529f

Browse files
committed
legacy AST plugins are dropped in ember 4
1 parent b94c637 commit b38529f

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

tests/dummy/lib/module-name-inliner/index.js

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module.exports = {
1010
setupPreprocessorRegistry(type, registry) {
1111
// can only add the plugin with this style on newer Ember versions
1212
registry.add('htmlbars-ast-plugin', this.buildPlugin());
13-
registry.add('htmlbars-ast-plugin', this.buildLegacyPlugin());
1413
},
1514

1615
buildPlugin() {
@@ -44,42 +43,4 @@ module.exports = {
4443
},
4544
};
4645
},
47-
48-
// this type of plugin has worked since at least Ember 2.4+
49-
buildLegacyPlugin() {
50-
return {
51-
name: 'module-name-inliner',
52-
baseDir() {
53-
return __dirname;
54-
},
55-
parallelBabel: {
56-
requireFile: __filename,
57-
buildUsing: 'buildLegacyPlugin',
58-
params: {},
59-
},
60-
61-
plugin: class LegacyPlugin {
62-
constructor(options) {
63-
this.options = options;
64-
}
65-
66-
transform(ast) {
67-
let { meta } = this.options;
68-
let b = this.syntax.builders;
69-
70-
this.syntax.traverse(ast, {
71-
// replacing the mustache with text, like this
72-
// {{module-name-reverser}} -> `some-module-name`
73-
MustacheStatement(node) {
74-
if (node.path.original === 'module-name-reverser') {
75-
return b.text(meta.moduleName.split('').reverse().join(''));
76-
}
77-
},
78-
});
79-
80-
return ast;
81-
}
82-
},
83-
};
84-
},
8546
};

tests/integration/components/ast-plugins-test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ import { hbs } from 'ember-cli-htmlbars';
66
module('tests/integration/components/ast-plugins-test', function (hooks) {
77
setupRenderingTest(hooks);
88

9-
test('stand alone templates have "legacy" AST plugins ran', async function (assert) {
10-
await render(hbs`{{x-module-name-reversed-component}}`);
11-
12-
assert.equal(
13-
this.element.textContent.trim(),
14-
'sbh.tnenopmoc-desrever-eman-eludom-x/stnenopmoc/setalpmet/ymmud'
15-
);
16-
});
17-
189
test('stand alone templates have AST plugins ran', async function (assert) {
1910
await render(hbs`{{x-module-name-inlined-component}}`);
2011

tests/integration/components/test-inline-precompile-test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ module('tests/integration/components/test-inline-precompile', function (hooks) {
3333
assert.equal(this.element.textContent.trim(), 'Wheeeee');
3434
});
3535

36-
test('inline templates have "legacy" AST plugins ran', async function (assert) {
37-
await render(hbsThree('{{module-name-reverser}}', { moduleName: 'hello-template.hbs' }));
38-
39-
assert.equal(this.element.textContent.trim(), 'sbh.etalpmet-olleh');
40-
});
41-
4236
test('inline templates have AST plugins ran', async function (assert) {
4337
await render(hbsThree('{{module-name-inliner}}', { moduleName: 'hello-template.hbs' }));
4438

0 commit comments

Comments
 (0)