@xo-union/pagelet
Advanced tools
Comparing version 3.2.25 to 4.0.0-uep1.beta.1
@@ -128,12 +128,10 @@ module.exports = | ||
// Defer requiring customevent to avoid runtime issue in nodejs | ||
// eslint-disable-next-line global-require | ||
const Constructor = __webpack_require__(1); | ||
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) { | ||
params[_key] = arguments[_key]; | ||
} | ||
return new Constructor(...params); | ||
} | ||
/* harmony default export */ var PageletContainer_CustomEvent = (CustomEvent); | ||
@@ -146,3 +144,2 @@ // CONCATENATED MODULE: ./src/core/PageletContainer/createContainerContext/index.js | ||
}, | ||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions | ||
@@ -152,3 +149,2 @@ get props() { | ||
}, | ||
addEventListener: function () { | ||
@@ -167,3 +163,2 @@ pageletContainer.addEventListener(...arguments); | ||
}); | ||
/* harmony default export */ var PageletContainer_createContainerContext = (createContainerContext); | ||
@@ -173,4 +168,5 @@ // CONCATENATED MODULE: ./src/core/PageletContainer/index.js | ||
// Simple prepend ponyfill | ||
// Simple prepend ponyfill | ||
const prepend = (parent, child) => { | ||
@@ -181,8 +177,5 @@ if (typeof parent.prepend === 'function') { | ||
} | ||
parent.insertBefore(child, parent.firstChild); | ||
}; | ||
const isRendered = pageletContainer => pageletContainer.mountNode.getAttribute('data-pagelet-render-state') === 'ready'; | ||
const emitErrorEvent = (pageletContainer, _ref) => { | ||
@@ -202,3 +195,2 @@ let { | ||
}; | ||
const evaluatePageletScript = (scriptElement, containerContext) => { | ||
@@ -210,3 +202,2 @@ /* eslint-disable no-new-func */ | ||
}; | ||
class PageletContainer_PageletContainer extends event_target_shim_["EventTarget"] { | ||
@@ -226,9 +217,8 @@ constructor(id) { | ||
this.wasPrepared = false; | ||
/** | ||
* Data passed to children | ||
*/ | ||
this.containerContext = PageletContainer_createContainerContext(this); | ||
} | ||
prepare() { | ||
@@ -238,7 +228,5 @@ if (this.wasPrepared) { | ||
} | ||
const rootNode = document.body.querySelector(`[data-pagelet-container-id="${this.id}"]`); | ||
const pageletScriptElement = rootNode.querySelector('script[type="text/x-union-pagelet-script"]'); | ||
let mountNode = rootNode.querySelector('[data-pagelet-role="mount-root"]'); | ||
if (!mountNode) { | ||
@@ -249,11 +237,8 @@ mountNode = document.createElement('div'); | ||
} | ||
if (pageletScriptElement) { | ||
evaluatePageletScript(pageletScriptElement, this.containerContext); | ||
} | ||
this.mountNode = mountNode; | ||
this.wasPrepared = true; | ||
} | ||
mount(pagelet) { | ||
@@ -263,3 +248,2 @@ if (!this.wasPrepared) { | ||
} | ||
this.willMount = pagelet; | ||
@@ -278,3 +262,2 @@ this.dispatchEvent(new PageletContainer_CustomEvent('will-load', { | ||
} | ||
this.currentPagelet = pagelet; | ||
@@ -293,3 +276,2 @@ pagelet.mount(this.containerContext); | ||
}); | ||
if (notCanceled) { | ||
@@ -300,6 +282,4 @@ this.errorPagelet.mount(this.containerContext); | ||
} | ||
unmount() { | ||
this.willMount = null; | ||
if (!this.currentPagelet) { | ||
@@ -310,7 +290,5 @@ // eslint-disable-next-line no-console | ||
} | ||
this.currentPagelet.unmount(this.containerContext); | ||
this.currentPagelet = null; | ||
} | ||
setProps(newProps) { | ||
@@ -326,3 +304,2 @@ const event = new PageletContainer_CustomEvent('props', { | ||
} | ||
} | ||
@@ -335,3 +312,2 @@ // EXTERNAL MODULE: external "@babel/runtime-corejs3/core-js/promise" | ||
const amdImport = dependencies => new promise_default.a((resolve, reject) => { | ||
@@ -341,3 +317,2 @@ const handleError = error => { | ||
}; | ||
const handleSuccess = function () { | ||
@@ -347,9 +322,6 @@ for (var _len = arguments.length, _exports = new Array(_len), _key = 0; _key < _len; _key++) { | ||
} | ||
resolve(_exports); | ||
}; | ||
window.UNION_INTERNAL_MODULE_SYSTEM.require(dependencies, handleSuccess, handleError); | ||
}); | ||
/* harmony default export */ var loadLinks = (_ref => { | ||
@@ -363,7 +335,5 @@ let { | ||
const dependencies = [js.toString()]; | ||
if (css) { | ||
dependencies.push(`css-loader!${css}`); | ||
} | ||
return amdImport(dependencies).then(_ref2 => { | ||
@@ -386,7 +356,5 @@ let [_exports] = _ref2; | ||
} | ||
get isLoaded() { | ||
return !!this.pageletInstance; | ||
} | ||
load() { | ||
@@ -399,11 +367,8 @@ return loadLinks({ | ||
} | ||
mount(params) { | ||
return this.pageletInstance.mount(params); | ||
} | ||
unmount(params) { | ||
return this.pageletInstance.unmount(params); | ||
} | ||
} | ||
@@ -410,0 +375,0 @@ // CONCATENATED MODULE: ./src/core/index.js |
{ | ||
"name": "@xo-union/pagelet", | ||
"version": "3.2.25", | ||
"version": "4.0.0-uep1.beta.1", | ||
"main": "lib/core/index.js", | ||
"types": "lib/core/index.js", | ||
"x-fep": { | ||
"constraints": { | ||
"enforceSourceCondition": { | ||
"ignorePaths": [ | ||
"./__tests__" | ||
] | ||
} | ||
} | ||
}, | ||
"exports": { | ||
".": "./lib/core/index.js", | ||
".": { | ||
"__source": "./src/core/index.js", | ||
"default": "./lib/core/index.js" | ||
}, | ||
"./load-snippet": { | ||
"__source": "./src/load-snippet/index.js", | ||
"require": "./lib/load-snippet/index.js", | ||
"import": "./esm-interop.mjs" | ||
}, | ||
"./__tests__": { | ||
"__fep_internal__": "./__tests__/index.js" | ||
} | ||
@@ -25,10 +41,10 @@ }, | ||
"dependencies": { | ||
"@babel/runtime-corejs3": "^7.22.5", | ||
"@xo-union/dist-url": "^3.0.6", | ||
"@babel/runtime-corejs3": "^7.23.9", | ||
"@xo-union/dist-url": "^4.0.0-uep1.beta.1", | ||
"@xo-union/event-target-shim": "^5.0.0", | ||
"@xo-union/util-snippet-generator": "^3.0.2", | ||
"@xo-union/util-snippet-generator": "^4.0.0-uep1.beta.1", | ||
"customevent": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@xo-union/deploy": "^3.1.0", | ||
"@xo-union/deploy": "^4.0.0-uep1.beta.1", | ||
"@xo-union/pkg-validator": "^3.2.3", | ||
@@ -53,3 +69,4 @@ "exports-loader": "^0.7.0", | ||
}, | ||
"gitHead": "e08f2177d058a7b5642e6b38079a8b7761158b27" | ||
} | ||
"$schema": "../../../shared-configs/schemas/package-json-schema.json", | ||
"stableVersion": "3.2.25" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
745148
26
17847
2
15
15
+ Added@xo-union/dist-url@4.0.0-uep1.beta.8(transitive)
+ Added@xo-union/url-template@3.0.0-uep1.beta.8(transitive)
+ Added@xo-union/util-snippet-generator@4.0.0-uep1.beta.8(transitive)
- Removed@xo-union/dist-url@3.0.7(transitive)
- Removed@xo-union/url-template@2.0.7(transitive)
- Removed@xo-union/util-snippet-generator@3.0.3(transitive)