chayns-api 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -115,7 +115,12 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
|
|
|
115
115
|
OriginalCompatComponent.componentDidUpdate.apply(this, prevProps, prevState, snapshot);
|
|
116
116
|
}
|
|
117
117
|
componentWillUnmount() {
|
|
118
|
-
|
|
118
|
+
clearTimeout(this.timeout);
|
|
119
|
+
if (typeof OriginalCompatComponent.componentWillUnmount === 'function') {
|
|
120
|
+
OriginalCompatComponent.componentWillUnmount.apply(this);
|
|
121
|
+
} else if (this.root) {
|
|
122
|
+
this.root.unmount();
|
|
123
|
+
}
|
|
119
124
|
}
|
|
120
125
|
render() {
|
|
121
126
|
return _react.default.createElement('div', {
|
|
@@ -25,7 +25,8 @@ const TrustedDomainsPlugin = trustedDomains => {
|
|
|
25
25
|
name: 'trusted-domains',
|
|
26
26
|
async beforeRequest(args) {
|
|
27
27
|
const domains = await getTrustedDomains();
|
|
28
|
-
const
|
|
28
|
+
const scope = args.id.split('/')[0];
|
|
29
|
+
const remote = args.options.remotes.find(remote => (remote.alias || remote.name) === scope);
|
|
29
30
|
if (remote && 'entry' in remote) {
|
|
30
31
|
const parsed = new URL(remote.entry);
|
|
31
32
|
if (!domains.some(domain => parsed.hostname.endsWith(domain))) {
|
|
@@ -102,6 +102,8 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
|
|
|
102
102
|
constructor(props) {
|
|
103
103
|
super(props);
|
|
104
104
|
_defineProperty(this, "ref", void 0);
|
|
105
|
+
_defineProperty(this, "timeout", void 0);
|
|
106
|
+
_defineProperty(this, "root", void 0);
|
|
105
107
|
this.ref = React.createRef();
|
|
106
108
|
}
|
|
107
109
|
componentDidMount() {
|
|
@@ -111,7 +113,12 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
|
|
|
111
113
|
OriginalCompatComponent.componentDidUpdate.apply(this, prevProps, prevState, snapshot);
|
|
112
114
|
}
|
|
113
115
|
componentWillUnmount() {
|
|
114
|
-
|
|
116
|
+
clearTimeout(this.timeout);
|
|
117
|
+
if (typeof OriginalCompatComponent.componentWillUnmount === 'function') {
|
|
118
|
+
OriginalCompatComponent.componentWillUnmount.apply(this);
|
|
119
|
+
} else if (this.root) {
|
|
120
|
+
this.root.unmount();
|
|
121
|
+
}
|
|
115
122
|
}
|
|
116
123
|
render() {
|
|
117
124
|
return React.createElement('div', {
|
|
@@ -21,7 +21,8 @@ export const TrustedDomainsPlugin = trustedDomains => {
|
|
|
21
21
|
name: 'trusted-domains',
|
|
22
22
|
async beforeRequest(args) {
|
|
23
23
|
const domains = await getTrustedDomains();
|
|
24
|
-
const
|
|
24
|
+
const scope = args.id.split('/')[0];
|
|
25
|
+
const remote = args.options.remotes.find(remote => (remote.alias || remote.name) === scope);
|
|
25
26
|
if (remote && 'entry' in remote) {
|
|
26
27
|
const parsed = new URL(remote.entry);
|
|
27
28
|
if (!domains.some(domain => parsed.hostname.endsWith(domain))) {
|