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

Components: release Web Components as Angular components #1381

Closed
alizedebray opened this issue May 4, 2023 · 3 comments · Fixed by #2071
Closed

Components: release Web Components as Angular components #1381

alizedebray opened this issue May 4, 2023 · 3 comments · Fixed by #2071
Assignees
Labels
📦 components Related to the @swisspost/design-system-components package 📦 components-angular Related to the @swisspost/design-system-components-angular package

Comments

@alizedebray
Copy link
Contributor

alizedebray commented May 4, 2023

Currently the Web Components can be used as is in an Angular application.

However, the component inputs are not computed properly, resulting in such a compiler error every time you bind them to a complex value:

Error: src/app/hierarchy/components/hierachy-family3/hierarchy-family3.component.html:61:28 - error NG8002: Can't bind to 'name' since it isn't a known property of 'post-icon'.
1. If 'post-icon' is an Angular component and it has 'name' input, then verify that it is part of this module.
2. If 'post-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.
61                 <post-icon name="{{getSymbol('value')}}"></post-icon>

The current solution would be to declare all Web Components in a separate module with schemas: [CUSTOM_ELEMENTS_SCHEMA] as requested in the error message and explained in this article. To do this, each project has to declare an Angular wrapper for each Web Component it uses.

For this reason, it would be good to use Stencil's ability to generate Angular component wrappers and complement the @swisspost/design-system-components-angular with all components derived from @swisspost/design-system-components.

@alizedebray alizedebray converted this from a draft issue May 4, 2023
@alizedebray alizedebray added this to the Web Components milestone May 4, 2023
@alizedebray alizedebray added 📦 components-angular Related to the @swisspost/design-system-components-angular package 📦 components Related to the @swisspost/design-system-components package labels May 4, 2023
@oliverschuerch
Copy link
Contributor

Try to find a better solution. If there is no, publish the components-angular package.

@pazoozooCH
Copy link

+1
As Angular is used in so many Post projects, design-system components should be first class citizens imho...

@github-actions github-actions bot added the stale label Aug 24, 2023
@gfellerph gfellerph removed the stale label Aug 24, 2023
@gfellerph gfellerph moved this from 📋 Backlog to 🔖 Ready in Design System Production Board Oct 5, 2023
@gfellerph
Copy link
Member

gfellerph commented Oct 5, 2023

This feature is considered necessary for delivering form components and would generally be nice because people started to wrap web components with custom angular components.

  • Enable Angular component output in the stencil config (compile to existing components-angular project folder if possible)
  • Configure value accessor mappings
  • Test Angular output in a test application (separate ticket?)

@oliverschuerch oliverschuerch moved this from 🔖 Ready to 🏗 In progress in Design System Production Board Oct 6, 2023
@oliverschuerch oliverschuerch moved this from 🏗 In progress to 👀 In review in Design System Production Board Nov 2, 2023
@alizedebray alizedebray self-assigned this Nov 27, 2023
@oliverschuerch oliverschuerch moved this from 👀 In review to 🏗 In progress in Design System Production Board Dec 21, 2023
@oliverschuerch oliverschuerch moved this from 🏗 In progress to 👀 In review in Design System Production Board Dec 21, 2023
@alizedebray alizedebray removed their assignment Jan 4, 2024
@oliverschuerch oliverschuerch moved this from 👀 In review to 🏗 In progress in Design System Production Board Jan 11, 2024
@oliverschuerch oliverschuerch moved this from 🏗 In progress to 👀 In review in Design System Production Board Jan 16, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Design System Production Board Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 components Related to the @swisspost/design-system-components package 📦 components-angular Related to the @swisspost/design-system-components-angular package
Projects
Development

Successfully merging a pull request may close this issue.

4 participants