Socket
Socket
Sign inDemoInstall

zoid

Package Overview
Dependencies
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zoid - npm Package Compare versions

Comparing version 9.0.62 to 9.0.63

2

index.js

@@ -5,3 +5,3 @@ /* @flow */

// eslint-disable-next-line no-process-env
if (process.env.ZOID_FRAME_ONLY) {
if (process && process.env && process.env.ZOID_FRAME_ONLY) {
// $FlowFixMe

@@ -8,0 +8,0 @@ module.exports = require('./dist/zoid.frame');

{
"name": "zoid",
"version": "9.0.62",
"version": "9.0.63",
"description": "Cross domain components.",

@@ -58,3 +58,3 @@ "main": "index.js",

"devDependencies": {
"flow-bin": "^0.135.0",
"flow-bin": "0.135.0",
"grumbler-scripts": "^3",

@@ -61,0 +61,0 @@ "jsx-pragmatic": "^2",

@@ -324,4 +324,4 @@ /* @flow */

cleanInstances.register(() => {
parent.destroy(new Error(`zoid destroyed all components`));
cleanInstances.register(err => {
parent.destroy(err || new Error(`zoid destroyed all components`));
});

@@ -332,4 +332,6 @@

if (!eligibility) {
return parent.destroy().then(() => {
throw new Error(reason || `${ name } component is not eligible`);
const err = new Error(reason || `${ name } component is not eligible`);
return parent.destroy(err).then(() => {
throw err;
});

@@ -434,3 +436,3 @@ }

export function destroyComponents() : ZalgoPromise<void> {
export function destroyComponents(err? : mixed) : ZalgoPromise<void> {
if (bridge) {

@@ -440,3 +442,3 @@ bridge.destroyBridges();

const destroyPromise = cleanInstances.all();
const destroyPromise = cleanInstances.all(err);
cleanInstances = cleanup();

@@ -446,13 +448,9 @@ return destroyPromise;

function destroyZoid() : ZalgoPromise<void> {
return cleanZoid.all();
}
export const destroyAll = destroyComponents;
export function destroy() {
export function destroy(err? : mixed) : ZalgoPromise<void> {
destroyAll();
destroyGlobal();
destroyZoid();
destroyPostRobot();
return cleanZoid.all(err);
}

@@ -11,3 +11,3 @@ /* @flow */

noop, onResize, extendUrl, appendChild, cleanup, base64encode, isRegex,
once, stringifyError, destroyElement, getElementSafe, showElement, hideElement, iframe,
once, stringifyError, destroyElement, getElementSafe, showElement, hideElement, iframe, memoize,
awaitFrameWindow, popup, normalizeDimension, watchElementForClose, isShadowElement, insertShadowSlot } from 'belter/src';

@@ -416,3 +416,3 @@

const attrs = {
name: `__zoid_prerender_frame__${ name }_${ uniqueID() }__`,
name: `__${ ZOID }_prerender_frame__${ name }_${ uniqueID() }__`,
title: `prerender__${ name }`,

@@ -511,3 +511,3 @@ ...getAttributes().iframe

const destroy = (err? : mixed) : ZalgoPromise<void> => {
const destroy = (err : mixed) : ZalgoPromise<void> => {
// eslint-disable-next-line promise/no-promise-in-callback

@@ -517,3 +517,3 @@ return ZalgoPromise.try(() => {

}).catch(noop).then(() => {
return clean.all();
return clean.all(err);
}).then(() => {

@@ -524,13 +524,23 @@ initPromise.asyncReject(err || new Error('Component destroyed'));

const close = () : ZalgoPromise<void> => {
if (closeOverride) {
return closeOverride();
}
const close = memoize((err? : mixed) : ZalgoPromise<void> => {
return ZalgoPromise.try(() => {
return ZalgoPromise.try(() => {
return event.trigger(EVENT.CLOSE);
}).then(() => {
return destroy(new Error(`Window closed`));
if (closeOverride) {
// $FlowFixMe
const source = closeOverride.__source__;
if (isWindowClosed(source)) {
return;
}
return closeOverride();
}
return ZalgoPromise.try(() => {
return event.trigger(EVENT.CLOSE);
}).then(() => {
return destroy(err || new Error(`Component closed`));
});
});
};
});

@@ -550,8 +560,4 @@ const open = (context : $Values<typeof CONTEXT>, { proxyWin, proxyFrame, windowName } : {| proxyWin : ProxyWindow, proxyFrame : ?ProxyObject<HTMLIFrameElement>, windowName : string |}) : ZalgoPromise<ProxyWindow> => {

return awaitFrameWindow(frame).then(win => {
const frameWatcher = watchElementForClose(frame, close);
clean.register(() => frameWatcher.cancel());
clean.register(() => destroyElement(frame));
clean.register(() => cleanUpWindow(win));
return win;

@@ -606,3 +612,3 @@ });

const watchForClose = (proxyWin : ProxyWindow) : ZalgoPromise<void> => {
const watchForClose = (proxyWin : ProxyWindow, context : $Values<typeof CONTEXT>) : ZalgoPromise<void> => {
let cancelled = false;

@@ -618,5 +624,5 @@

if (isClosed) {
return close();
return close(new Error(`Detected ${ context } close`));
} else if (!cancelled) {
return watchForClose(proxyWin);
return watchForClose(proxyWin, context);
}

@@ -632,3 +638,3 @@ });

closed = true;
return close();
return close(new Error(`Detected component window close`));
}

@@ -641,3 +647,3 @@

closed = true;
return close();
return close(new Error(`Detected component window close`));
}

@@ -772,2 +778,5 @@ });

appendChild(container, innerContainer);
const containerWatcher = watchElementForClose(innerContainer, () => close(new Error(`Detected container element removed from DOM`)));
clean.register(() => containerWatcher.cancel());
clean.register(() => destroyElement(innerContainer));

@@ -863,8 +872,10 @@ currentProxyContainer = getProxyObject(innerContainer);

}).then(({ data: { parent } }) => {
clean.register(() => {
const parentComp : ParentComponent<P> = parent;
clean.register(err => {
if (!isWindowClosed(target)) {
return parent.destroy();
return parentComp.destroy(err);
}
});
return parent.getDelegateOverrides();
return parentComp.getDelegateOverrides();

@@ -995,3 +1006,3 @@ }).catch(err => {

const watchForClosePromise = openPromise.then(proxyWin => {
watchForClose(proxyWin);
watchForClose(proxyWin, context);
});

@@ -998,0 +1009,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc