@qiankunjs/single-spa 0.0.1-rc.0

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.
Files changed (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/dist/cjs/applications/app-errors.d.ts +11 -0
  4. package/dist/cjs/applications/app-errors.js +57 -0
  5. package/dist/cjs/applications/app-errors.js.map +1 -0
  6. package/dist/cjs/applications/app.helpers.d.ts +52 -0
  7. package/dist/cjs/applications/app.helpers.js +47 -0
  8. package/dist/cjs/applications/app.helpers.js.map +1 -0
  9. package/dist/cjs/applications/apps.d.ts +23 -0
  10. package/dist/cjs/applications/apps.js +234 -0
  11. package/dist/cjs/applications/apps.js.map +1 -0
  12. package/dist/cjs/applications/timeouts.d.ts +19 -0
  13. package/dist/cjs/applications/timeouts.js +115 -0
  14. package/dist/cjs/applications/timeouts.js.map +1 -0
  15. package/dist/cjs/declarations.d.ts +4 -0
  16. package/dist/cjs/devtools/devtools.d.ts +16 -0
  17. package/dist/cjs/devtools/devtools.js +24 -0
  18. package/dist/cjs/devtools/devtools.js.map +1 -0
  19. package/dist/cjs/devtools/profiler.d.ts +11 -0
  20. package/dist/cjs/devtools/profiler.js +25 -0
  21. package/dist/cjs/devtools/profiler.js.map +1 -0
  22. package/dist/cjs/index.d.ts +1 -0
  23. package/dist/cjs/index.js +32 -0
  24. package/dist/cjs/jquery-support.d.ts +7 -0
  25. package/dist/cjs/jquery-support.js +34 -0
  26. package/dist/cjs/jquery-support.js.map +1 -0
  27. package/dist/cjs/lifecycles/bootstrap.d.ts +2 -0
  28. package/dist/cjs/lifecycles/bootstrap.js +27 -0
  29. package/dist/cjs/lifecycles/bootstrap.js.map +1 -0
  30. package/dist/cjs/lifecycles/lifecycle.helpers.d.ts +90 -0
  31. package/dist/cjs/lifecycles/lifecycle.helpers.js +33 -0
  32. package/dist/cjs/lifecycles/lifecycle.helpers.js.map +1 -0
  33. package/dist/cjs/lifecycles/load.d.ts +3 -0
  34. package/dist/cjs/lifecycles/load.js +73 -0
  35. package/dist/cjs/lifecycles/load.js.map +1 -0
  36. package/dist/cjs/lifecycles/mount.d.ts +2 -0
  37. package/dist/cjs/lifecycles/mount.js +40 -0
  38. package/dist/cjs/lifecycles/mount.js.map +1 -0
  39. package/dist/cjs/lifecycles/prop.helpers.d.ts +9 -0
  40. package/dist/cjs/lifecycles/prop.helpers.js +23 -0
  41. package/dist/cjs/lifecycles/prop.helpers.js.map +1 -0
  42. package/dist/cjs/lifecycles/unload.d.ts +12 -0
  43. package/dist/cjs/lifecycles/unload.js +63 -0
  44. package/dist/cjs/lifecycles/unload.js.map +1 -0
  45. package/dist/cjs/lifecycles/unmount.d.ts +2 -0
  46. package/dist/cjs/lifecycles/unmount.js +32 -0
  47. package/dist/cjs/lifecycles/unmount.js.map +1 -0
  48. package/dist/cjs/lifecycles/update.d.ts +2 -0
  49. package/dist/cjs/lifecycles/update.js +22 -0
  50. package/dist/cjs/lifecycles/update.js.map +1 -0
  51. package/dist/cjs/navigation/navigation-events.d.ts +8 -0
  52. package/dist/cjs/navigation/navigation-events.js +102 -0
  53. package/dist/cjs/navigation/navigation-events.js.map +1 -0
  54. package/dist/cjs/navigation/reroute.d.ts +9 -0
  55. package/dist/cjs/navigation/reroute.js +182 -0
  56. package/dist/cjs/navigation/reroute.js.map +1 -0
  57. package/dist/cjs/parcels/mount-parcel.d.ts +3 -0
  58. package/dist/cjs/parcels/mount-parcel.js +122 -0
  59. package/dist/cjs/parcels/mount-parcel.js.map +1 -0
  60. package/dist/cjs/single-spa.d.ts +19 -0
  61. package/dist/cjs/single-spa.js +39 -0
  62. package/dist/cjs/single-spa.js.map +1 -0
  63. package/dist/cjs/start.d.ts +5 -0
  64. package/dist/cjs/start.js +21 -0
  65. package/dist/cjs/start.js.map +1 -0
  66. package/dist/cjs/utils/runtime-environment.d.ts +1 -0
  67. package/dist/cjs/utils/runtime-environment.js +7 -0
  68. package/dist/cjs/utils/runtime-environment.js.map +1 -0
  69. package/dist/cjs/window-globals.d.ts +8 -0
  70. package/dist/esm/applications/app-errors.d.ts +11 -0
  71. package/dist/esm/applications/app-errors.js +52 -0
  72. package/dist/esm/applications/app-errors.js.map +1 -0
  73. package/dist/esm/applications/app.helpers.d.ts +52 -0
  74. package/dist/esm/applications/app.helpers.js +41 -0
  75. package/dist/esm/applications/app.helpers.js.map +1 -0
  76. package/dist/esm/applications/apps.d.ts +23 -0
  77. package/dist/esm/applications/apps.js +223 -0
  78. package/dist/esm/applications/apps.js.map +1 -0
  79. package/dist/esm/applications/timeouts.d.ts +19 -0
  80. package/dist/esm/applications/timeouts.js +109 -0
  81. package/dist/esm/applications/timeouts.js.map +1 -0
  82. package/dist/esm/declarations.d.ts +4 -0
  83. package/dist/esm/devtools/devtools.d.ts +16 -0
  84. package/dist/esm/devtools/devtools.js +20 -0
  85. package/dist/esm/devtools/devtools.js.map +1 -0
  86. package/dist/esm/devtools/profiler.d.ts +11 -0
  87. package/dist/esm/devtools/profiler.js +22 -0
  88. package/dist/esm/devtools/profiler.js.map +1 -0
  89. package/dist/esm/index.d.ts +1 -0
  90. package/dist/esm/index.js +10 -0
  91. package/dist/esm/jquery-support.d.ts +7 -0
  92. package/dist/esm/jquery-support.js +33 -0
  93. package/dist/esm/jquery-support.js.map +1 -0
  94. package/dist/esm/lifecycles/bootstrap.d.ts +2 -0
  95. package/dist/esm/lifecycles/bootstrap.js +26 -0
  96. package/dist/esm/lifecycles/bootstrap.js.map +1 -0
  97. package/dist/esm/lifecycles/lifecycle.helpers.d.ts +90 -0
  98. package/dist/esm/lifecycles/lifecycle.helpers.js +30 -0
  99. package/dist/esm/lifecycles/lifecycle.helpers.js.map +1 -0
  100. package/dist/esm/lifecycles/load.d.ts +3 -0
  101. package/dist/esm/lifecycles/load.js +72 -0
  102. package/dist/esm/lifecycles/load.js.map +1 -0
  103. package/dist/esm/lifecycles/mount.d.ts +2 -0
  104. package/dist/esm/lifecycles/mount.js +39 -0
  105. package/dist/esm/lifecycles/mount.js.map +1 -0
  106. package/dist/esm/lifecycles/prop.helpers.d.ts +9 -0
  107. package/dist/esm/lifecycles/prop.helpers.js +22 -0
  108. package/dist/esm/lifecycles/prop.helpers.js.map +1 -0
  109. package/dist/esm/lifecycles/unload.d.ts +12 -0
  110. package/dist/esm/lifecycles/unload.js +60 -0
  111. package/dist/esm/lifecycles/unload.js.map +1 -0
  112. package/dist/esm/lifecycles/unmount.d.ts +2 -0
  113. package/dist/esm/lifecycles/unmount.js +31 -0
  114. package/dist/esm/lifecycles/unmount.js.map +1 -0
  115. package/dist/esm/lifecycles/update.d.ts +2 -0
  116. package/dist/esm/lifecycles/update.js +21 -0
  117. package/dist/esm/lifecycles/update.js.map +1 -0
  118. package/dist/esm/navigation/navigation-events.d.ts +8 -0
  119. package/dist/esm/navigation/navigation-events.js +92 -0
  120. package/dist/esm/navigation/navigation-events.js.map +1 -0
  121. package/dist/esm/navigation/reroute.d.ts +9 -0
  122. package/dist/esm/navigation/reroute.js +180 -0
  123. package/dist/esm/navigation/reroute.js.map +1 -0
  124. package/dist/esm/parcels/mount-parcel.d.ts +3 -0
  125. package/dist/esm/parcels/mount-parcel.js +120 -0
  126. package/dist/esm/parcels/mount-parcel.js.map +1 -0
  127. package/dist/esm/single-spa.d.ts +19 -0
  128. package/dist/esm/single-spa.js +17 -0
  129. package/dist/esm/single-spa.js.map +1 -0
  130. package/dist/esm/start.d.ts +5 -0
  131. package/dist/esm/start.js +19 -0
  132. package/dist/esm/start.js.map +1 -0
  133. package/dist/esm/utils/runtime-environment.d.ts +1 -0
  134. package/dist/esm/utils/runtime-environment.js +6 -0
  135. package/dist/esm/utils/runtime-environment.js.map +1 -0
  136. package/dist/esm/window-globals.d.ts +8 -0
  137. package/package.json +25 -0
@@ -0,0 +1,115 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_applications_app_helpers = require("./app.helpers.js");
3
+ const require_applications_app_errors = require("./app-errors.js");
4
+ const require_lifecycles_prop_helpers = require("../lifecycles/prop.helpers.js");
5
+ //#region src/applications/timeouts.ts
6
+ var defaultWarningMillis = 1e3;
7
+ var globalTimeoutConfig = {
8
+ bootstrap: {
9
+ millis: 4e3,
10
+ dieOnTimeout: false,
11
+ warningMillis: defaultWarningMillis
12
+ },
13
+ mount: {
14
+ millis: 3e3,
15
+ dieOnTimeout: false,
16
+ warningMillis: defaultWarningMillis
17
+ },
18
+ unmount: {
19
+ millis: 3e3,
20
+ dieOnTimeout: false,
21
+ warningMillis: defaultWarningMillis
22
+ },
23
+ unload: {
24
+ millis: 3e3,
25
+ dieOnTimeout: false,
26
+ warningMillis: defaultWarningMillis
27
+ },
28
+ update: {
29
+ millis: 3e3,
30
+ dieOnTimeout: false,
31
+ warningMillis: defaultWarningMillis
32
+ }
33
+ };
34
+ function setBootstrapMaxTime(time, dieOnTimeout, warningMillis) {
35
+ if (typeof time !== "number" || time <= 0) throw Error(require_applications_app_errors.formatErrorMessage(16, process.env.NODE_ENV !== "production" && `bootstrap max time must be a positive integer number of milliseconds`));
36
+ globalTimeoutConfig.bootstrap = {
37
+ millis: time,
38
+ dieOnTimeout,
39
+ warningMillis: warningMillis || defaultWarningMillis
40
+ };
41
+ }
42
+ function setMountMaxTime(time, dieOnTimeout, warningMillis) {
43
+ if (typeof time !== "number" || time <= 0) throw Error(require_applications_app_errors.formatErrorMessage(17, process.env.NODE_ENV !== "production" && `mount max time must be a positive integer number of milliseconds`));
44
+ globalTimeoutConfig.mount = {
45
+ millis: time,
46
+ dieOnTimeout,
47
+ warningMillis: warningMillis || defaultWarningMillis
48
+ };
49
+ }
50
+ function setUnmountMaxTime(time, dieOnTimeout, warningMillis) {
51
+ if (typeof time !== "number" || time <= 0) throw Error(require_applications_app_errors.formatErrorMessage(18, process.env.NODE_ENV !== "production" && `unmount max time must be a positive integer number of milliseconds`));
52
+ globalTimeoutConfig.unmount = {
53
+ millis: time,
54
+ dieOnTimeout,
55
+ warningMillis: warningMillis || defaultWarningMillis
56
+ };
57
+ }
58
+ function setUnloadMaxTime(time, dieOnTimeout, warningMillis) {
59
+ if (typeof time !== "number" || time <= 0) throw Error(require_applications_app_errors.formatErrorMessage(19, process.env.NODE_ENV !== "production" && `unload max time must be a positive integer number of milliseconds`));
60
+ globalTimeoutConfig.unload = {
61
+ millis: time,
62
+ dieOnTimeout,
63
+ warningMillis: warningMillis || defaultWarningMillis
64
+ };
65
+ }
66
+ function reasonableTime(appOrParcel, lifecycle) {
67
+ const timeoutConfig = appOrParcel.timeouts[lifecycle];
68
+ const warningPeriod = timeoutConfig.warningMillis;
69
+ const type = require_applications_app_helpers.objectType(appOrParcel);
70
+ return new Promise((resolve, reject) => {
71
+ let finished = false;
72
+ let errored = false;
73
+ appOrParcel[lifecycle](require_lifecycles_prop_helpers.getProps(appOrParcel)).then((val) => {
74
+ finished = true;
75
+ resolve(val);
76
+ }).catch((val) => {
77
+ finished = true;
78
+ reject(val);
79
+ });
80
+ setTimeout(() => maybeTimingOut(1), warningPeriod);
81
+ setTimeout(() => maybeTimingOut(true), timeoutConfig.millis);
82
+ const errMsg = require_applications_app_errors.formatErrorMessage(31, process.env.NODE_ENV !== "production" && `Lifecycle function ${lifecycle} for ${type} ${require_applications_app_helpers.toName(appOrParcel)} lifecycle did not resolve or reject for ${timeoutConfig.millis} ms.`, lifecycle, type, require_applications_app_helpers.toName(appOrParcel), timeoutConfig.millis);
83
+ function maybeTimingOut(shouldError) {
84
+ if (!finished) {
85
+ if (shouldError === true) {
86
+ errored = true;
87
+ if (timeoutConfig.dieOnTimeout) reject(Error(errMsg));
88
+ else console.error(errMsg);
89
+ } else if (!errored) {
90
+ const numWarnings = shouldError;
91
+ const numMillis = numWarnings * warningPeriod;
92
+ console.warn(errMsg);
93
+ if (numMillis + warningPeriod < timeoutConfig.millis) setTimeout(() => maybeTimingOut(numWarnings + 1), warningPeriod);
94
+ }
95
+ }
96
+ }
97
+ });
98
+ }
99
+ function ensureValidAppTimeouts(timeouts) {
100
+ const result = {};
101
+ for (let key in globalTimeoutConfig) {
102
+ var _timeouts$key;
103
+ result[key] = Object.assign({}, globalTimeoutConfig[key], (_timeouts$key = timeouts === null || timeouts === void 0 ? void 0 : timeouts[key]) !== null && _timeouts$key !== void 0 ? _timeouts$key : {});
104
+ }
105
+ return result;
106
+ }
107
+ //#endregion
108
+ exports.ensureValidAppTimeouts = ensureValidAppTimeouts;
109
+ exports.reasonableTime = reasonableTime;
110
+ exports.setBootstrapMaxTime = setBootstrapMaxTime;
111
+ exports.setMountMaxTime = setMountMaxTime;
112
+ exports.setUnloadMaxTime = setUnloadMaxTime;
113
+ exports.setUnmountMaxTime = setUnmountMaxTime;
114
+
115
+ //# sourceMappingURL=timeouts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeouts.js","names":[],"sources":["../../../src/applications/timeouts.ts"],"sourcesContent":["import { getProps } from '../lifecycles/prop.helpers';\nimport { objectType, toName } from './app.helpers';\nimport { formatErrorMessage } from './app-errors';\nimport { AppOrParcel } from '../lifecycles/lifecycle.helpers';\n\nexport interface AppOrParcelTimeouts {\n bootstrap: Timeout;\n mount: Timeout;\n unmount: Timeout;\n unload: Timeout;\n update: Timeout;\n}\n\nexport interface Timeout {\n millis: number;\n dieOnTimeout: boolean;\n warningMillis: number;\n}\n\nconst defaultWarningMillis: number = 1000;\n\nconst globalTimeoutConfig: AppOrParcelTimeouts = {\n bootstrap: {\n millis: 4000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n mount: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n unmount: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n unload: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n update: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n};\n\nexport function setBootstrapMaxTime(time: number, dieOnTimeout: boolean, warningMillis: number): void {\n if (typeof time !== 'number' || time <= 0) {\n throw Error(\n formatErrorMessage(16, __DEV__ && `bootstrap max time must be a positive integer number of milliseconds`),\n );\n }\n\n globalTimeoutConfig.bootstrap = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setMountMaxTime(time: number, dieOnTimeout: boolean, warningMillis: number): void {\n if (typeof time !== 'number' || time <= 0) {\n throw Error(formatErrorMessage(17, __DEV__ && `mount max time must be a positive integer number of milliseconds`));\n }\n\n globalTimeoutConfig.mount = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setUnmountMaxTime(time: number, dieOnTimeout: boolean, warningMillis: number) {\n if (typeof time !== 'number' || time <= 0) {\n throw Error(\n formatErrorMessage(18, __DEV__ && `unmount max time must be a positive integer number of milliseconds`),\n );\n }\n\n globalTimeoutConfig.unmount = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setUnloadMaxTime(time: number, dieOnTimeout: boolean, warningMillis: number) {\n if (typeof time !== 'number' || time <= 0) {\n throw Error(formatErrorMessage(19, __DEV__ && `unload max time must be a positive integer number of milliseconds`));\n }\n\n globalTimeoutConfig.unload = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function reasonableTime(\n appOrParcel: AppOrParcel,\n lifecycle: 'bootstrap' | 'mount' | 'update' | 'unmount' | 'unload',\n): Promise<any> {\n const timeoutConfig = appOrParcel.timeouts[lifecycle];\n const warningPeriod = timeoutConfig.warningMillis;\n const type = objectType(appOrParcel);\n\n return new Promise((resolve, reject) => {\n let finished: boolean = false;\n let errored: boolean = false;\n\n appOrParcel[lifecycle](getProps(appOrParcel))\n .then((val) => {\n finished = true;\n resolve(val);\n })\n .catch((val) => {\n finished = true;\n reject(val);\n });\n\n setTimeout(() => maybeTimingOut(1), warningPeriod);\n setTimeout(() => maybeTimingOut(true), timeoutConfig.millis);\n\n const errMsg = formatErrorMessage(\n 31,\n __DEV__ &&\n `Lifecycle function ${lifecycle} for ${type} ${toName(\n appOrParcel,\n )} lifecycle did not resolve or reject for ${timeoutConfig.millis} ms.`,\n lifecycle,\n type,\n toName(appOrParcel),\n timeoutConfig.millis,\n );\n\n function maybeTimingOut(shouldError: true | number) {\n if (!finished) {\n if (shouldError === true) {\n errored = true;\n if (timeoutConfig.dieOnTimeout) {\n reject(Error(errMsg));\n } else {\n console.error(errMsg);\n //don't resolve or reject, we're waiting this one out\n }\n } else if (!errored) {\n const numWarnings: number = shouldError;\n const numMillis = numWarnings * warningPeriod;\n console.warn(errMsg);\n if (numMillis + warningPeriod < timeoutConfig.millis) {\n setTimeout(() => maybeTimingOut(numWarnings + 1), warningPeriod);\n }\n }\n }\n }\n });\n}\n\nexport function ensureValidAppTimeouts(timeouts: Partial<AppOrParcelTimeouts>): AppOrParcelTimeouts {\n const result = {};\n\n for (let key in globalTimeoutConfig) {\n result[key] = Object.assign({}, globalTimeoutConfig[key], timeouts?.[key] ?? {});\n }\n\n return result as AppOrParcelTimeouts;\n}\n"],"mappings":";;;;;AAmBA,IAAM,uBAA+B;AAErC,IAAM,sBAA2C;CAC/C,WAAW;EACT,QAAQ;EACR,cAAc;EACd,eAAe;CACjB;CACA,OAAO;EACL,QAAQ;EACR,cAAc;EACd,eAAe;CACjB;CACA,SAAS;EACP,QAAQ;EACR,cAAc;EACd,eAAe;CACjB;CACA,QAAQ;EACN,QAAQ;EACR,cAAc;EACd,eAAe;CACjB;CACA,QAAQ;EACN,QAAQ;EACR,cAAc;EACd,eAAe;CACjB;AACF;AAEA,SAAgB,oBAAoB,MAAc,cAAuB,eAA6B;CACpG,IAAI,OAAO,SAAS,YAAY,QAAQ,GACtC,MAAM,MACJ,gCAAA,mBAAmB,IAAA,QAAA,IAAA,aAAA,gBAAe,sEAAsE,CAC1G;CAGF,oBAAoB,YAAY;EAC9B,QAAQ;EACR;EACA,eAAe,iBAAiB;CAClC;AACF;AAEA,SAAgB,gBAAgB,MAAc,cAAuB,eAA6B;CAChG,IAAI,OAAO,SAAS,YAAY,QAAQ,GACtC,MAAM,MAAM,gCAAA,mBAAmB,IAAA,QAAA,IAAA,aAAA,gBAAe,kEAAkE,CAAC;CAGnH,oBAAoB,QAAQ;EAC1B,QAAQ;EACR;EACA,eAAe,iBAAiB;CAClC;AACF;AAEA,SAAgB,kBAAkB,MAAc,cAAuB,eAAuB;CAC5F,IAAI,OAAO,SAAS,YAAY,QAAQ,GACtC,MAAM,MACJ,gCAAA,mBAAmB,IAAA,QAAA,IAAA,aAAA,gBAAe,oEAAoE,CACxG;CAGF,oBAAoB,UAAU;EAC5B,QAAQ;EACR;EACA,eAAe,iBAAiB;CAClC;AACF;AAEA,SAAgB,iBAAiB,MAAc,cAAuB,eAAuB;CAC3F,IAAI,OAAO,SAAS,YAAY,QAAQ,GACtC,MAAM,MAAM,gCAAA,mBAAmB,IAAA,QAAA,IAAA,aAAA,gBAAe,mEAAmE,CAAC;CAGpH,oBAAoB,SAAS;EAC3B,QAAQ;EACR;EACA,eAAe,iBAAiB;CAClC;AACF;AAEA,SAAgB,eACd,aACA,WACc;CACd,MAAM,gBAAgB,YAAY,SAAS;CAC3C,MAAM,gBAAgB,cAAc;CACpC,MAAM,OAAO,iCAAA,WAAW,WAAW;CAEnC,OAAO,IAAI,SAAS,SAAS,WAAW;EACtC,IAAI,WAAoB;EACxB,IAAI,UAAmB;EAEvB,YAAY,UAAU,CAAC,gCAAA,SAAS,WAAW,CAAC,CAAC,CAC1C,MAAM,QAAQ;GACb,WAAW;GACX,QAAQ,GAAG;EACb,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,WAAW;GACX,OAAO,GAAG;EACZ,CAAC;EAEH,iBAAiB,eAAe,CAAC,GAAG,aAAa;EACjD,iBAAiB,eAAe,IAAI,GAAG,cAAc,MAAM;EAE3D,MAAM,SAAS,gCAAA,mBACb,IAAA,QAAA,IAAA,aAAA,gBAEE,sBAAsB,UAAU,OAAO,KAAK,GAAG,iCAAA,OAC7C,WACF,EAAE,2CAA2C,cAAc,OAAO,OACpE,WACA,MACA,iCAAA,OAAO,WAAW,GAClB,cAAc,MAChB;EAEA,SAAS,eAAe,aAA4B;GAClD,IAAI,CAAC,UACH;QAAI,gBAAgB,MAAM;KACxB,UAAU;KACV,IAAI,cAAc,cAChB,OAAO,MAAM,MAAM,CAAC;UAEpB,QAAQ,MAAM,MAAM;IAGxB,OAAO,IAAI,CAAC,SAAS;KACnB,MAAM,cAAsB;KAC5B,MAAM,YAAY,cAAc;KAChC,QAAQ,KAAK,MAAM;KACnB,IAAI,YAAY,gBAAgB,cAAc,QAC5C,iBAAiB,eAAe,cAAc,CAAC,GAAG,aAAa;IAEnE;;EAEJ;CACF,CAAC;AACH;AAEA,SAAgB,uBAAuB,UAA6D;CAClG,MAAM,SAAS,CAAC;CAEhB,KAAK,IAAI,OAAO,qBAAqB;;EACnC,OAAO,OAAO,OAAO,OAAO,CAAC,GAAG,oBAAoB,OAAA,gBAAA,aAAA,QAAA,aAAA,KAAA,IAAA,KAAA,IAAM,SAAW,UAAA,QAAA,kBAAA,KAAA,IAAA,gBAAQ,CAAC,CAAC;CACjF;CAEA,OAAO;AACT"}
@@ -0,0 +1,4 @@
1
+ declare const __DEV__: boolean;
2
+ // Upstream also declared `process` here for its BABEL_ENV probe; this monorepo compiles with
3
+ // @types/node, whose `process` global covers that access and conflicts with a redeclaration.
4
+ declare const __PROFILE__: boolean;
@@ -0,0 +1,16 @@
1
+ import { getRawAppData, unregisterApplication } from '../applications/apps';
2
+ import { reroute } from '../navigation/reroute';
3
+ import { AppOrParcelStatus } from '../applications/app.helpers';
4
+ import { toLoadPromise } from '../lifecycles/load';
5
+ import { toBootstrapPromise } from '../lifecycles/bootstrap';
6
+ import { getProfilerData } from './profiler';
7
+ declare const _default: {
8
+ getRawAppData: typeof getRawAppData;
9
+ reroute: typeof reroute;
10
+ NOT_LOADED: AppOrParcelStatus;
11
+ toLoadPromise: typeof toLoadPromise;
12
+ toBootstrapPromise: typeof toBootstrapPromise;
13
+ unregisterApplication: typeof unregisterApplication;
14
+ getProfilerData: typeof getProfilerData;
15
+ };
16
+ export default _default;
@@ -0,0 +1,24 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_applications_app_helpers = require("../applications/app.helpers.js");
6
+ const require_devtools_profiler = require("./profiler.js");
7
+ const require_lifecycles_bootstrap = require("../lifecycles/bootstrap.js");
8
+ const require_lifecycles_load = require("../lifecycles/load.js");
9
+ const require_navigation_reroute = require("../navigation/reroute.js");
10
+ const require_applications_apps = require("../applications/apps.js");
11
+ //#region src/devtools/devtools.ts
12
+ var devtools_default = {
13
+ getRawAppData: require_applications_apps.getRawAppData,
14
+ reroute: require_navigation_reroute.reroute,
15
+ NOT_LOADED: require_applications_app_helpers.AppOrParcelStatus.NOT_LOADED,
16
+ toLoadPromise: require_lifecycles_load.toLoadPromise,
17
+ toBootstrapPromise: require_lifecycles_bootstrap.toBootstrapPromise,
18
+ unregisterApplication: require_applications_apps.unregisterApplication,
19
+ getProfilerData: require_devtools_profiler.getProfilerData
20
+ };
21
+ //#endregion
22
+ exports.default = devtools_default;
23
+
24
+ //# sourceMappingURL=devtools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools.js","names":[],"sources":["../../../src/devtools/devtools.ts"],"sourcesContent":["import { getRawAppData, unregisterApplication } from '../applications/apps';\nimport { reroute } from '../navigation/reroute';\nimport { AppOrParcelStatus } from '../applications/app.helpers';\nimport { toLoadPromise } from '../lifecycles/load';\nimport { toBootstrapPromise } from '../lifecycles/bootstrap';\nimport { getProfilerData } from './profiler';\n\nexport default {\n getRawAppData,\n reroute,\n NOT_LOADED: AppOrParcelStatus.NOT_LOADED,\n toLoadPromise,\n toBootstrapPromise: toBootstrapPromise,\n unregisterApplication,\n getProfilerData,\n};\n"],"mappings":";;;;;;;;;;;AAOA,IAAA,mBAAe;CACb,eAAA,0BAAA;CACA,SAAA,2BAAA;CACA,YAAY,iCAAA,kBAAkB;CAC9B,eAAA,wBAAA;CACoB,oBAAA,6BAAA;CACpB,uBAAA,0BAAA;CACA,iBAAA,0BAAA;AACF"}
@@ -0,0 +1,11 @@
1
+ export interface ProfileEntry {
2
+ type: 'application' | 'parcel' | 'routing';
3
+ name: string;
4
+ kind: 'bootstrap' | 'load' | 'mount' | 'unload' | 'unmount' | 'update' | 'loadApps' | 'silentNavigation' | 'browserNavigation' | 'triggerAppChange';
5
+ operationSucceeded: boolean;
6
+ start: number;
7
+ end: number;
8
+ }
9
+ export declare function getProfilerData(): ProfileEntry[];
10
+ export declare function addProfileEntry(type: ProfileEntry['type'], name: ProfileEntry['name'], kind: ProfileEntry['kind'], start: ProfileEntry['start'], end: ProfileEntry['end'], operationSucceeded: ProfileEntry['operationSucceeded']): void;
11
+ export declare function clearProfilerData(): void;
@@ -0,0 +1,25 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/devtools/profiler.ts
3
+ var profileEntries = [];
4
+ function getProfilerData() {
5
+ return profileEntries;
6
+ }
7
+ function addProfileEntry(type, name, kind, start, end, operationSucceeded) {
8
+ profileEntries.push({
9
+ type,
10
+ name,
11
+ start,
12
+ end,
13
+ kind,
14
+ operationSucceeded
15
+ });
16
+ }
17
+ function clearProfilerData() {
18
+ profileEntries = [];
19
+ }
20
+ //#endregion
21
+ exports.addProfileEntry = addProfileEntry;
22
+ exports.clearProfilerData = clearProfilerData;
23
+ exports.getProfilerData = getProfilerData;
24
+
25
+ //# sourceMappingURL=profiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiler.js","names":[],"sources":["../../../src/devtools/profiler.ts"],"sourcesContent":["let profileEntries: ProfileEntry[] = [];\n\nexport interface ProfileEntry {\n type: 'application' | 'parcel' | 'routing';\n name: string;\n kind:\n | 'bootstrap'\n | 'load'\n | 'mount'\n | 'unload'\n | 'unmount'\n | 'update'\n | 'loadApps'\n | 'silentNavigation'\n | 'browserNavigation'\n | 'triggerAppChange';\n operationSucceeded: boolean;\n start: number;\n end: number;\n}\n\nexport function getProfilerData() {\n return profileEntries;\n}\n\nexport function addProfileEntry(\n type: ProfileEntry['type'],\n name: ProfileEntry['name'],\n kind: ProfileEntry['kind'],\n start: ProfileEntry['start'],\n end: ProfileEntry['end'],\n operationSucceeded: ProfileEntry['operationSucceeded'],\n): void {\n profileEntries.push({\n type,\n name,\n start,\n end,\n kind,\n operationSucceeded,\n });\n}\n\nexport function clearProfilerData(): void {\n profileEntries = [];\n}\n"],"mappings":";;AAAA,IAAI,iBAAiC,CAAC;AAqBtC,SAAgB,kBAAkB;CAChC,OAAO;AACT;AAEA,SAAgB,gBACd,MACA,MACA,MACA,OACA,KACA,oBACM;CACN,eAAe,KAAK;EAClB;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,SAAgB,oBAA0B;CACxC,iBAAiB,CAAC;AACpB"}
@@ -0,0 +1 @@
1
+ export * from './single-spa';
@@ -0,0 +1,32 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_applications_app_helpers = require("./applications/app.helpers.js");
3
+ const require_applications_app_errors = require("./applications/app-errors.js");
4
+ const require_start = require("./start.js");
5
+ const require_parcels_mount_parcel = require("./parcels/mount-parcel.js");
6
+ const require_applications_timeouts = require("./applications/timeouts.js");
7
+ const require_navigation_reroute = require("./navigation/reroute.js");
8
+ const require_navigation_navigation_events = require("./navigation/navigation-events.js");
9
+ const require_jquery_support = require("./jquery-support.js");
10
+ const require_applications_apps = require("./applications/apps.js");
11
+ exports.AppOrParcelStatus = require_applications_app_helpers.AppOrParcelStatus;
12
+ exports.addErrorHandler = require_applications_app_errors.addErrorHandler;
13
+ exports.checkActivityFunctions = require_applications_apps.checkActivityFunctions;
14
+ exports.ensureJQuerySupport = require_jquery_support.ensureJQuerySupport;
15
+ exports.getAppNames = require_applications_apps.getAppNames;
16
+ exports.getAppStatus = require_applications_apps.getAppStatus;
17
+ exports.getMountedApps = require_applications_apps.getMountedApps;
18
+ exports.mountRootParcel = require_parcels_mount_parcel.mountRootParcel;
19
+ exports.navigateToUrl = require_navigation_navigation_events.navigateToUrl;
20
+ exports.patchHistoryApi = require_navigation_navigation_events.patchHistoryApi;
21
+ exports.pathToActiveWhen = require_applications_apps.pathToActiveWhen;
22
+ exports.registerApplication = require_applications_apps.registerApplication;
23
+ exports.removeErrorHandler = require_applications_app_errors.removeErrorHandler;
24
+ exports.setBootstrapMaxTime = require_applications_timeouts.setBootstrapMaxTime;
25
+ exports.setInitMaxTime = require_applications_timeouts.setBootstrapMaxTime;
26
+ exports.setMountMaxTime = require_applications_timeouts.setMountMaxTime;
27
+ exports.setUnloadMaxTime = require_applications_timeouts.setUnloadMaxTime;
28
+ exports.setUnmountMaxTime = require_applications_timeouts.setUnmountMaxTime;
29
+ exports.start = require_start.start;
30
+ exports.triggerAppChange = require_navigation_reroute.triggerAppChange;
31
+ exports.unloadApplication = require_applications_apps.unloadApplication;
32
+ exports.unregisterApplication = require_applications_apps.unregisterApplication;
@@ -0,0 +1,7 @@
1
+ export declare function ensureJQuerySupport(jQuery?: any): void;
2
+ declare global {
3
+ interface Window {
4
+ jQuery?: any;
5
+ $?: any;
6
+ }
7
+ }
@@ -0,0 +1,34 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_navigation_navigation_events = require("./navigation/navigation-events.js");
3
+ //#region src/jquery-support.ts
4
+ var hasInitialized = false;
5
+ function ensureJQuerySupport(jQuery = window.jQuery) {
6
+ var _window;
7
+ if (!jQuery && ((_window = window) === null || _window === void 0 || (_window = _window.$) === null || _window === void 0 || (_window = _window.fn) === null || _window === void 0 ? void 0 : _window.jquery)) jQuery = window.$;
8
+ if (jQuery && !hasInitialized) {
9
+ const originalJQueryOn = jQuery.fn.on;
10
+ const originalJQueryOff = jQuery.fn.off;
11
+ jQuery.fn.on = function(eventString, fn) {
12
+ return captureRoutingEvents.call(this, originalJQueryOn, window.addEventListener, eventString, fn, arguments);
13
+ };
14
+ jQuery.fn.off = function(eventString, fn) {
15
+ return captureRoutingEvents.call(this, originalJQueryOff, window.removeEventListener, eventString, fn, arguments);
16
+ };
17
+ hasInitialized = true;
18
+ }
19
+ }
20
+ function captureRoutingEvents(originalJQueryFunction, nativeFunctionToCall, eventString, fn, originalArgs) {
21
+ if (typeof eventString !== "string") return originalJQueryFunction.apply(this, originalArgs);
22
+ eventString.split(/\s+/).forEach((eventName) => {
23
+ if (require_navigation_navigation_events.routingEventsListeningTo.indexOf(eventName) >= 0) {
24
+ nativeFunctionToCall(eventName, fn);
25
+ eventString = eventString.replace(eventName, "");
26
+ }
27
+ });
28
+ if (eventString.trim() === "") return this;
29
+ else return originalJQueryFunction.apply(this, originalArgs);
30
+ }
31
+ //#endregion
32
+ exports.ensureJQuerySupport = ensureJQuerySupport;
33
+
34
+ //# sourceMappingURL=jquery-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jquery-support.js","names":[],"sources":["../../src/jquery-support.ts"],"sourcesContent":["import { routingEventsListeningTo } from './navigation/navigation-events';\n\nlet hasInitialized: boolean = false;\n\nexport function ensureJQuerySupport(jQuery: any = window.jQuery): void {\n if (!jQuery && window?.$?.fn?.jquery) {\n jQuery = window.$;\n }\n\n if (jQuery && !hasInitialized) {\n const originalJQueryOn = jQuery.fn.on;\n const originalJQueryOff = jQuery.fn.off;\n\n jQuery.fn.on = function (eventString, fn) {\n return captureRoutingEvents.call(this, originalJQueryOn, window.addEventListener, eventString, fn, arguments);\n };\n\n jQuery.fn.off = function (eventString, fn) {\n return captureRoutingEvents.call(this, originalJQueryOff, window.removeEventListener, eventString, fn, arguments);\n };\n\n hasInitialized = true;\n }\n}\n\nfunction captureRoutingEvents(\n originalJQueryFunction: Function,\n nativeFunctionToCall: Function,\n eventString: string,\n fn: Function,\n originalArgs: any[],\n) {\n if (typeof eventString !== 'string') {\n return originalJQueryFunction.apply(this, originalArgs);\n }\n\n const eventNames = eventString.split(/\\s+/);\n eventNames.forEach((eventName) => {\n if (routingEventsListeningTo.indexOf(eventName) >= 0) {\n nativeFunctionToCall(eventName, fn);\n eventString = eventString.replace(eventName, '');\n }\n });\n\n if (eventString.trim() === '') {\n return this;\n } else {\n return originalJQueryFunction.apply(this, originalArgs);\n }\n}\n\ndeclare global {\n interface Window {\n jQuery?: any;\n $?: any;\n }\n}\n"],"mappings":";;;AAEA,IAAI,iBAA0B;AAE9B,SAAgB,oBAAoB,SAAc,OAAO,QAAc;;CACrE,IAAI,CAAC,YAAA,UAAU,YAAA,QAAA,YAAA,KAAA,MAAA,UAAA,QAAQ,OAAA,QAAA,YAAA,KAAA,MAAA,UAAA,QAAG,QAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAA,QAAI,SAC5B,SAAS,OAAO;CAGlB,IAAI,UAAU,CAAC,gBAAgB;EAC7B,MAAM,mBAAmB,OAAO,GAAG;EACnC,MAAM,oBAAoB,OAAO,GAAG;EAEpC,OAAO,GAAG,KAAK,SAAU,aAAa,IAAI;GACxC,OAAO,qBAAqB,KAAK,MAAM,kBAAkB,OAAO,kBAAkB,aAAa,IAAI,SAAS;EAC9G;EAEA,OAAO,GAAG,MAAM,SAAU,aAAa,IAAI;GACzC,OAAO,qBAAqB,KAAK,MAAM,mBAAmB,OAAO,qBAAqB,aAAa,IAAI,SAAS;EAClH;EAEA,iBAAiB;CACnB;AACF;AAEA,SAAS,qBACP,wBACA,sBACA,aACA,IACA,cACA;CACA,IAAI,OAAO,gBAAgB,UACzB,OAAO,uBAAuB,MAAM,MAAM,YAAY;CAIxD,AADmB,YAAY,MAAM,KACrC,CAAA,CAAW,SAAS,cAAc;EAChC,IAAI,qCAAA,yBAAyB,QAAQ,SAAS,KAAK,GAAG;GACpD,qBAAqB,WAAW,EAAE;GAClC,cAAc,YAAY,QAAQ,WAAW,EAAE;EACjD;CACF,CAAC;CAED,IAAI,YAAY,KAAK,MAAM,IACzB,OAAO;MAEP,OAAO,uBAAuB,MAAM,MAAM,YAAY;AAE1D"}
@@ -0,0 +1,2 @@
1
+ import { LoadedAppOrParcel } from './lifecycle.helpers';
2
+ export declare function toBootstrapPromise(appOrParcel: LoadedAppOrParcel, hardFail?: boolean): Promise<LoadedAppOrParcel>;
@@ -0,0 +1,27 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_applications_app_helpers = require("../applications/app.helpers.js");
3
+ const require_applications_app_errors = require("../applications/app-errors.js");
4
+ require("../devtools/profiler.js");
5
+ const require_applications_timeouts = require("../applications/timeouts.js");
6
+ //#region src/lifecycles/bootstrap.ts
7
+ function toBootstrapPromise(appOrParcel, hardFail) {
8
+ return Promise.resolve().then(() => {
9
+ if (appOrParcel.status !== require_applications_app_helpers.AppOrParcelStatus.NOT_BOOTSTRAPPED) return appOrParcel;
10
+ appOrParcel.status = require_applications_app_helpers.AppOrParcelStatus.BOOTSTRAPPING;
11
+ return require_applications_timeouts.reasonableTime(appOrParcel, "bootstrap").then(successfulBootstrap).catch((err) => {
12
+ if (hardFail) throw require_applications_app_errors.transformErr(err, appOrParcel, require_applications_app_helpers.AppOrParcelStatus.SKIP_BECAUSE_BROKEN);
13
+ else {
14
+ require_applications_app_errors.handleAppError(err, appOrParcel, require_applications_app_helpers.AppOrParcelStatus.SKIP_BECAUSE_BROKEN);
15
+ return appOrParcel;
16
+ }
17
+ });
18
+ });
19
+ function successfulBootstrap() {
20
+ appOrParcel.status = require_applications_app_helpers.AppOrParcelStatus.NOT_MOUNTED;
21
+ return appOrParcel;
22
+ }
23
+ }
24
+ //#endregion
25
+ exports.toBootstrapPromise = toBootstrapPromise;
26
+
27
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","names":[],"sources":["../../../src/lifecycles/bootstrap.ts"],"sourcesContent":["import { AppOrParcelStatus, toName, isParcel } from '../applications/app.helpers';\nimport { reasonableTime } from '../applications/timeouts';\nimport { handleAppError, transformErr } from '../applications/app-errors';\nimport { ProfileEntry, addProfileEntry } from '../devtools/profiler';\nimport { LoadedAppOrParcel } from './lifecycle.helpers';\n\nexport function toBootstrapPromise(appOrParcel: LoadedAppOrParcel, hardFail?: boolean): Promise<LoadedAppOrParcel> {\n let startTime: number, profileEventType: ProfileEntry['type'];\n\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== AppOrParcelStatus.NOT_BOOTSTRAPPED) {\n return appOrParcel;\n }\n\n if (__PROFILE__) {\n profileEventType = isParcel(appOrParcel) ? 'parcel' : 'application';\n startTime = performance.now();\n }\n\n appOrParcel.status = AppOrParcelStatus.BOOTSTRAPPING;\n\n return reasonableTime(appOrParcel, 'bootstrap')\n .then(successfulBootstrap)\n .catch((err) => {\n if (__PROFILE__) {\n addProfileEntry(profileEventType, toName(appOrParcel), 'bootstrap', startTime, performance.now(), false);\n }\n\n if (hardFail) {\n throw transformErr(err, appOrParcel, AppOrParcelStatus.SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(err, appOrParcel, AppOrParcelStatus.SKIP_BECAUSE_BROKEN);\n return appOrParcel;\n }\n });\n });\n\n function successfulBootstrap(): LoadedAppOrParcel {\n appOrParcel.status = AppOrParcelStatus.NOT_MOUNTED;\n\n if (__PROFILE__) {\n addProfileEntry(profileEventType, toName(appOrParcel), 'bootstrap', startTime, performance.now(), true);\n }\n\n return appOrParcel;\n }\n}\n"],"mappings":";;;;;;AAMA,SAAgB,mBAAmB,aAAgC,UAAgD;CAGjH,OAAO,QAAQ,QAAQ,CAAC,CAAC,WAAW;EAClC,IAAI,YAAY,WAAW,iCAAA,kBAAkB,kBAC3C,OAAO;EAQT,YAAY,SAAS,iCAAA,kBAAkB;EAEvC,OAAO,8BAAA,eAAe,aAAa,WAAW,CAAC,CAC5C,KAAK,mBAAmB,CAAC,CACzB,OAAO,QAAQ;GAKd,IAAI,UACF,MAAM,gCAAA,aAAa,KAAK,aAAa,iCAAA,kBAAkB,mBAAmB;QACrE;IACL,gCAAA,eAAe,KAAK,aAAa,iCAAA,kBAAkB,mBAAmB;IACtE,OAAO;GACT;EACF,CAAC;CACL,CAAC;CAED,SAAS,sBAAyC;EAChD,YAAY,SAAS,iCAAA,kBAAkB;EAMvC,OAAO;CACT;AACF"}
@@ -0,0 +1,90 @@
1
+ import { AppOrParcelStatus, InternalApplication, AppDevtools } from '../applications/app.helpers';
2
+ import { AppOrParcelTimeouts } from '../applications/timeouts';
3
+ export declare function validLifecycleFn(fn: LifeCycleFn<unknown> | LifeCycleFn<unknown>[]): boolean;
4
+ export declare function flattenFnArray(appOrParcel: LifeCycles<unknown>, lifecycle: string, isParcel: boolean): LifeCycleFn<unknown>;
5
+ export declare function smellsLikeAPromise(promise: any): boolean;
6
+ export interface CustomProps {
7
+ [str: string]: any;
8
+ [num: number]: any;
9
+ }
10
+ export interface ParcelCustomProps extends CustomProps {
11
+ domElement: HTMLElement;
12
+ }
13
+ export type CustomPropsFn<ExtraProps extends CustomProps = CustomProps> = (name: string, location: Location) => ExtraProps;
14
+ export type AppProps = {
15
+ name: string;
16
+ mountParcel(parcelConfig: ParcelConfig, customProps: ParcelProps & CustomProps): Parcel;
17
+ };
18
+ export type ParcelConfig<ExtraProps = CustomProps> = ParcelConfigObject<ExtraProps> | (() => Promise<ParcelConfigObject<ExtraProps>>);
19
+ type ParcelProps = {
20
+ domElement: HTMLElement;
21
+ };
22
+ export type ParcelConfigObject<ExtraProps = CustomProps> = {
23
+ name?: string;
24
+ timeouts?: AppOrParcelTimeouts;
25
+ } & LifeCycles<ExtraProps>;
26
+ export type LifeCycleFn<ExtraProps> = (config: ExtraProps & AppProps) => Promise<any>;
27
+ export type LifeCycles<ExtraProps = {}> = {
28
+ bootstrap?: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;
29
+ mount: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;
30
+ unmount: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;
31
+ update?: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;
32
+ unload?: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;
33
+ devtools?: AppDevtools;
34
+ timeouts?: AppOrParcelTimeouts;
35
+ };
36
+ export type Parcel<ExtraProps = CustomProps> = {
37
+ mount(): Promise<null>;
38
+ unmount(): Promise<null>;
39
+ update?(customProps: ExtraProps): Promise<any>;
40
+ getStatus(): AppOrParcelStatus;
41
+ loadPromise: Promise<null>;
42
+ bootstrapPromise: Promise<null>;
43
+ mountPromise: Promise<null>;
44
+ unmountPromise: Promise<null>;
45
+ _parcel: InternalParcel;
46
+ };
47
+ export interface ParcelOwner {
48
+ name: string;
49
+ parcels: ParcelMap;
50
+ }
51
+ export interface ParcelMap {
52
+ [parcelId: number]: InternalParcel;
53
+ }
54
+ export interface InternalParcel {
55
+ id: number;
56
+ name: string;
57
+ bootstrap: LifeCycles['bootstrap'];
58
+ mount: LifeCycles['mount'];
59
+ unmount: LifeCycles['unmount'];
60
+ update: LifeCycles['update'];
61
+ parcels: ParcelMap;
62
+ status: AppOrParcelStatus;
63
+ customProps: CustomProps;
64
+ parentName: string;
65
+ unmountThisParcel(): Promise<AppOrParcel>;
66
+ currentTask: Promise<LoadedAppOrParcel>;
67
+ timeouts: AppOrParcelTimeouts;
68
+ }
69
+ export type AppOrParcel = InternalApplication | InternalParcel;
70
+ interface Loaded extends LifeCycles {
71
+ loadPromise?: Promise<LoadedApp | InternalApplication>;
72
+ }
73
+ export type LoadedAppOrParcel = (InternalApplication & Loaded) | (InternalParcel & Loaded);
74
+ export type LoadedApp = InternalApplication & Loaded;
75
+ export type Application<ExtraProps = {}> = LifeCycles<ExtraProps> | LoadApp<ExtraProps>;
76
+ export type LoadApp<ExtraProps = {}> = (config: ExtraProps & AppProps) => Promise<LifeCycles<ExtraProps>>;
77
+ export interface SingleSpaLocation {
78
+ pathname: URL['pathname'];
79
+ hash?: URL['hash'];
80
+ search?: string;
81
+ }
82
+ export type ActivityFn = (location: SingleSpaLocation) => boolean;
83
+ export type Activity = ActivityFn | string | (ActivityFn | string)[];
84
+ export type RegisterApplicationConfig<ExtraProps extends CustomProps = {}> = {
85
+ name: string;
86
+ app: Application<ExtraProps>;
87
+ activeWhen: Activity;
88
+ customProps?: ExtraProps | CustomPropsFn<ExtraProps>;
89
+ };
90
+ export {};
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_applications_app_helpers = require("../applications/app.helpers.js");
3
+ const require_applications_app_errors = require("../applications/app-errors.js");
4
+ //#region src/lifecycles/lifecycle.helpers.ts
5
+ function validLifecycleFn(fn) {
6
+ return fn && (typeof fn === "function" || isArrayOfFns(fn));
7
+ function isArrayOfFns(arr) {
8
+ return Array.isArray(arr) && !arr.find((item) => typeof item !== "function");
9
+ }
10
+ }
11
+ function flattenFnArray(appOrParcel, lifecycle, isParcel) {
12
+ let fns = Array.isArray(appOrParcel[lifecycle]) ? appOrParcel[lifecycle] : [appOrParcel[lifecycle]].filter(Boolean);
13
+ if (fns.length === 0) fns = [() => Promise.resolve()];
14
+ const type = isParcel ? "parcel" : "application";
15
+ const name = require_applications_app_helpers.toName(appOrParcel);
16
+ return function(props) {
17
+ return fns.reduce((resultPromise, fn, index) => {
18
+ return resultPromise.then(() => {
19
+ const thisPromise = fn(props);
20
+ return smellsLikeAPromise(thisPromise) ? thisPromise : Promise.reject(require_applications_app_errors.formatErrorMessage(15, process.env.NODE_ENV !== "production" && `Within ${type} ${name}, the lifecycle function ${lifecycle} at array index ${index} did not return a promise`, type, name, lifecycle, index));
21
+ });
22
+ }, Promise.resolve());
23
+ };
24
+ }
25
+ function smellsLikeAPromise(promise) {
26
+ return promise && typeof promise.then === "function" && typeof promise.catch === "function";
27
+ }
28
+ //#endregion
29
+ exports.flattenFnArray = flattenFnArray;
30
+ exports.smellsLikeAPromise = smellsLikeAPromise;
31
+ exports.validLifecycleFn = validLifecycleFn;
32
+
33
+ //# sourceMappingURL=lifecycle.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.helpers.js","names":[],"sources":["../../../src/lifecycles/lifecycle.helpers.ts"],"sourcesContent":["import { toName, AppOrParcelStatus, InternalApplication, AppDevtools } from '../applications/app.helpers';\nimport { formatErrorMessage } from '../applications/app-errors';\nimport { AppOrParcelTimeouts } from '../applications/timeouts';\n\nexport function validLifecycleFn(fn: LifeCycleFn<unknown> | LifeCycleFn<unknown>[]): boolean {\n return fn && (typeof fn === 'function' || isArrayOfFns(fn));\n\n function isArrayOfFns(arr) {\n return Array.isArray(arr) && !arr.find((item) => typeof item !== 'function');\n }\n}\n\nexport function flattenFnArray(\n appOrParcel: LifeCycles<unknown>,\n lifecycle: string,\n isParcel: boolean,\n): LifeCycleFn<unknown> {\n let fns: LifeCycleFn<unknown>[] = Array.isArray(appOrParcel[lifecycle])\n ? (appOrParcel[lifecycle] as LifeCycleFn<unknown>[])\n : [appOrParcel[lifecycle] as LifeCycleFn<unknown>].filter(Boolean);\n if (fns.length === 0) {\n fns = [() => Promise.resolve()];\n }\n\n const type = isParcel ? 'parcel' : 'application';\n const name = toName(appOrParcel);\n\n return function (props: AppProps): Promise<unknown> {\n return fns.reduce((resultPromise, fn, index) => {\n return resultPromise.then(() => {\n const thisPromise = fn(props);\n return smellsLikeAPromise(thisPromise)\n ? thisPromise\n : Promise.reject(\n formatErrorMessage(\n 15,\n __DEV__ &&\n `Within ${type} ${name}, the lifecycle function ${lifecycle} at array index ${index} did not return a promise`,\n type,\n name,\n lifecycle,\n index,\n ),\n );\n });\n }, Promise.resolve());\n };\n}\n\nexport function smellsLikeAPromise(promise) {\n return promise && typeof promise.then === 'function' && typeof promise.catch === 'function';\n}\n\nexport interface CustomProps {\n [str: string]: any;\n [num: number]: any;\n}\n\nexport interface ParcelCustomProps extends CustomProps {\n domElement: HTMLElement;\n}\n\nexport type CustomPropsFn<ExtraProps extends CustomProps = CustomProps> = (\n name: string,\n location: Location,\n) => ExtraProps;\n\nexport type AppProps = {\n name: string;\n mountParcel(parcelConfig: ParcelConfig, customProps: ParcelProps & CustomProps): Parcel;\n};\n\nexport type ParcelConfig<ExtraProps = CustomProps> =\n ParcelConfigObject<ExtraProps> | (() => Promise<ParcelConfigObject<ExtraProps>>);\n\ntype ParcelProps = { domElement: HTMLElement };\nexport type ParcelConfigObject<ExtraProps = CustomProps> = {\n name?: string;\n timeouts?: AppOrParcelTimeouts;\n} & LifeCycles<ExtraProps>;\n\nexport type LifeCycleFn<ExtraProps> = (config: ExtraProps & AppProps) => Promise<any>;\nexport type LifeCycles<ExtraProps = {}> = {\n // qiankun fork: bootstrap is the lifecycle name, reverting upstream #1307's rename to init\n // (re-align if upstream ever ships a stable v7 — see the fork README)\n bootstrap?: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;\n mount: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;\n unmount: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;\n update?: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;\n unload?: LifeCycleFn<ExtraProps> | Array<LifeCycleFn<ExtraProps>>;\n devtools?: AppDevtools;\n timeouts?: AppOrParcelTimeouts;\n};\n\nexport type Parcel<ExtraProps = CustomProps> = {\n mount(): Promise<null>;\n unmount(): Promise<null>;\n update?(customProps: ExtraProps): Promise<any>;\n getStatus(): AppOrParcelStatus;\n loadPromise: Promise<null>;\n bootstrapPromise: Promise<null>;\n mountPromise: Promise<null>;\n unmountPromise: Promise<null>;\n // Intended for internal use only\n _parcel: InternalParcel;\n};\n\nexport interface ParcelOwner {\n name: string;\n parcels: ParcelMap;\n}\n\nexport interface ParcelMap {\n [parcelId: number]: InternalParcel;\n}\n\n// Intended for internal use only\nexport interface InternalParcel {\n id: number;\n name: string;\n bootstrap: LifeCycles['bootstrap'];\n mount: LifeCycles['mount'];\n unmount: LifeCycles['unmount'];\n update: LifeCycles['update'];\n parcels: ParcelMap;\n status: AppOrParcelStatus;\n customProps: CustomProps;\n parentName: string;\n unmountThisParcel(): Promise<AppOrParcel>;\n currentTask: Promise<LoadedAppOrParcel>;\n timeouts: AppOrParcelTimeouts;\n}\n\nexport type AppOrParcel = InternalApplication | InternalParcel;\n\ninterface Loaded extends LifeCycles {\n // loadPromise sometimes bails early if there is an error,\n // which results in it being an InternalApplication\n loadPromise?: Promise<LoadedApp | InternalApplication>;\n}\n\nexport type LoadedAppOrParcel = (InternalApplication & Loaded) | (InternalParcel & Loaded);\n\nexport type LoadedApp = InternalApplication & Loaded;\n\nexport type Application<ExtraProps = {}> = LifeCycles<ExtraProps> | LoadApp<ExtraProps>;\n\nexport type LoadApp<ExtraProps = {}> = (config: ExtraProps & AppProps) => Promise<LifeCycles<ExtraProps>>;\n\nexport interface SingleSpaLocation {\n pathname: URL['pathname'];\n hash?: URL['hash'];\n search?: string;\n}\n\nexport type ActivityFn = (location: SingleSpaLocation) => boolean;\n\nexport type Activity = ActivityFn | string | (ActivityFn | string)[];\n\nexport type RegisterApplicationConfig<ExtraProps extends CustomProps = {}> = {\n name: string;\n app: Application<ExtraProps>;\n activeWhen: Activity;\n customProps?: ExtraProps | CustomPropsFn<ExtraProps>;\n};\n"],"mappings":";;;;AAIA,SAAgB,iBAAiB,IAA4D;CAC3F,OAAO,OAAO,OAAO,OAAO,cAAc,aAAa,EAAE;CAEzD,SAAS,aAAa,KAAK;EACzB,OAAO,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,MAAM,SAAS,OAAO,SAAS,UAAU;CAC7E;AACF;AAEA,SAAgB,eACd,aACA,WACA,UACsB;CACtB,IAAI,MAA8B,MAAM,QAAQ,YAAY,UAAU,IACjE,YAAY,aACb,CAAC,YAAY,UAAkC,CAAC,CAAC,OAAO,OAAO;CACnE,IAAI,IAAI,WAAW,GACjB,MAAM,OAAO,QAAQ,QAAQ,CAAC;CAGhC,MAAM,OAAO,WAAW,WAAW;CACnC,MAAM,OAAO,iCAAA,OAAO,WAAW;CAE/B,OAAO,SAAU,OAAmC;EAClD,OAAO,IAAI,QAAQ,eAAe,IAAI,UAAU;GAC9C,OAAO,cAAc,WAAW;IAC9B,MAAM,cAAc,GAAG,KAAK;IAC5B,OAAO,mBAAmB,WAAW,IACjC,cACA,QAAQ,OACN,gCAAA,mBACE,IAAA,QAAA,IAAA,aAAA,gBAEE,UAAU,KAAK,GAAG,KAAK,2BAA2B,UAAU,kBAAkB,MAAM,4BACtF,MACA,MACA,WACA,KACF,CACF;GACN,CAAC;EACH,GAAG,QAAQ,QAAQ,CAAC;CACtB;AACF;AAEA,SAAgB,mBAAmB,SAAS;CAC1C,OAAO,WAAW,OAAO,QAAQ,SAAS,cAAc,OAAO,QAAQ,UAAU;AACnF"}
@@ -0,0 +1,3 @@
1
+ import { InternalApplication } from '../applications/app.helpers';
2
+ import { LoadedApp } from './lifecycle.helpers';
3
+ export declare function toLoadPromise(app: InternalApplication | LoadedApp): Promise<LoadedApp | InternalApplication>;
@@ -0,0 +1,73 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_applications_app_helpers = require("../applications/app.helpers.js");
3
+ const require_applications_app_errors = require("../applications/app-errors.js");
4
+ const require_lifecycles_lifecycle_helpers = require("./lifecycle.helpers.js");
5
+ require("../devtools/profiler.js");
6
+ const require_lifecycles_prop_helpers = require("./prop.helpers.js");
7
+ const require_applications_timeouts = require("../applications/timeouts.js");
8
+ //#region src/lifecycles/load.ts
9
+ function toLoadPromise(app) {
10
+ return Promise.resolve().then(() => {
11
+ if (app.loadPromise) return app.loadPromise;
12
+ if (app.status !== require_applications_app_helpers.AppOrParcelStatus.NOT_LOADED && app.status !== require_applications_app_helpers.AppOrParcelStatus.LOAD_ERROR) return app;
13
+ const appBeingLoaded = app;
14
+ appBeingLoaded.status = require_applications_app_helpers.AppOrParcelStatus.LOADING_SOURCE_CODE;
15
+ let lifecycles, isUserErr;
16
+ return appBeingLoaded.loadPromise = Promise.resolve().then(() => {
17
+ const loadPromise = appBeingLoaded.loadApp(require_lifecycles_prop_helpers.getProps(app));
18
+ if (!require_lifecycles_lifecycle_helpers.smellsLikeAPromise(loadPromise)) {
19
+ isUserErr = true;
20
+ throw Error(require_applications_app_errors.formatErrorMessage(33, process.env.NODE_ENV !== "production" && `single-spa loading function did not return a promise. Check the second argument to registerApplication('${require_applications_app_helpers.toName(app)}', loadingFunction, activityFunction)`, require_applications_app_helpers.toName(appBeingLoaded)));
21
+ }
22
+ return loadPromise.then((val) => {
23
+ appBeingLoaded.loadErrorTime = null;
24
+ lifecycles = val;
25
+ let validationErrMessage, validationErrCode;
26
+ if (typeof lifecycles !== "object") {
27
+ validationErrCode = 34;
28
+ if (process.env.NODE_ENV !== "production") validationErrMessage = `does not export anything`;
29
+ }
30
+ if (!require_lifecycles_lifecycle_helpers.validLifecycleFn(lifecycles.mount)) {
31
+ validationErrCode = 36;
32
+ if (process.env.NODE_ENV !== "production") validationErrMessage = `does not export a mount function or array of functions`;
33
+ }
34
+ if (!require_lifecycles_lifecycle_helpers.validLifecycleFn(lifecycles.unmount)) {
35
+ validationErrCode = 37;
36
+ if (process.env.NODE_ENV !== "production") validationErrMessage = `does not export a unmount function or array of functions`;
37
+ }
38
+ if (validationErrCode) {
39
+ let appOptsStr;
40
+ try {
41
+ appOptsStr = JSON.stringify(lifecycles);
42
+ } catch (_unused) {}
43
+ console.error(require_applications_app_errors.formatErrorMessage(validationErrCode, process.env.NODE_ENV !== "production" && `The loading function for single-spa application '${require_applications_app_helpers.toName(appBeingLoaded)}' resolved with the following, which does not have mount and unmount functions`, "application", require_applications_app_helpers.toName(appBeingLoaded), appOptsStr), lifecycles);
44
+ require_applications_app_errors.handleAppError(validationErrMessage, appBeingLoaded, require_applications_app_helpers.AppOrParcelStatus.SKIP_BECAUSE_BROKEN);
45
+ return appBeingLoaded;
46
+ }
47
+ if (lifecycles.devtools && lifecycles.devtools.overlays) appBeingLoaded.devtools.overlays = Object.assign({}, app.devtools.overlays, lifecycles.devtools.overlays);
48
+ appBeingLoaded.status = require_applications_app_helpers.AppOrParcelStatus.NOT_BOOTSTRAPPED;
49
+ appBeingLoaded.bootstrap = require_lifecycles_lifecycle_helpers.flattenFnArray(lifecycles, "bootstrap", false);
50
+ appBeingLoaded.mount = require_lifecycles_lifecycle_helpers.flattenFnArray(lifecycles, "mount", false);
51
+ appBeingLoaded.unmount = require_lifecycles_lifecycle_helpers.flattenFnArray(lifecycles, "unmount", false);
52
+ appBeingLoaded.unload = require_lifecycles_lifecycle_helpers.flattenFnArray(lifecycles, "unload", false);
53
+ appBeingLoaded.timeouts = require_applications_timeouts.ensureValidAppTimeouts(lifecycles.timeouts);
54
+ delete appBeingLoaded.loadPromise;
55
+ return appBeingLoaded;
56
+ });
57
+ }).catch((err) => {
58
+ delete appBeingLoaded.loadPromise;
59
+ let newStatus;
60
+ if (isUserErr) newStatus = require_applications_app_helpers.AppOrParcelStatus.SKIP_BECAUSE_BROKEN;
61
+ else {
62
+ newStatus = require_applications_app_helpers.AppOrParcelStatus.LOAD_ERROR;
63
+ appBeingLoaded.loadErrorTime = (/* @__PURE__ */ new Date()).getTime();
64
+ }
65
+ require_applications_app_errors.handleAppError(err, appBeingLoaded, newStatus);
66
+ return appBeingLoaded;
67
+ });
68
+ });
69
+ }
70
+ //#endregion
71
+ exports.toLoadPromise = toLoadPromise;
72
+
73
+ //# sourceMappingURL=load.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.js","names":[],"sources":["../../../src/lifecycles/load.ts"],"sourcesContent":["import { AppOrParcelStatus, toName, InternalApplication } from '../applications/app.helpers';\nimport { ensureValidAppTimeouts } from '../applications/timeouts';\nimport { handleAppError, formatErrorMessage } from '../applications/app-errors';\nimport { LifeCycles, LoadedApp, flattenFnArray, smellsLikeAPromise, validLifecycleFn } from './lifecycle.helpers';\nimport { getProps } from './prop.helpers';\nimport { addProfileEntry } from '../devtools/profiler';\n\nexport function toLoadPromise(app: InternalApplication | LoadedApp): Promise<LoadedApp | InternalApplication> {\n return Promise.resolve().then(() => {\n if ((app as LoadedApp).loadPromise) {\n return (app as LoadedApp).loadPromise;\n }\n\n if (app.status !== AppOrParcelStatus.NOT_LOADED && app.status !== AppOrParcelStatus.LOAD_ERROR) {\n return app;\n }\n\n let startTime: number;\n if (__PROFILE__) {\n startTime = performance.now();\n }\n\n const appBeingLoaded: InternalApplication & Partial<LoadedApp> = app;\n\n appBeingLoaded.status = AppOrParcelStatus.LOADING_SOURCE_CODE;\n\n let lifecycles: LifeCycles, isUserErr: boolean;\n\n return (appBeingLoaded.loadPromise = Promise.resolve()\n .then(() => {\n const loadPromise = appBeingLoaded.loadApp(getProps(app));\n if (!smellsLikeAPromise(loadPromise)) {\n // The name of the app will be prepended to this error message inside of the handleAppError function\n isUserErr = true;\n throw Error(\n formatErrorMessage(\n 33,\n __DEV__ &&\n `single-spa loading function did not return a promise. Check the second argument to registerApplication('${toName(\n app,\n )}', loadingFunction, activityFunction)`,\n toName(appBeingLoaded),\n ),\n );\n }\n return loadPromise.then((val) => {\n appBeingLoaded.loadErrorTime = null;\n\n lifecycles = val;\n\n let validationErrMessage, validationErrCode;\n\n if (typeof lifecycles !== 'object') {\n validationErrCode = 34;\n if (__DEV__) {\n validationErrMessage = `does not export anything`;\n }\n }\n\n if (!validLifecycleFn(lifecycles.mount)) {\n validationErrCode = 36;\n if (__DEV__) {\n validationErrMessage = `does not export a mount function or array of functions`;\n }\n }\n\n if (!validLifecycleFn(lifecycles.unmount)) {\n validationErrCode = 37;\n if (__DEV__) {\n validationErrMessage = `does not export a unmount function or array of functions`;\n }\n }\n\n if (validationErrCode) {\n let appOptsStr;\n try {\n appOptsStr = JSON.stringify(lifecycles);\n } catch {}\n console.error(\n formatErrorMessage(\n validationErrCode,\n __DEV__ &&\n `The loading function for single-spa application '${toName(\n appBeingLoaded,\n )}' resolved with the following, which does not have mount and unmount functions`,\n 'application',\n toName(appBeingLoaded),\n appOptsStr,\n ),\n lifecycles,\n );\n handleAppError(validationErrMessage, appBeingLoaded, AppOrParcelStatus.SKIP_BECAUSE_BROKEN);\n return appBeingLoaded;\n }\n\n if (lifecycles.devtools && lifecycles.devtools.overlays) {\n appBeingLoaded.devtools.overlays = Object.assign({}, app.devtools.overlays, lifecycles.devtools.overlays);\n }\n\n appBeingLoaded.status = AppOrParcelStatus.NOT_BOOTSTRAPPED;\n appBeingLoaded.bootstrap = flattenFnArray(lifecycles, 'bootstrap', false);\n appBeingLoaded.mount = flattenFnArray(lifecycles, 'mount', false);\n appBeingLoaded.unmount = flattenFnArray(lifecycles, 'unmount', false);\n appBeingLoaded.unload = flattenFnArray(lifecycles, 'unload', false);\n appBeingLoaded.timeouts = ensureValidAppTimeouts(lifecycles.timeouts);\n\n delete appBeingLoaded.loadPromise;\n\n if (__PROFILE__) {\n addProfileEntry('application', toName(appBeingLoaded), 'load', startTime, performance.now(), true);\n }\n\n return appBeingLoaded as LoadedApp;\n });\n })\n .catch((err) => {\n delete appBeingLoaded.loadPromise;\n\n let newStatus;\n if (isUserErr) {\n newStatus = AppOrParcelStatus.SKIP_BECAUSE_BROKEN;\n } else {\n newStatus = AppOrParcelStatus.LOAD_ERROR;\n appBeingLoaded.loadErrorTime = new Date().getTime();\n }\n handleAppError(err, appBeingLoaded, newStatus);\n\n if (__PROFILE__) {\n addProfileEntry('application', toName(appBeingLoaded), 'load', startTime, performance.now(), false);\n }\n\n return appBeingLoaded as LoadedApp;\n }));\n });\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,cAAc,KAAgF;CAC5G,OAAO,QAAQ,QAAQ,CAAC,CAAC,WAAW;EAClC,IAAK,IAAkB,aACrB,OAAQ,IAAkB;EAG5B,IAAI,IAAI,WAAW,iCAAA,kBAAkB,cAAc,IAAI,WAAW,iCAAA,kBAAkB,YAClF,OAAO;EAQT,MAAM,iBAA2D;EAEjE,eAAe,SAAS,iCAAA,kBAAkB;EAE1C,IAAI,YAAwB;EAE5B,OAAQ,eAAe,cAAc,QAAQ,QAAQ,CAAC,CACnD,WAAW;GACV,MAAM,cAAc,eAAe,QAAQ,gCAAA,SAAS,GAAG,CAAC;GACxD,IAAI,CAAC,qCAAA,mBAAmB,WAAW,GAAG;IAEpC,YAAY;IACZ,MAAM,MACJ,gCAAA,mBACE,IAAA,QAAA,IAAA,aAAA,gBAEE,2GAA2G,iCAAA,OACzG,GACF,EAAE,wCACJ,iCAAA,OAAO,cAAc,CACvB,CACF;GACF;GACA,OAAO,YAAY,MAAM,QAAQ;IAC/B,eAAe,gBAAgB;IAE/B,aAAa;IAEb,IAAI,sBAAsB;IAE1B,IAAI,OAAO,eAAe,UAAU;KAClC,oBAAoB;KACpB,IAAA,QAAA,IAAA,aAAA,cACE,uBAAuB;IAE3B;IAEA,IAAI,CAAC,qCAAA,iBAAiB,WAAW,KAAK,GAAG;KACvC,oBAAoB;KACpB,IAAA,QAAA,IAAA,aAAA,cACE,uBAAuB;IAE3B;IAEA,IAAI,CAAC,qCAAA,iBAAiB,WAAW,OAAO,GAAG;KACzC,oBAAoB;KACpB,IAAA,QAAA,IAAA,aAAA,cACE,uBAAuB;IAE3B;IAEA,IAAI,mBAAmB;KACrB,IAAI;KACJ,IAAI;MACF,aAAa,KAAK,UAAU,UAAU;KACxC,SAAA,SAAQ,CAAC;KACT,QAAQ,MACN,gCAAA,mBACE,mBAAA,QAAA,IAAA,aAAA,gBAEE,oDAAoD,iCAAA,OAClD,cACF,EAAE,iFACJ,eACA,iCAAA,OAAO,cAAc,GACrB,UACF,GACA,UACF;KACA,gCAAA,eAAe,sBAAsB,gBAAgB,iCAAA,kBAAkB,mBAAmB;KAC1F,OAAO;IACT;IAEA,IAAI,WAAW,YAAY,WAAW,SAAS,UAC7C,eAAe,SAAS,WAAW,OAAO,OAAO,CAAC,GAAG,IAAI,SAAS,UAAU,WAAW,SAAS,QAAQ;IAG1G,eAAe,SAAS,iCAAA,kBAAkB;IAC1C,eAAe,YAAY,qCAAA,eAAe,YAAY,aAAa,KAAK;IACxE,eAAe,QAAQ,qCAAA,eAAe,YAAY,SAAS,KAAK;IAChE,eAAe,UAAU,qCAAA,eAAe,YAAY,WAAW,KAAK;IACpE,eAAe,SAAS,qCAAA,eAAe,YAAY,UAAU,KAAK;IAClE,eAAe,WAAW,8BAAA,uBAAuB,WAAW,QAAQ;IAEpE,OAAO,eAAe;IAMtB,OAAO;GACT,CAAC;EACH,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,OAAO,eAAe;GAEtB,IAAI;GACJ,IAAI,WACF,YAAY,iCAAA,kBAAkB;QACzB;IACL,YAAY,iCAAA,kBAAkB;IAC9B,eAAe,iCAAgB,IAAI,KAAK,EAAC,CAAC,QAAQ;GACpD;GACA,gCAAA,eAAe,KAAK,gBAAgB,SAAS;GAM7C,OAAO;EACT,CAAC;CACL,CAAC;AACH"}
@@ -0,0 +1,2 @@
1
+ import { LoadedAppOrParcel } from './lifecycle.helpers';
2
+ export declare function toMountPromise(appOrParcel: LoadedAppOrParcel, hardFail?: boolean): Promise<LoadedAppOrParcel>;