@lolyjs/core 0.3.0-alpha.3 → 0.3.0-alpha.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/dist/cli.cjs CHANGED
@@ -11319,7 +11319,14 @@ var FilesystemRouteLoader = class {
11319
11319
  if (hasFilesChanged(this.appDir, this.projectRoot, this.cache.fileStats) || this.cache.apiRoutes.length === 0) {
11320
11320
  const files = getRelevantFiles(this.appDir, this.projectRoot);
11321
11321
  const fileStats = buildFileStats(files);
11322
- this.cache.apiRoutes = await loadApiRoutes(this.appDir);
11322
+ const apiRoutes = await loadApiRoutes(this.appDir);
11323
+ if (!this.cache) {
11324
+ await this.loadRoutes();
11325
+ if (!this.cache) {
11326
+ throw new Error("Failed to initialize route cache");
11327
+ }
11328
+ }
11329
+ this.cache.apiRoutes = apiRoutes;
11323
11330
  this.cache.fileStats = fileStats;
11324
11331
  this.cache.timestamp = Date.now();
11325
11332
  }
@@ -11336,7 +11343,14 @@ var FilesystemRouteLoader = class {
11336
11343
  if (hasFilesChanged(this.appDir, this.projectRoot, this.cache.fileStats) || this.cache.wssRoutes.length === 0) {
11337
11344
  const files = getRelevantFiles(this.appDir, this.projectRoot);
11338
11345
  const fileStats = buildFileStats(files);
11339
- this.cache.wssRoutes = await loadWssRoutes(this.appDir);
11346
+ const wssRoutes = await loadWssRoutes(this.appDir);
11347
+ if (!this.cache) {
11348
+ await this.loadRoutes();
11349
+ if (!this.cache) {
11350
+ throw new Error("Failed to initialize route cache");
11351
+ }
11352
+ }
11353
+ this.cache.wssRoutes = wssRoutes;
11340
11354
  this.cache.fileStats = fileStats;
11341
11355
  this.cache.timestamp = Date.now();
11342
11356
  }
@@ -11353,7 +11367,14 @@ var FilesystemRouteLoader = class {
11353
11367
  if (hasFilesChanged(this.appDir, this.projectRoot, this.cache.fileStats) || this.cache.notFoundRoute === void 0) {
11354
11368
  const files = getRelevantFiles(this.appDir, this.projectRoot);
11355
11369
  const fileStats = buildFileStats(files);
11356
- this.cache.notFoundRoute = await loadNotFoundRouteFromFilesystem(this.appDir, this.projectRoot);
11370
+ const notFoundRoute = await loadNotFoundRouteFromFilesystem(this.appDir, this.projectRoot);
11371
+ if (!this.cache) {
11372
+ await this.loadRoutes();
11373
+ if (!this.cache) {
11374
+ throw new Error("Failed to initialize route cache");
11375
+ }
11376
+ }
11377
+ this.cache.notFoundRoute = notFoundRoute;
11357
11378
  this.cache.fileStats = fileStats;
11358
11379
  this.cache.timestamp = Date.now();
11359
11380
  }
@@ -11370,7 +11391,14 @@ var FilesystemRouteLoader = class {
11370
11391
  if (hasFilesChanged(this.appDir, this.projectRoot, this.cache.fileStats) || this.cache.errorRoute === void 0) {
11371
11392
  const files = getRelevantFiles(this.appDir, this.projectRoot);
11372
11393
  const fileStats = buildFileStats(files);
11373
- this.cache.errorRoute = await loadErrorRouteFromFilesystem(this.appDir, this.projectRoot);
11394
+ const errorRoute = await loadErrorRouteFromFilesystem(this.appDir, this.projectRoot);
11395
+ if (!this.cache) {
11396
+ await this.loadRoutes();
11397
+ if (!this.cache) {
11398
+ throw new Error("Failed to initialize route cache");
11399
+ }
11400
+ }
11401
+ this.cache.errorRoute = errorRoute;
11374
11402
  this.cache.fileStats = fileStats;
11375
11403
  this.cache.timestamp = Date.now();
11376
11404
  }
@@ -12918,7 +12946,7 @@ function createDocumentTree(options) {
12918
12946
  }),
12919
12947
  ...extraMetaTags,
12920
12948
  ...linkTags,
12921
- ...entrypointFiles.length > 0 ? entrypointFiles.slice(0, -1).map(
12949
+ ...entrypointFiles.length > 0 ? entrypointFiles.map(
12922
12950
  (file) => import_react.default.createElement("link", {
12923
12951
  key: `preload-${file}`,
12924
12952
  rel: "preload",
@@ -12939,6 +12967,13 @@ function createDocumentTree(options) {
12939
12967
  href: faviconPath,
12940
12968
  type: faviconType || (faviconPath.endsWith(".ico") ? "image/x-icon" : "image/png")
12941
12969
  }),
12970
+ // Preload CSS para evitar bloqueo de renderizado
12971
+ import_react.default.createElement("link", {
12972
+ key: "preload-css",
12973
+ rel: "preload",
12974
+ href: clientCssPath,
12975
+ as: "style"
12976
+ }),
12942
12977
  import_react.default.createElement("link", {
12943
12978
  rel: "stylesheet",
12944
12979
  href: clientCssPath