Skip to content

Commit

Permalink
fix(all): do not destroy Feature App when it is rendered multiple tim…
Browse files Browse the repository at this point in the history
…es (#512)

fixes #505

BREAKING CHANGE: `FeatureAppManager#getFeatureAppScope` has been
replaced by `FeatureAppManager#createFeatureAppScope`, since now a new
`FeatureAppScope` is created for every call. When a Feature App is
unmounted, the `release` method (previously called `destroy`) must be
called. Only when all scopes for a Feature App ID have been released,
the Feature App instance is destroyed.
  • Loading branch information
unstubbable committed Jun 14, 2019
1 parent 05670b7 commit bf8a8ad
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 154 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/__tests__/create-feature-hub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('createFeatureHub()', () => {
});
});

describe('featureAppManager#getFeatureAppScope', () => {
describe('featureAppManager#createFeatureAppScope', () => {
let mockFeatureApp: {};
let mockFeatureAppCreate: jest.Mock;
let mockFeatureAppDefinition: FeatureAppDefinition<unknown>;
Expand All @@ -98,7 +98,7 @@ describe('createFeatureHub()', () => {
featureHubOptions
);

const {featureApp} = featureAppManager.getFeatureAppScope(
const {featureApp} = featureAppManager.createFeatureAppScope(
'test:feature-app',
mockFeatureAppDefinition
);
Expand All @@ -123,7 +123,7 @@ describe('createFeatureHub()', () => {
);

expect(() =>
featureAppManager.getFeatureAppScope(
featureAppManager.createFeatureAppScope(
'test:feature-app',
mockFeatureAppDefinition
)
Expand Down Expand Up @@ -253,7 +253,7 @@ describe('createFeatureHub()', () => {
logger
});

featureAppManager.getFeatureAppScope(
featureAppManager.createFeatureAppScope(
'test:feature-app',
featureAppDefinition
);
Expand All @@ -278,7 +278,7 @@ describe('createFeatureHub()', () => {
featureServiceDefinitions
});

featureAppManager.getFeatureAppScope(
featureAppManager.createFeatureAppScope(
'test:feature-app',
featureAppDefinition
);
Expand Down
Loading

0 comments on commit bf8a8ad

Please sign in to comment.