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

feat: provide individual components for angular as standalone components #605

Open
d-koppenhagen opened this issue Nov 24, 2022 · 4 comments

Comments

@d-koppenhagen
Copy link
Contributor

With the introduction of Standalone Components with Angular 14, components can be imported and tree-shaked individually without the need of a wrapping module such as DBUIElementsModule.

It would be great if all components can be marked as standalone and imported individually.

@mfranzke
Copy link
Member

This is probably implemented by StencilJS with standalone components, compare to https://github.com/ionic-team/stencil-ds-output-targets/releases/tag/%40stencil%2Fangular-output-target%400.8.0

@mfranzke
Copy link
Member

mfranzke commented Feb 8, 2024

Another team has reported us lately, that they're using Unit-Tests for their standalone Components, and for the ones in which they're importing DBUIElementsModule, exactly this modules doesn't get found by Jest when these tests are run (Cannot find module '@db-ui/ngx-elements/dist/lib' from ComponentXYZ).

Their setup is as described within https://db-ui.github.io/elements/?path=/story/00-intro-frameworks-angular--page, except the import of DBUIElementsModule within the non-existing app.modules.ts, as they're using standalone Components.

The application itself runs fine with DB UI Elements components, but the Unit-tests fail because of the problems described above.

@d-koppenhagen
Copy link
Contributor Author

In theory, it should work without a module when adding the import of DBUIElementsModule to the imports section of a component instead:

@Component({
  imports: [DBUIElementsModule]
})

@tlt26
Copy link

tlt26 commented Feb 19, 2024

In theory, it should work without a module when adding the import of DBUIElementsModule to the imports section of a component instead:

@Component({
  imports: [DBUIElementsModule]
})

After setting up Jest as it is supposed to be like the RI Angular, this works also in practice! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants