@absolutejs/absolute 0.18.3-beta.10 → 0.18.3-beta.11

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/index.js CHANGED
@@ -173552,7 +173552,37 @@ __export(exports_devBuild, {
173552
173552
  import { readdir as readdir2 } from "fs/promises";
173553
173553
  import { statSync } from "fs";
173554
173554
  import { resolve as resolve20 } from "path";
173555
- var FRAMEWORK_DIR_KEYS, reloadConfig = async () => {
173555
+ var INTERNALS_KEYS, findInternals = (mod) => {
173556
+ for (const key of INTERNALS_KEYS) {
173557
+ const val = mod[key];
173558
+ if (val)
173559
+ return val;
173560
+ }
173561
+ return;
173562
+ }, bridgeReactInternals = async () => {
173563
+ const pinned = globalThis.__reactModuleRef;
173564
+ if (!pinned)
173565
+ return;
173566
+ const react = await import("react");
173567
+ if (pinned === react)
173568
+ return;
173569
+ const pinnedInternals = findInternals(pinned);
173570
+ const currentInternals = findInternals(react);
173571
+ if (!pinnedInternals || !currentInternals || pinnedInternals === currentInternals)
173572
+ return;
173573
+ for (const prop of Object.keys(pinnedInternals)) {
173574
+ Object.defineProperty(currentInternals, prop, {
173575
+ get() {
173576
+ return pinnedInternals[prop];
173577
+ },
173578
+ set(v) {
173579
+ pinnedInternals[prop] = v;
173580
+ },
173581
+ configurable: true,
173582
+ enumerable: true
173583
+ });
173584
+ }
173585
+ }, FRAMEWORK_DIR_KEYS, reloadConfig = async () => {
173556
173586
  try {
173557
173587
  const configPath2 = resolve20(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
173558
173588
  const source = await Bun.file(configPath2).text();
@@ -173632,6 +173662,9 @@ var FRAMEWORK_DIR_KEYS, reloadConfig = async () => {
173632
173662
  await cleanStaleAssets(state.assetStore, cached.manifest, state.resolvedPaths.buildDir);
173633
173663
  }
173634
173664
  state.rebuildCount++;
173665
+ if (state.config.reactDirectory) {
173666
+ await bridgeReactInternals();
173667
+ }
173635
173668
  } catch {} finally {
173636
173669
  state.isRebuilding = false;
173637
173670
  state.fileChangeQueue.clear();
@@ -173753,6 +173786,10 @@ var init_devBuild = __esm(() => {
173753
173786
  init_assetStore();
173754
173787
  init_rebuildTrigger();
173755
173788
  init_logger();
173789
+ INTERNALS_KEYS = [
173790
+ "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
173791
+ "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED"
173792
+ ];
173756
173793
  FRAMEWORK_DIR_KEYS = [
173757
173794
  "reactDirectory",
173758
173795
  "svelteDirectory",
@@ -173890,45 +173927,10 @@ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,r
173890
173927
  };
173891
173928
 
173892
173929
  // src/react/pageHandler.ts
173893
- var INTERNALS_KEYS = [
173894
- "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
173895
- "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED"
173896
- ];
173897
- var findInternals = (mod) => {
173898
- for (const key of INTERNALS_KEYS) {
173899
- const val = mod[key];
173900
- if (val)
173901
- return val;
173902
- }
173903
- return;
173904
- };
173905
- var ensureReactConsistency = (react) => {
173906
- const pinned = globalThis.__reactModuleRef;
173907
- if (!pinned || pinned === react)
173908
- return;
173909
- const pinnedInternals = findInternals(pinned);
173910
- const currentInternals = findInternals(react);
173911
- if (!pinnedInternals || !currentInternals || pinnedInternals === currentInternals)
173912
- return;
173913
- for (const prop of Object.keys(pinnedInternals)) {
173914
- Object.defineProperty(currentInternals, prop, {
173915
- get() {
173916
- return pinnedInternals[prop];
173917
- },
173918
- set(v) {
173919
- pinnedInternals[prop] = v;
173920
- },
173921
- configurable: true,
173922
- enumerable: true
173923
- });
173924
- }
173925
- };
173926
173930
  var handleReactPageRequest = async (PageComponent, index, ...props) => {
173927
173931
  try {
173928
173932
  const [maybeProps] = props;
173929
- const react = await import("react");
173930
- ensureReactConsistency(react);
173931
- const { createElement } = react;
173933
+ const { createElement } = await import("react");
173932
173934
  const { renderToReadableStream } = await import("react-dom/server");
173933
173935
  const element = maybeProps !== undefined ? createElement(PageComponent, maybeProps) : createElement(PageComponent);
173934
173936
  const refreshStubs = "window.$RefreshReg$=function(){};window.$RefreshSig$=function(){return function(t){return t}};";
@@ -174230,5 +174232,5 @@ export {
174230
174232
  ANGULAR_INIT_TIMEOUT_MS
174231
174233
  };
174232
174234
 
174233
- //# debugId=F79346D6E7F3956564756E2164756E21
174235
+ //# debugId=A3472E6FE20A903764756E2164756E21
174234
174236
  //# sourceMappingURL=index.js.map