Skip to content

gts files are left with side-effecting imports #195

Closed
@NullVoxPopuli

Description

@NullVoxPopuli

I currently get this messaging in my rollup build when updating to the latest blueprint:

[js] (!) Unused external imports
[js] TOC imported from external module "@ember/component/template-only" but never used in "src/components/dialog.gts", "src/components/-private/typed-elements.gts", "src/components/external-link.gts", "src/components/form.gts", "src/components/portal-targets.gts", "src/components/progress.gts", "src/components/shadowed.gts", "src/components/portal.gts", "src/components/popover.gts", "src/components/toggle.gts" and "src/components/switch.gts".
[js] ModifierLike,WithBoundArgs imported from external module "@glint/template" but never used in "src/components/dialog.gts", "src/components/progress.gts", "src/components/popover.gts" and "src/components/switch.gts".
[js] default imported from external module "@ember/routing/router-service" but never used in "src/components/link.gts".
[js] Middleware,MiddlewareData imported from external module "@floating-ui/dom" but never used in "src/components/popover.gts".
[js] Signature imported from external module "ember-velcro/modifiers/velcro" but never used in "src/components/popover.gts".
[js] (!) Generated an empty chunk
[js] "template-registry"
[js] created dist in 738ms

Repro here: universal-ember/ember-primitives#114

Example output:

       │ File: dist/components/switch.js
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ import { fn, hash } from '@ember/helper';
   2   │ import { on } from '@ember/modifier';
   3   │ import { cell } from 'ember-resources';
   4   │ import { uniqueId } from '../utils.js';
   5   │ import { Label } from './-private/typed-elements.js';
   6   │ import { toggleWithFallback } from './-private/utils.js';
   7   │ import { templateOnly } from '@ember/component/template-only';
   8   │ import '@glint/template';
   9   │ import { precompileTemplate } from '@ember/template-compilation';
  10   │ import { setComponentTemplate } from '@ember/component';
  11   │ 

The main issue being the remaining import @glint/template -- which is a type-only package, and in the real code, I have:

import type { WithBoundArgs } from '@glint/template';

So the whole thing should be removed in the emitted js

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions