Skip to content

Update components-angular to output standalone components #5766

@alizedebray

Description

@alizedebray

Stencil is currently generating Angular components as non-standalone, which is no longer the recommended approach. Angular now encourages the use of standalone components, and our package should adapt accordingly.

Tasks

  • Update Angular dependencies following the Angular Update Guide in the components-angular package (ng ... commands can also be run with npx @angular/cli ...).
  • Update the output type for Angular components in the components package to use standalone
  • Build both the components and components-angular packages, in that order
  • Convert components-angular/projects/components/src/lib/components.module.ts into a provider (see example below)
  • Replace the PostComponentsModule import with the new provider in the main file of the consumer app
  • Start the consumer app of components-angular and verify that the Angular components work as expected

📦 Library Providers Example

// library.providers.ts
import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';
import { provideEnvironmentInitializer } from '@angular/core';

export function provideLibrary(): EnvironmentProviders {
  return makeEnvironmentProviders([
    provideEnvironmentInitializer({
      provide: 'env-init',
      multi: true,
      useValue: () => {
        // Your init logic here
        console.log('Library initialized');
      },
    }),
    // Other providers if necessary
  ]);
}

Metadata

Metadata

Labels

v10📦 componentsRelated to the @swisspost/design-system-components package📦 components-angularRelated to the @swisspost/design-system-components-angular package

Type

Projects

Status

🚀 Done

Relationships

None yet

Development

No branches or pull requests

Issue actions