@absolutejs/absolute 0.19.0-beta.733 → 0.19.0-beta.735

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/build.js CHANGED
@@ -44240,6 +44240,11 @@ var propProviders = Object.entries(pageProps).map(function(entry) {
44240
44240
  var token = pageModule[toScreamingSnake(propName)];
44241
44241
  return isInjectionToken(token) ? { provide: token, useValue: propValue } : null;
44242
44242
  }).filter(Boolean);
44243
+ // Page-level providers, opt-in via \`export const providers = [...]\` in the
44244
+ // page module. Required so DI tokens that the component (or any service it
44245
+ // injects) needs are available client-side too \u2014 without these, services
44246
+ // that worked in SSR fail with NG0201 after hydration.
44247
+ var pageProviders = Array.isArray(pageModule.providers) ? pageModule.providers : [];
44243
44248
 
44244
44249
  // Re-Bootstrap HMR with View Transitions API
44245
44250
  if (window.__ANGULAR_APP__) {
@@ -44258,6 +44263,7 @@ if (!window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
44258
44263
  providers.push(provideClientHydration());
44259
44264
  }
44260
44265
  delete window.__HMR_SKIP_HYDRATION__;
44266
+ providers.push.apply(providers, pageProviders);
44261
44267
  providers.push.apply(providers, propProviders);
44262
44268
  window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
44263
44269
 
@@ -44305,10 +44311,15 @@ var propProviders = Object.entries(pageProps).map(function(entry) {
44305
44311
  var token = pageModule[toScreamingSnake(propName)];
44306
44312
  return isInjectionToken(token) ? { provide: token, useValue: propValue } : null;
44307
44313
  }).filter(Boolean);
44314
+ // Page-level providers, opt-in via \`export const providers = [...]\` in the
44315
+ // page module. Required so DI tokens that the component (or any service it
44316
+ // injects) needs are available client-side too \u2014 without these, services
44317
+ // that worked in SSR fail with NG0201 after hydration.
44318
+ var pageProviders = Array.isArray(pageModule.providers) ? pageModule.providers : [];
44308
44319
 
44309
44320
  enableProdMode();
44310
44321
 
44311
- var providers = [provideZonelessChangeDetection()].concat(propProviders);
44322
+ var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(propProviders);
44312
44323
  if (!pageHasIslands) {
44313
44324
  providers.unshift(provideClientHydration());
44314
44325
  }
@@ -44468,24 +44479,11 @@ var init_buildReactVendor = __esm(() => {
44468
44479
  ];
44469
44480
  });
44470
44481
 
44471
- // src/build/detectDefaultExport.ts
44472
- var hasDefaultExport = async (specifier) => {
44473
- try {
44474
- const resolved = Bun.resolveSync(specifier, process.cwd());
44475
- const content = await Bun.file(resolved).text();
44476
- if (/\bexport\s+default\b/.test(content))
44477
- return true;
44478
- if (/\bexport\s*\{\s*[^}]*\bdefault\b[^}]*\}/.test(content))
44479
- return true;
44480
- if (/\bmodule\.exports\s*=/.test(content))
44481
- return true;
44482
- if (/\bexports\.default\s*=/.test(content))
44483
- return true;
44484
- return false;
44485
- } catch {
44486
- return false;
44487
- }
44488
- };
44482
+ // src/build/vendorEntrySource.ts
44483
+ var generateVendorEntrySource = (specifier) => `import * as __abs_ns from '${specifier}';
44484
+ ` + `export * from '${specifier}';
44485
+ ` + `export default __abs_ns.default;
44486
+ `;
44489
44487
 
44490
44488
  // src/build/buildAngularVendor.ts
44491
44489
  var exports_buildAngularVendor = {};
@@ -44596,12 +44594,7 @@ var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS,
44596
44594
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
44597
44595
  const safeName = toSafeFileName2(specifier);
44598
44596
  const entryPath = join17(tmpDir, `${safeName}.ts`);
44599
- const includeDefault = await hasDefaultExport(specifier);
44600
- const source = includeDefault ? `export * from '${specifier}';
44601
- export { default } from '${specifier}';
44602
- ` : `export * from '${specifier}';
44603
- `;
44604
- await Bun.write(entryPath, source);
44597
+ await Bun.write(entryPath, generateVendorEntrySource(specifier));
44605
44598
  return entryPath;
44606
44599
  }));
44607
44600
  const result = await bunBuild4({
@@ -49388,12 +49381,6 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
49388
49381
  dep: Array.from(dep).filter(isResolvable4),
49389
49382
  framework: Array.from(framework).filter(isResolvable4)
49390
49383
  };
49391
- }, generateEntrySource2 = async (specifier) => {
49392
- const namedReexport = `export * from '${specifier}';
49393
- `;
49394
- const includeDefault = await hasDefaultExport(specifier);
49395
- return includeDefault ? `${namedReexport}export { default } from '${specifier}';
49396
- ` : namedReexport;
49397
49384
  }, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
49398
49385
  const { readFileSync: readFileSync15 } = await import("fs");
49399
49386
  const transpiler4 = new Bun.Transpiler({ loader: "js" });
@@ -49440,8 +49427,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
49440
49427
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
49441
49428
  const safeName = toSafeFileName5(specifier);
49442
49429
  const entryPath = join22(tmpDir, `${safeName}.ts`);
49443
- const source = await generateEntrySource2(specifier);
49444
- await Bun.write(entryPath, source);
49430
+ await Bun.write(entryPath, generateVendorEntrySource(specifier));
49445
49431
  return entryPath;
49446
49432
  }));
49447
49433
  return bunBuild8({
@@ -49879,5 +49865,5 @@ export {
49879
49865
  build
49880
49866
  };
49881
49867
 
49882
- //# debugId=326DF99081F5089B64756E2164756E21
49868
+ //# debugId=C345689286AEB91E64756E2164756E21
49883
49869
  //# sourceMappingURL=build.js.map