onelaraveljs 1.21.1 → 1.21.2
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/package.json +1 -1
- package/src/core/ViewManager.js +5 -5
- package/src/core/ViewState.js +0 -3
package/package.json
CHANGED
package/src/core/ViewManager.js
CHANGED
|
@@ -390,7 +390,7 @@ export class ViewManager {
|
|
|
390
390
|
this.PAGE_VIEW = null;
|
|
391
391
|
try {
|
|
392
392
|
|
|
393
|
-
const viewStoreKey = name
|
|
393
|
+
const viewStoreKey = name + '__' + urlPath + '__ciew';
|
|
394
394
|
const cachedPageView = this.cachedPageViews.get(viewStoreKey);
|
|
395
395
|
if (cachedPageView && cachedPageView instanceof ViewEngine) {
|
|
396
396
|
// Sử dụng lại cached page view
|
|
@@ -407,7 +407,7 @@ export class ViewManager {
|
|
|
407
407
|
cachedPageView.__._templateManager.pushCachedSections();
|
|
408
408
|
html = cachedLayoutPath === this.CURRENT_SUPER_VIEW_PATH ? superView.__.renderedHtml : this.renderView(superView);
|
|
409
409
|
}
|
|
410
|
-
|
|
410
|
+
logger.debug(`🔍 App.View.loadView: Using cached view for '${name}' with URL path '${urlPath}'`);
|
|
411
411
|
return {
|
|
412
412
|
html: html,
|
|
413
413
|
isSuperView: superView ? true : false,
|
|
@@ -421,7 +421,7 @@ export class ViewManager {
|
|
|
421
421
|
|
|
422
422
|
let hasCache = false;
|
|
423
423
|
if (this.cachedTimes > 0) {
|
|
424
|
-
let cacheKey = name
|
|
424
|
+
let cacheKey = name + '__' + urlPath + '__ciew';
|
|
425
425
|
const cachedData = this.storageService.get(cacheKey);
|
|
426
426
|
if (cachedData) {
|
|
427
427
|
data = { ...data, ...cachedData };
|
|
@@ -447,7 +447,7 @@ export class ViewManager {
|
|
|
447
447
|
if (this.cachedTimes > 0) {
|
|
448
448
|
if (this.PAGE_VIEW instanceof ViewEngine) {
|
|
449
449
|
const oldCacheData = this.PAGE_VIEW.data;
|
|
450
|
-
let cacheKey = this.PAGE_VIEW.path
|
|
450
|
+
let cacheKey = this.PAGE_VIEW.path + '__' + this.PAGE_VIEW.urlPath + '__ciew';
|
|
451
451
|
this.storageService.set(cacheKey, oldCacheData, 3600); // cache trong 1 giờ
|
|
452
452
|
}
|
|
453
453
|
}
|
|
@@ -1362,7 +1362,7 @@ export class ViewManager {
|
|
|
1362
1362
|
}
|
|
1363
1363
|
result = view.__[renderMethod]();
|
|
1364
1364
|
}
|
|
1365
|
-
const apiDataKey = view.__.path
|
|
1365
|
+
const apiDataKey = view.__.path + '_' + view.__.urlPath + ':data';
|
|
1366
1366
|
|
|
1367
1367
|
// ====================================================================
|
|
1368
1368
|
// CASE 3A: Has @await - Load data by current URL
|
package/src/core/ViewState.js
CHANGED
|
@@ -216,9 +216,6 @@ export class StateManager {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
// Log để debug (có thể tắt trong production)
|
|
219
|
-
if (this.controller?.App?.env?.debug) {
|
|
220
|
-
logger.log(`[StateManager] Flushing ${changesToProcess.length} changes (flush #${this._flushCount}):`, changesToProcess);
|
|
221
|
-
}
|
|
222
219
|
|
|
223
220
|
// Reset cờ called của multi-key listeners
|
|
224
221
|
for (const listener of this.multiKeyListeners) {
|