@cocreate/lazy-loader 1.20.3 → 1.20.5
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.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/client.js +9 -5
- package/src/server.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.20.5](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.20.4...v1.20.5) (2024-08-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* try catch dependency ([70b10f5](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/70b10f546bba430aea32c206bcb033945d986842))
|
|
7
|
+
|
|
8
|
+
## [1.20.4](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.20.3...v1.20.4) (2024-06-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* comment typo ([ceebdfb](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/ceebdfbf85267a32175db7fa83e25a1594983448))
|
|
14
|
+
|
|
1
15
|
## [1.20.3](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.20.2...v1.20.3) (2024-06-23)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -61,12 +61,16 @@ export async function lazyLoad(name, selector, callback) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export async function dependency(name, promise) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
window.CoCreate
|
|
64
|
+
try {
|
|
65
|
+
let component = await promise;
|
|
66
|
+
if (!window.CoCreate)
|
|
67
|
+
window.CoCreate = {}
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
window.CoCreate[name] = component.default || component
|
|
70
|
+
dispatchComponentLoaded(name)
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error('error loading chunck: ', error)
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
function dispatchComponentLoaded(name) {
|
package/src/server.js
CHANGED
|
@@ -58,7 +58,7 @@ class CoCreateLazyLoader {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (valideUrl.pathname.startsWith('/webhooks/')) {
|
|
61
|
-
let name = req.url.split('/')[2]; // Assuming URL structure is /
|
|
61
|
+
let name = req.url.split('/')[2]; // Assuming URL structure is /webhooks/name/...
|
|
62
62
|
if (this.modules[name]) {
|
|
63
63
|
this.executeScriptWithTimeout(name, { req, res, host: hostname, organization, valideUrl, organization_id: organization._id })
|
|
64
64
|
} else {
|