@feature-hub/core
Advanced tools
Comparing version 1.5.0 to 1.7.0-alpha.0
@@ -57,2 +57,6 @@ import { AsyncValue } from './async-value'; | ||
readonly instanceConfig?: unknown; | ||
/** | ||
* A callback that is called before the Feature App is created. | ||
*/ | ||
readonly beforeCreate?: (consumerUid: string, featureServices: FeatureServices) => void; | ||
} | ||
@@ -59,0 +63,0 @@ /** |
@@ -64,9 +64,8 @@ "use strict"; | ||
getFeatureAppScope(featureAppDefinition, options = {}) { | ||
const { baseUrl, idSpecifier, instanceConfig } = options; | ||
const { id: featureAppId } = featureAppDefinition; | ||
const featureAppUid = create_uid_1.createUid(featureAppId, idSpecifier); | ||
const featureAppUid = create_uid_1.createUid(featureAppId, options.idSpecifier); | ||
let featureAppScope = this.featureAppScopes.get(featureAppUid); | ||
if (!featureAppScope) { | ||
this.registerOwnFeatureServices(featureAppDefinition); | ||
featureAppScope = this.createFeatureAppScope(featureAppDefinition, () => this.featureAppScopes.delete(featureAppUid), { baseUrl, idSpecifier, instanceConfig }); | ||
featureAppScope = this.createFeatureAppScope(featureAppDefinition, () => this.featureAppScopes.delete(featureAppUid), options); | ||
this.featureAppScopes.set(featureAppUid, featureAppScope); | ||
@@ -113,3 +112,3 @@ } | ||
this.validateExternals(featureAppDefinition); | ||
const { baseUrl, idSpecifier, instanceConfig } = options; | ||
const { baseUrl, beforeCreate, idSpecifier, instanceConfig } = options; | ||
const { configs } = this.options; | ||
@@ -119,2 +118,5 @@ const config = configs && configs[featureAppDefinition.id]; | ||
const binding = this.featureServiceRegistry.bindFeatureServices(featureAppDefinition, idSpecifier); | ||
if (beforeCreate) { | ||
beforeCreate(featureAppUid, binding.featureServices); | ||
} | ||
const featureApp = featureAppDefinition.create({ | ||
@@ -121,0 +123,0 @@ baseUrl, |
{ | ||
"name": "@feature-hub/core", | ||
"version": "1.5.0", | ||
"version": "1.7.0-alpha.0", | ||
"description": "Create scalable web applications using micro frontends.", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a95282f6e44e4ea57d17848cc97fb14f4a53afd2" | ||
"gitHead": "cf39261f8d960ec8512fe15b4064fb7aff32eac9" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116195
37
1004
1