Skip to content

Commit

Permalink
Angular 19
Browse files Browse the repository at this point in the history
  • Loading branch information
k-genov committed Jan 10, 2025
1 parent 796aeaa commit 6b1980d
Show file tree
Hide file tree
Showing 61 changed files with 6,379 additions and 5,963 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {SciSashboxComponent, SciSashDirective} from '@scion/components/sashbox';
templateUrl: './app-details.component.html',
styleUrls: ['./app-details.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './app-list-item.component.html',
styleUrls: ['./app-list-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
SciMaterialIconDirective,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {SciListComponent, SciListItemDirective} from '@scion/components.internal
templateUrl: './app-list.component.html',
styleUrls: ['./app-list.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
RouterLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './app-menu.component.html',
styleUrls: ['./app-menu.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
RouterLink,
RouterLinkActive,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
RouterOutlet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './capability-accordion-item.component.html',
styleUrls: ['./capability-accordion-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
SciQualifierChipListComponent,
SciMaterialIconDirective,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {SciTabbarComponent, SciTabDirective} from '@scion/components.internal/ta
templateUrl: './capability-accordion-panel.component.html',
styleUrls: ['./capability-accordion-panel.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
JsonPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {SciFilterFieldComponent} from '@scion/components.internal/filter-field';
templateUrl: './capability-filter-result.component.html',
styleUrls: ['./capability-filter-result.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {DevToolsManifestService} from '../dev-tools-manifest.service';
/**
* Resolves to the name of an application's symbolic name.
*/
@Pipe({name: 'devtoolsAppName', standalone: true})
@Pipe({name: 'devtoolsAppName'})
export class AppNamePipe implements PipeTransform {

constructor(private _manifestService: DevToolsManifestService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {ParamDefinition} from '@scion/microfrontend-platform';
/**
* Extracts custom metadata associated with a param, if any, otherwise, returns `null`.
*/
@Pipe({name: 'devtoolsCustomParamMetadata', standalone: true})
@Pipe({name: 'devtoolsCustomParamMetadata'})
export class CustomParamMetadataPipe implements PipeTransform {

public readonly builtInProperties = new Set<string>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {Pipe, PipeTransform} from '@angular/core';
/**
* Joins given items by given separator, applying given project function if specified.
*/
@Pipe({name: 'devtoolsJoin', standalone: true})
@Pipe({name: 'devtoolsJoin'})
export class JoinPipe implements PipeTransform {

public transform<T>(items: T[] | null | undefined, separator: string, projectFn?: (value: T) => string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {Pipe, PipeTransform} from '@angular/core';
/**
* Returns `null` if the given object is empty.
*/
@Pipe({name: 'devtoolsNullIfEmpty', standalone: true})
@Pipe({name: 'devtoolsNullIfEmpty'})
export class NullIfEmptyPipe implements PipeTransform {

public transform<T>(value: T): T | null {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {ParamDefinition} from '@scion/microfrontend-platform';
/**
* Filters required or optional parameters.
*/
@Pipe({name: 'devtoolsParamsFilter', standalone: true})
@Pipe({name: 'devtoolsParamsFilter'})
export class ParamsFilterPipe implements PipeTransform {

public transform(params: ParamDefinition[] | undefined | null, filter?: 'required' | 'optional'): ParamDefinition[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './dependent-intentions.component.html',
styleUrls: ['./dependent-intentions.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
KeyValuePipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './filter-field.component.html',
styleUrls: ['./filter-field.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
ReactiveFormsModule,
A11yModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {AsyncPipe} from '@angular/common';
templateUrl: './find-capabilities.component.html',
styleUrls: ['./find-capabilities.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
SciViewportComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {SciQualifierChipListComponent} from '@scion/components.internal/qualifie
templateUrl: './intention-accordion-item.component.html',
styleUrls: ['./intention-accordion-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
SciQualifierChipListComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {AsyncPipe} from '@angular/common';
templateUrl: './intention-accordion-panel.component.html',
styleUrls: ['./intention-accordion-panel.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
*/

import {APP_INITIALIZER, EnvironmentProviders, inject, InjectionToken, Injector, makeEnvironmentProviders, NgZone, runInInjectionContext} from '@angular/core';
import {EnvironmentProviders, inject, InjectionToken, Injector, makeEnvironmentProviders, NgZone, provideAppInitializer, runInInjectionContext} from '@angular/core';
import {ContextService, IntentClient, ManifestService, MessageClient, MicrofrontendPlatformClient, ObservableDecorator, OutletRouter} from '@scion/microfrontend-platform';
import {NgZoneObservableDecorator} from './ng-zone-observable-decorator';
import {Beans} from '@scion/toolkit/bean-manager';
Expand All @@ -24,11 +24,7 @@ export const MICROFRONTEND_PLATFORM_POST_CONNECT = new InjectionToken<unknown>('
*/
export function provideMicrofrontendPlatformClient(): EnvironmentProviders {
return makeEnvironmentProviders([
{
provide: APP_INITIALIZER,
useFactory: connectToHostFn,
multi: true,
},
provideAppInitializer(connectToHostFn),
{provide: MessageClient, useFactory: () => Beans.get(MessageClient)},
{provide: IntentClient, useFactory: () => Beans.get(IntentClient)},
{provide: OutletRouter, useFactory: () => Beans.get(OutletRouter)},
Expand All @@ -40,15 +36,12 @@ export function provideMicrofrontendPlatformClient(): EnvironmentProviders {
/**
* Connects devtools to the host.
*/
function connectToHostFn(): () => Promise<void> {
async function connectToHostFn(): Promise<void> {
const zone = inject(NgZone);
const injector = inject(Injector);

return async (): Promise<void> => {
Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
if (await zone.runOutsideAngular(() => MicrofrontendPlatformClient.connect(environment.symbolicName).then(() => true).catch(() => false))) {
await runInInjectionContext(injector, () => inject(MICROFRONTEND_PLATFORM_POST_CONNECT, {optional: true}));
}
};
Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
if (await zone.runOutsideAngular(() => MicrofrontendPlatformClient.connect(environment.symbolicName).then(() => true).catch(() => false))) {
await runInInjectionContext(injector, () => inject(MICROFRONTEND_PLATFORM_POST_CONNECT, {optional: true}));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './required-capabilities.component.html',
styleUrls: ['./required-capabilities.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
KeyValuePipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {FormControl, ReactiveFormsModule} from '@angular/forms';
selector: 'app-shell',
templateUrl: './app-shell.component.html',
styleUrls: ['./app-shell.component.scss'],
standalone: true,
imports: [
AsyncPipe,
RouterOutlet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [RouterOutlet],
})
export class AppComponent implements OnDestroy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
templateUrl: './browser-outlet.component.html',
styleUrls: ['./browser-outlet.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
ReactiveFormsModule,
SciMaterialIconDirective,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {SciSashboxComponent, SciSashDirective} from '@scion/components/sashbox';
selector: 'app-browser-outlets',
templateUrl: './browser-outlets.component.html',
styleUrls: ['./browser-outlets.component.scss'],
standalone: true,
imports: [
AsyncPipe,
SciSashboxComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {Pipe, PipeTransform, Type} from '@angular/core';
/**
* Casts given value to given type.
*/
@Pipe({name: 'appAs', standalone: true})
@Pipe({name: 'appAs'})
export class AppAsPipe implements PipeTransform {

public transform<T>(value: unknown, type: Type<T>): T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
templateUrl: './context-entry.component.html',
styleUrls: ['./context-entry.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
})
export class ContextEntryComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {SciThrobberComponent} from '@scion/components/throbber';
selector: 'app-devtools',
templateUrl: './devtools.component.html',
styleUrls: ['./devtools.component.scss'],
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA], // required because <sci-router-outlet> is a custom element
imports: [
SciThrobberComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
selector: 'app-lookup-capability',
templateUrl: './lookup-capability.component.html',
styleUrls: ['./lookup-capability.component.scss'],
standalone: true,
imports: [
AsyncPipe,
JsonPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {SciQualifierChipListComponent} from '@scion/components.internal/qualifie
selector: 'app-lookup-intention',
templateUrl: './lookup-intention.component.html',
styleUrls: ['./lookup-intention.component.scss'],
standalone: true,
imports: [
AsyncPipe,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {parseTypedValues} from '../../common/typed-value-parser.util';
selector: 'app-register-capability',
templateUrl: './register-capability.component.html',
styleUrls: ['./register-capability.component.scss'],
standalone: true,
imports: [
AsyncPipe,
JsonPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {SciQualifierChipListComponent} from '@scion/components.internal/qualifie
selector: 'app-register-intention',
templateUrl: './register-intention.component.html',
styleUrls: ['./register-intention.component.scss'],
standalone: true,
imports: [
AsyncPipe,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {Pipe, PipeTransform} from '@angular/core';
* - `null [null]`
* - `undefined [undefined]`
*/
@Pipe({name: 'appAppendParamDataType', standalone: true})
@Pipe({name: 'appAppendParamDataType'})
export class AppendParamDataTypePipe implements PipeTransform {

public transform(params: Map<string, any> | undefined): Map<string, any> | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {SciKeyValueComponent} from '@scion/components.internal/key-value';
selector: 'app-message-list-item',
templateUrl: './message-list-item.component.html',
styleUrls: ['./message-list-item.component.scss'],
standalone: true,
imports: [
SciKeyValueComponent,
AppendParamDataTypePipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {parseTypedValues} from '../../common/typed-value-parser.util';
selector: 'app-publish-message',
templateUrl: './publish-message.component.html',
styleUrls: ['./publish-message.component.scss'],
standalone: true,
imports: [
AsyncPipe,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {SciMaterialIconDirective} from '@scion/components.internal/material-icon
selector: 'app-receive-message',
templateUrl: './receive-message.component.html',
styleUrls: ['./receive-message.component.scss'],
standalone: true,
imports: [
ReactiveFormsModule,
SciFormFieldComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {Beans} from '@scion/toolkit/bean-manager';
/**
* Observes the number of subscribers on a topic.
*/
@Pipe({name: 'appTopicSubscriberCount$', standalone: true})
@Pipe({name: 'appTopicSubscriberCount$'})
export class TopicSubscriberCountPipe implements PipeTransform {

public transform(topic: string): Observable<number> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
import {APP_INITIALIZER, EnvironmentProviders, inject, makeEnvironmentProviders, NgZone} from '@angular/core';
import {EnvironmentProviders, inject, makeEnvironmentProviders, NgZone, provideAppInitializer} from '@angular/core';
import {MicrofrontendPlatformClient, ObservableDecorator} from '@scion/microfrontend-platform';
import {environment} from '../environments/environment';
import {Beans} from '@scion/toolkit/bean-manager';
Expand All @@ -24,24 +24,19 @@ export function provideMicrofrontendPlatformClient(): EnvironmentProviders | []
}

return makeEnvironmentProviders([
{
provide: APP_INITIALIZER,
useFactory: connectToHostFn,
multi: true,
},
provideAppInitializer(connectToHostFn),
]);
}

/**
* Connects to the SCION Microfrontend Platform Host.
*/
function connectToHostFn(): () => Promise<void> {
async function connectToHostFn(): Promise<void> {
const zone = inject(NgZone);
return (): Promise<void> => {
Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
const symbolicName = getCurrentTestingAppSymbolicName();
return zone.runOutsideAngular(() => MicrofrontendPlatformClient.connect(symbolicName));
};

Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
const symbolicName = getCurrentTestingAppSymbolicName();
return zone.runOutsideAngular(() => MicrofrontendPlatformClient.connect(symbolicName));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
*/
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {APP_INITIALIZER, DestroyRef, EnvironmentInjector, EnvironmentProviders, inject, makeEnvironmentProviders, NgZone, PlatformRef, runInInjectionContext} from '@angular/core';
import {DestroyRef, EnvironmentInjector, EnvironmentProviders, inject, makeEnvironmentProviders, NgZone, PlatformRef, provideAppInitializer, runInInjectionContext} from '@angular/core';
import {ApplicationConfig, Handler, IntentInterceptor, IntentMessage, MessageClient, MessageHeaders, MessageInterceptor, MicrofrontendPlatformHost, ObservableDecorator, PlatformCapabilityTypes, TopicMessage} from '@scion/microfrontend-platform';
import {environment} from '../environments/environment';
import {TestingAppTopics} from './testing-app.topics';
Expand All @@ -30,14 +30,7 @@ export function provideMicrofrontendPlatformHost(): EnvironmentProviders | [] {
}

return makeEnvironmentProviders([
{
provide: APP_INITIALIZER,
useFactory: () => {
const environmentInjector = inject(EnvironmentInjector);
return (): Promise<void> => runInInjectionContext(environmentInjector, startMicrofrontendPlatformHost);
},
multi: true,
},
provideAppInitializer(() => runInInjectionContext(inject(EnvironmentInjector), startMicrofrontendPlatformHost)),
]);
}

Expand Down
Loading

0 comments on commit 6b1980d

Please sign in to comment.