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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onelaraveljs",
3
- "version": "1.21.1",
3
+ "version": "1.21.2",
4
4
  "description": "OneLaravel JS Framework Core & Compiler",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -390,7 +390,7 @@ export class ViewManager {
390
390
  this.PAGE_VIEW = null;
391
391
  try {
392
392
 
393
- const viewStoreKey = name.replace('.', '_') + '_' + urlPath?.replace(/[\/\:]/g, '_');
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.replace('.', '_') + '_' + urlPath?.replace(/[\/\:]/g, '_');
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.replace('.', '_') + '_' + this.PAGE_VIEW.urlPath?.replace(/\//g, '_');
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.replace(/\//g, '_') + '_' + view.__.urlPath.replace(/[\/\?\=\&]/g, '_') + '_data';
1365
+ const apiDataKey = view.__.path + '_' + view.__.urlPath + ':data';
1366
1366
 
1367
1367
  // ====================================================================
1368
1368
  // CASE 3A: Has @await - Load data by current URL
@@ -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) {