-
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.
feat(platform): use unique identifier for capability and intention ID
closes #162, closes #171 BREAKING CHANGE: Using unique identifier for capability and intention ID introduced a breaking change. Previously, the IDs used for capabilities and intentions were stable but not unique, which caused problems when deregistering capabilities and intentions. If your application requires stable capability identifiers, you can register a capability interceptor, as follows: ```ts import {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform'; import {Crypto} from '@scion/toolkit/crypto'; import {Beans} from '@scion/toolkit/bean-manager'; Beans.register(CapabilityInterceptor, { useValue: new class implements CapabilityInterceptor { public async intercept(capability: Capability): Promise<Capability> { const stableId = await Crypto.digest(JSON.stringify({ type: capability.type, qualifier: capability.qualifier, application: capability.metadata!.appSymbolicName, })); return { ...capability, metadata: {...capability.metadata!, id: stableId}, }; } }, multi: true }) ``` Note that the communication protocol between host and client has NOT changed. You can independently upgrade host and clients to the new version.
- Loading branch information
1 parent
1098f8f
commit e540bf8
Showing
6 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
"entryFile": "src/public-api.ts" | ||
}, | ||
"allowedNonPeerDependencies": [ | ||
"@scion", | ||
"js-sha256" | ||
"@scion" | ||
] | ||
} |
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