Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular modules not exposed in barrel export #1491

Open
1 of 12 tasks
WesselSmit opened this issue Jul 5, 2024 · 0 comments
Open
1 of 12 tasks

Angular modules not exposed in barrel export #1491

WesselSmit opened this issue Jul 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@WesselSmit
Copy link

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.

@WesselSmit WesselSmit added the bug Something isn't working label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant