Skip to content

refactor: stop re-exporting components into the app tree - #990

Merged
aklkv merged 1 commit into
mainfrom
refactor/drop-component-app-reexports
Oct 13, 2026
Merged

aklkv merged 1 commit into
mainfrom
refactor/drop-component-app-reexports

Conversation

@aklkv

@aklkv aklkv commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #988 (on #987, on #986): merge those first, then retarget this to main.

The build re-exported every component, icon (2,760) and modifier into the consuming app's tree (ember-addon.app-js, about 3,000 entries), so that loose-mode .hbs templates could resolve them by name, such as <Carbon::TextInput>. Nothing documented that:

  • the README, the Storybook intro and the agent skill all import from the barrels;
  • the repo's tests and Storybook import directly too;
  • src/template-registry.ts, which would have given loose-mode use its types, was still the empty blueprint stub.

The map also made up nearly all of package.json's 346 KB.

Changes

  • App tree: only the three services stay in it (rollup.config.mjs), because the components look them up by name (@service('carbon.dialog-manager'), carbon.notifications, carbon.ai-chat-session). package.json's app-js map drops to three entries, and the file to about 6 KB.

  • Removed: the empty src/template-registry.ts, and src/components/index.ts, which only kept carbon-components-ember/components/index working. The package's "." export and the empty src/index.ts stay as the blueprint has them.

  • Docs: the README says templates must be strict mode, in a callout under Use:

    Strict mode only. Import components, icons and modifiers as above. Loose-mode .hbs templates can't resolve them by name: <Carbon::TextInput> and {{component "carbon/text-input"}} don't work. Write the templates that use them as .gts or .gjs.

    Its install note now says classic ember-cli apps need ember-template-imports. The Storybook intro and the agent skill say the same, and AGENTS.md says not to refer to components by name.

  • Tag's console error no longer calls it Carbon::Tag.

Breaking

  • Loose-mode .hbs templates can't resolve the addon's components, icons or modifiers by name. Import them into .gts or .gjs templates.
  • carbon-components-ember/template-registry and carbon-components-ember/components/index are gone. Import from carbon-components-ember/components.

Verified

  • A clean build puts only the three services in dist/_app_.
  • publint and the type-check pass, and the generated barrels are unchanged.
  • The repo's tests and Storybook import source paths, so they don't depend on the app tree.

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

📖 Docs Preview

Preview has been removed (PR closed or preview label removed).

patricklx
patricklx previously approved these changes Oct 12, 2026
Base automatically changed from refactor/component-file-names to main October 13, 2026 20:47
The build re-exported every component, icon (2,760) and modifier into
the app tree as `components/carbon/...`, so that loose-mode `.hbs`
templates could resolve them by name (`<Carbon::TextInput>`). Nothing
documented that: the README, the Storybook intro and the agent skill all
import from the barrels, the repo's tests and Storybook do too, and
src/template-registry.ts, which would have typed loose-mode use, was
still the empty blueprint stub. The map made up nearly all of
package.json's 346 KB.

Only the three services stay in the app tree, because the components
look them up by name (`service:carbon.dialog-manager`). The empty
template registry goes, and so does src/components/index.ts, which only
kept `carbon-components-ember/components/index` working. The README, the
Storybook intro and the skill say that templates using the components
have to be strict mode, and AGENTS.md says not to refer to them by name.

Breaking: loose-mode `.hbs` templates can't resolve the addon's
components, icons or modifiers by name; import them into `.gts` or
`.gjs` templates. `carbon-components-ember/template-registry` and
`carbon-components-ember/components/index` are gone; import from
`carbon-components-ember/components`.

Signed-off-by: Alexey Kulakov <uni_que@me.com>
@aklkv
aklkv force-pushed the refactor/drop-component-app-reexports branch from 0aa4666 to f96992b Compare October 13, 2026 20:47
github-actions Bot pushed a commit that referenced this pull request Oct 13, 2026
@aklkv
aklkv merged commit 823944d into main Oct 13, 2026
28 of 30 checks passed
@aklkv
aklkv deleted the refactor/drop-component-app-reexports branch October 13, 2026 21:10
github-actions Bot pushed a commit that referenced this pull request Oct 13, 2026
@github-actions github-actions Bot mentioned this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants