slicejs-web-framework 2.4.2 → 2.4.3
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.
|
@@ -327,6 +327,13 @@ export default class Controller {
|
|
|
327
327
|
? `Framework/Structural/${componentName}`
|
|
328
328
|
: componentName;
|
|
329
329
|
this.classes.set(registeredName, componentData.class);
|
|
330
|
+
if (componentName === 'Loading') {
|
|
331
|
+
console.log('🔎 Bundle class registered: Loading', {
|
|
332
|
+
registeredName,
|
|
333
|
+
type: typeof componentData.class,
|
|
334
|
+
isFunction: typeof componentData.class === 'function'
|
|
335
|
+
});
|
|
336
|
+
}
|
|
330
337
|
if (componentName === 'InputSearchDocs' || componentName === 'MainMenu') {
|
|
331
338
|
console.log(`🔎 Bundle class registered: ${componentName}`, {
|
|
332
339
|
registeredName,
|
package/Slice/Slice.js
CHANGED
|
@@ -157,6 +157,13 @@ export default class Slice {
|
|
|
157
157
|
delete props.sliceId;
|
|
158
158
|
|
|
159
159
|
const ComponentClass = this.controller.classes.get(componentName);
|
|
160
|
+
if (componentName === 'Loading') {
|
|
161
|
+
console.log('🔎 Build component: Loading', {
|
|
162
|
+
classType: typeof ComponentClass,
|
|
163
|
+
isFunction: typeof ComponentClass === 'function',
|
|
164
|
+
classValue: ComponentClass
|
|
165
|
+
});
|
|
166
|
+
}
|
|
160
167
|
if (componentName === 'InputSearchDocs' || componentName === 'MainMenu') {
|
|
161
168
|
console.log(`🔎 Build component: ${componentName}`, {
|
|
162
169
|
classType: typeof ComponentClass,
|
|
@@ -259,9 +266,9 @@ async function init() {
|
|
|
259
266
|
await import('/bundles/slice-bundle.framework.js');
|
|
260
267
|
frameworkClasses = window.SLICE_FRAMEWORK_CLASSES || null;
|
|
261
268
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
269
|
+
} catch (error) {
|
|
270
|
+
console.warn('Framework bundle not available, falling back to dynamic imports', error);
|
|
271
|
+
}
|
|
265
272
|
|
|
266
273
|
if (!frameworkClasses) {
|
|
267
274
|
const imports = await Promise.all([
|
|
@@ -290,11 +297,11 @@ async function init() {
|
|
|
290
297
|
const criticalFile = config?.bundles?.critical?.file;
|
|
291
298
|
if (criticalFile) {
|
|
292
299
|
const criticalModule = await import(`/bundles/${criticalFile}`);
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
300
|
+
if (criticalModule.SLICE_BUNDLE) {
|
|
301
|
+
await window.slice.controller.registerBundle(criticalModule.SLICE_BUNDLE);
|
|
302
|
+
window.slice.controller.loadedBundles.add('critical');
|
|
303
|
+
window.slice.controller.criticalBundleLoaded = true;
|
|
304
|
+
}
|
|
298
305
|
}
|
|
299
306
|
|
|
300
307
|
const routeBundles = config?.routeBundles || {};
|
|
@@ -307,12 +314,12 @@ async function init() {
|
|
|
307
314
|
const bundleInfo = config?.bundles?.routes?.[bundleName];
|
|
308
315
|
if (!bundleInfo?.file) continue;
|
|
309
316
|
const routeModule = await import(`/bundles/${bundleInfo.file}`);
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
317
|
+
if (routeModule.SLICE_BUNDLE) {
|
|
318
|
+
await window.slice.controller.registerBundle(routeModule.SLICE_BUNDLE);
|
|
319
|
+
window.slice.controller.loadedBundles.add(bundleName);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
};
|
|
316
323
|
|
|
317
324
|
if (typeof requestIdleCallback === 'function') {
|
|
318
325
|
requestIdleCallback(() => loadRouteBundles());
|