import { DEBUG } from '@glimmer/env'; import { setComponentManager } from '@ember/component'; import GlimmerComponentManager from './-private/ember-component-manager'; import _GlimmerComponent, { type Args } from './-private/component'; import { setOwner, type default as Owner } from '@ember/owner'; /** A component is a reusable UI element that consists of a template and an optional JavaScript class that defines its behavior. For example, someone might make a `button` in the template and handle the click behavior in the JavaScript. Components are broken down into two categories: - Components _without_ JavaScript, that are based only on a template. These are called Template-only or TO components. - Components _with_ JavaScript, which consist of a template and a backing class. Ember ships with two types of JavaScript classes for components: 1. Glimmer components, imported from `@glimmer/component`, which are the default components for Ember Octane (3.15) and more recent editions. 2. Classic components, imported from `@ember/component`, which were the default for older editions of Ember (pre 3.15). Below is the documentation for Template-only and Glimmer components. If you are looking for the API documentation for Classic components, it is [available here](/ember/release/classes/Component). The source code for Glimmer components can be found in [`@glimmer/component`](https://github.com/emberjs/ember.js/tree/main/packages/%40glimmer/component). Note: Prior to Ember 6.8, by default, components were authored in paired `.hbs` and `.js` files. This is still supported, but the default authoring format is now `.gjs` or "template tag". To read more about how components were previously authored, see the [6.7 version of this API documentation](https://api.emberjs.com/ember/6.7/modules/@glimmer%2Fcomponent). ## Defining a Template-only Component The simplest way to create a component is to create a `gjs` file in `app/components` with a `