Skip to content

[DOC] Removed arguments from willDestroy for Glimmer components#21100

Merged
NullVoxPopuli merged 1 commit intoemberjs:mainfrom
ijlee2:fix-typo-in-documentation
Mar 3, 2026
Merged

[DOC] Removed arguments from willDestroy for Glimmer components#21100
NullVoxPopuli merged 1 commit intoemberjs:mainfrom
ijlee2:fix-typo-in-documentation

Conversation

@ijlee2
Copy link
Copy Markdown
Member

@ijlee2 ijlee2 commented Feb 18, 2026

Background

In a production project, I saw that developers had written the following,

import Component from '@glimmer/component';

export default class MyComponent extends Component {
  willDestroy(...args: Parameters<Component['willDestroy']>): void {
    super.willDestroy(...args);

    // ...
  }
}

when this would suffice:

import Component from '@glimmer/component';

export default class MyComponent extends Component {
  willDestroy(): void {
    super.willDestroy();

    // ...
  }
}

The source code for GlimmerComponent shows that willDestroy doesn't take any arguments, but the API Guides still claim that it does (I'm guessing based on what had happened with the classic Ember component?).

import Component from '@glimmer/component';
import { service } from '@ember/service';

export default class SomeComponent extends Component {
  @service myAnimations;

  willDestroy() {
    super.willDestroy(...arguments);

    this.myAnimations.unregister(this);
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 18, 2026

Estimated Asset Sizes

Diff

Details

This PRmain
╔═══════╤═══════════╤════════╗
║       │ Min       │ Gzip   ║
╟───────┼───────────┼────────╢
║ Total │ 352.16 KB │ 204 KB ║
╚═══════╧═══════════╧════════╝

╔══════════════════════╤═══════════╤═══════════╗
║ @ember/*             │ Min       │ Gzip      ║
╟──────────────────────┼───────────┼───────────╢
║ Total                │ 313.39 KB │ 181.94 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals           │ 36.65 KB  │ 26.21 KB  ║
║ application          │ 13.23 KB  │ 8.09 KB   ║
║ array                │ 13.01 KB  │ 7.46 KB   ║
║ canary-features      │ 304 B     │ 389 B     ║
║ component            │ 2.05 KB   │ 1.59 KB   ║
║ controller           │ 1.96 KB   │ 1.41 KB   ║
║ debug                │ 11.69 KB  │ 8.12 KB   ║
║ deprecated-features  │ 31 B      │ 77 B      ║
║ destroyable          │ 561 B     │ 383 B     ║
║ enumerable           │ 259 B     │ 387 B     ║
║ helper               │ 1.08 KB   │ 804 B     ║
║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
║ modifier             │ 1.22 KB   │ 995 B     ║
║ object               │ 35.94 KB  │ 22.16 KB  ║
║ owner                │ 159 B     │ 178 B     ║
║ renderer             │ 630 B     │ 499 B     ║
║ routing              │ 59.3 KB   │ 34.13 KB  ║
║ runloop              │ 2.36 KB   │ 1.5 KB    ║
║ service              │ 1 KB      │ 845 B     ║
║ template             │ 654 B     │ 523 B     ║
║ template-compilation │ 429 B     │ 366 B     ║
║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
║ template-factory     │ 370 B     │ 374 B     ║
║ test                 │ 923 B     │ 627 B     ║
║ utils                │ 4.11 KB   │ 3.6 KB    ║
║ version              │ 55 B      │ 131 B     ║
╚══════════════════════╧═══════════╧═══════════╝

╔═════════════════╤══════════╤══════════╗
║ @glimmer/*      │ Min      │ Gzip     ║
╟─────────────────┼──────────┼──────────╢
║ Total           │ 38.77 KB │ 22.06 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable     │ 2.95 KB  │ 1.52 KB  ║
║ encoder         │ 81 B     │ 171 B    ║
║ env             │ 38 B     │ 87 B     ║
║ global-context  │ 886 B    │ 545 B    ║
║ manager         │ 977 B    │ 608 B    ║
║ node            │ 175 B    │ 260 B    ║
║ opcode-compiler │ 1.11 KB  │ 894 B    ║
║ owner           │ 159 B    │ 202 B    ║
║ program         │ 252 B    │ 301 B    ║
║ reference       │ 548 B    │ 531 B    ║
║ runtime         │ 10.32 KB │ 5.32 KB  ║
║ tracking        │ 1.34 KB  │ 1.16 KB  ║
║ util            │ 1.94 KB  │ 1.68 KB  ║
║ validator       │ 15.75 KB │ 6.96 KB  ║
║ vm              │ 495 B    │ 569 B    ║
║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
╚═════════════════╧══════════╧══════════╝
╔═══════╤═══════════╤════════╗
║       │ Min       │ Gzip   ║
╟───────┼───────────┼────────╢
║ Total │ 352.16 KB │ 204 KB ║
╚═══════╧═══════════╧════════╝

╔══════════════════════╤═══════════╤═══════════╗
║ @ember/*             │ Min       │ Gzip      ║
╟──────────────────────┼───────────┼───────────╢
║ Total                │ 313.39 KB │ 181.94 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals           │ 36.65 KB  │ 26.21 KB  ║
║ application          │ 13.23 KB  │ 8.09 KB   ║
║ array                │ 13.01 KB  │ 7.46 KB   ║
║ canary-features      │ 304 B     │ 389 B     ║
║ component            │ 2.05 KB   │ 1.59 KB   ║
║ controller           │ 1.96 KB   │ 1.41 KB   ║
║ debug                │ 11.69 KB  │ 8.12 KB   ║
║ deprecated-features  │ 31 B      │ 77 B      ║
║ destroyable          │ 561 B     │ 383 B     ║
║ enumerable           │ 259 B     │ 387 B     ║
║ helper               │ 1.08 KB   │ 804 B     ║
║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
║ modifier             │ 1.22 KB   │ 995 B     ║
║ object               │ 35.94 KB  │ 22.16 KB  ║
║ owner                │ 159 B     │ 178 B     ║
║ renderer             │ 630 B     │ 499 B     ║
║ routing              │ 59.3 KB   │ 34.13 KB  ║
║ runloop              │ 2.36 KB   │ 1.5 KB    ║
║ service              │ 1 KB      │ 845 B     ║
║ template             │ 654 B     │ 523 B     ║
║ template-compilation │ 429 B     │ 366 B     ║
║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
║ template-factory     │ 370 B     │ 374 B     ║
║ test                 │ 923 B     │ 627 B     ║
║ utils                │ 4.11 KB   │ 3.6 KB    ║
║ version              │ 55 B      │ 131 B     ║
╚══════════════════════╧═══════════╧═══════════╝

╔═════════════════╤══════════╤══════════╗
║ @glimmer/*      │ Min      │ Gzip     ║
╟─────────────────┼──────────┼──────────╢
║ Total           │ 38.77 KB │ 22.06 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable     │ 2.95 KB  │ 1.52 KB  ║
║ encoder         │ 81 B     │ 171 B    ║
║ env             │ 38 B     │ 87 B     ║
║ global-context  │ 886 B    │ 545 B    ║
║ manager         │ 977 B    │ 608 B    ║
║ node            │ 175 B    │ 260 B    ║
║ opcode-compiler │ 1.11 KB  │ 894 B    ║
║ owner           │ 159 B    │ 202 B    ║
║ program         │ 252 B    │ 301 B    ║
║ reference       │ 548 B    │ 531 B    ║
║ runtime         │ 10.32 KB │ 5.32 KB  ║
║ tracking        │ 1.34 KB  │ 1.16 KB  ║
║ util            │ 1.94 KB  │ 1.68 KB  ║
║ validator       │ 15.75 KB │ 6.96 KB  ║
║ vm              │ 495 B    │ 569 B    ║
║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
╚═════════════════╧══════════╧══════════╝

@ijlee2 ijlee2 force-pushed the fix-typo-in-documentation branch from 922a7e6 to dfcdd04 Compare February 23, 2026 14:31
@ijlee2 ijlee2 changed the title Removed arguments from willDestroy for Glimmer components [DOC] Removed arguments from willDestroy for Glimmer components Feb 23, 2026
@NullVoxPopuli NullVoxPopuli force-pushed the fix-typo-in-documentation branch from dfcdd04 to f66efa9 Compare March 3, 2026 17:39
@NullVoxPopuli NullVoxPopuli merged commit 11b5af7 into emberjs:main Mar 3, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants