Skip to content

Angular modules not exposed in barrel export #1491

@WesselSmit

Description

@WesselSmit

I am interested in helping provide a fix!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Preact
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

Reproduction case

https://mitosis.builder.io/playground/?outputTab=G4VwpkA%3D&code=JYWwDg9gTgLgBAbzgVwM4FMDKMCGN1wC%2BcAZlBCHAEQACARssADYAm6UAdMBAPQjAwIqYKioBuAFATgAO3xQSOAMYEACuTCpEEuHBk4Q6AFxxUMKLIDmOuDkvG9yEHXYTCE9AA9IsOG0XITPAkyDJKMNwycAByBugAFGAaqCbqEJoAlNq6ShAyZnAA2vqGADSm6DCxhgC6cAC8KBjYeAlU2OgAbuhUGZI2UJXIUFHxNroAPCzAnQB847qIcEnpqBwlBO6LixOyYMgwC9tKqKj1CAhH23C5TNAmVIMsVKVXuoRb17qdOEzI6OcNp8vnkAMIACxwMns53iXXQciy9VmFSqcTh3TkHFwUHsMA4Pz%2B6AywMWPHmXwAEugmHcAIRwACSNyhcCgoTgsjgACV0MoYOUAGr%2FcqYCBMYAscrQOAAGWAAEdGCw6QsJjxpnMbH03EA%3D

Expected Behaviour

(not visible in the playground) but this code will output a Name component and a index.ts (that is used to export all compiled components). In the index.ts I expect all exports from the components (e.g. the actual directive/component and the module) to be exported from the index.ts so we can import all components/directives/modules form a singular source.

So I expect this:

export * from './my-name-component';
export * from './some-other-component';

Actual Behaviour

The index.ts looks like this:

export { default as Name } from './name';

This only exposes the component/directive as that is the default export, but the module (and any other additional exports) are not exposed.

Additional Information

In short. The generated index.ts only exports the default exports, but in Angular we also need access to the module.

Of course the component modules are still exposed using an absolute path, but this is a hassle and generally an anti-pattern.

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