ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Templates do not provide build-time dead-code elimination

Open TSenter opened this issue 10 months ago • 1 comments

🐞 Describe the Bug

Templates do not provide build-time dead-code elimination.

🔬 Minimal Reproduction

Create a new GJS/GTS component:

<template>
  {{#if false}}
    This should never appear
  {{/if}}
</template>

Reproduction: https://stackblitz.com/edit/github-v3j3hzvu. Note that the "Sample C" component works but does not perform DCE.

This is related to embroider-build/embroider#2453

TSenter avatar Apr 15 '25 18:04 TSenter

I think a better example of this would be

{{#if false}}
  should not exist when compiled
{{/if}}

NullVoxPopuli avatar Apr 15 '25 18:04 NullVoxPopuli