-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
=== chore(platform): drop deprecated API and backward compatibility To prepare for `1.0.0` major release, deprecated API has been removed. - support for legacy heartbeat liveness, request-response subscription and intent subscription protocols - legacy notation for optional and required parameters - checks for optional wildcard characters in capability and intention qualifiers closes #196 BREAKING CHANGE: dropping deprecated API and backward compatibility introduced a breaking change for host and client applications. To migrate: - Update host and clients to version `1.0.0-rc.13` or higher. - Deprecated property `ManifestService.lookupApplications$` has been removed; use `ManifestService.applications` instead. - Deprecated property `Capability.requiredParams` has been removed; declare required parameters via `Capability.params` instead and mark it as required. - Deprecated property `Capability.optionalParams` has been removed; declare optional parameters via `Capability.params` instead and mark it as non-required.
- Loading branch information
1 parent
677e25c
commit 6901c56
Showing
8 changed files
with
90 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
apps/microfrontend-platform-devtools/src/app/null-if-empty.pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2018-2023 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import {Pipe, PipeTransform} from '@angular/core'; | ||
|
||
/** | ||
* Returns `null` if the given object is empty. | ||
*/ | ||
@Pipe({name: 'devtoolsNullIfEmpty'}) | ||
export class NullIfEmptyPipe implements PipeTransform { | ||
|
||
public transform<T>(value: T): T { | ||
if (value === null || value === undefined) { | ||
return null; | ||
} | ||
else if (value instanceof Map || value instanceof Set) { | ||
if (!value.size) { | ||
return null; | ||
} | ||
} | ||
else if (Array.isArray(value) || typeof value === 'string') { | ||
if (!value.length) { | ||
return null; | ||
} | ||
} | ||
else if (typeof value === 'object') { | ||
if (!Object.keys(value).length) { | ||
return null; | ||
} | ||
} | ||
return value; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/microfrontend-platform-devtools/src/app/params-filter.pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2018-2023 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import {Pipe, PipeTransform} from '@angular/core'; | ||
import {ParamDefinition} from '@scion/microfrontend-platform'; | ||
|
||
/** | ||
* Filters required or optional parameters. | ||
*/ | ||
@Pipe({name: 'devtoolsParamsFilter'}) | ||
export class ParamsFilterPipe implements PipeTransform { | ||
|
||
public transform(params: ParamDefinition[] | undefined | null, filter?: 'required' | 'optional'): ParamDefinition[] { | ||
return params?.filter(param => !filter || (filter === 'required' ? param.required : !param.required)) ?? []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters