Open d-koppenhagen opened 1 year ago
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
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.
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]
})
In theory, it should work without a module when adding the import of
DBUIElementsModule
to theimports
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!
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.