demonstrates a failing test where @ember/template-compiler is left in the output code.
This manifests itself in the default blueprint when two components exist in the same file:
reproduction is simple
Input code:
```gjs
import Component from '@glimmer/component';
export default class Test extends Component {
foo = 1;
}
const Icon = Icon;
```
Which is intermediately (still correct):
```js
import { template } from "@ember/template-compiler";
import Component from '@glimmer/component';
export default class Test extends Component {
foo = 1;
static{
template("", {
component: this,
eval () {
return eval(arguments[0]);
}
});
}
}
const Icon = template("Icon", {
eval () {
return eval(arguments[0]);
}
});
```
Output code:
```js
import '@ember/template-compiler';
import Component from '@glimmer/component';
import { precompileTemplate } from '@ember/template-compilation';
import { setComponentTemplate } from '@ember/component';
import templateOnly from '@ember/component/template-only';
class Test extends Component {
foo = 1;
static {
setComponentTemplate(precompileTemplate("", {
strictMode: true,
scope: () => ({
Icon
})
}), this);
}
}
const Icon = setComponentTemplate(precompileTemplate("Icon", {
strictMode: true
}), templateOnly());
export { Test as default };
//# sourceMappingURL=test.js.map
```
Rollup detects that { template } is unused, but then leaves a side-effecting import for @ember/template-compiler
First commit:
demonstrates a failing test where
@ember/template-compiler
is left in the output code. This manifests itself in the default blueprint when two components exist in the same file:reproduction is simple
Input code: ```gjs import Component from '@glimmer/component'; export default class Test extends Component { foo = 1;Rollup detects that
{ template }
is unused, but then leaves a side-effecting import for@ember/template-compiler