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

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
@@ -79,6 +79,45 @@ var init_constants = __esm(() => {
79
79
  TWO_THIRDS = 2 / 3;
80
80
  });
81
81
 
82
+ // src/react/bridgeInternals.ts
83
+ var INTERNALS_KEYS, findInternals = (mod) => {
84
+ for (const key of INTERNALS_KEYS) {
85
+ const val = mod[key];
86
+ if (val)
87
+ return val;
88
+ }
89
+ return;
90
+ }, bridgeReactInternals = async () => {
91
+ const pinned = globalThis.__reactModuleRef;
92
+ if (!pinned)
93
+ return;
94
+ const react = await import("react");
95
+ if (pinned === react)
96
+ return;
97
+ const pinnedInternals = findInternals(pinned);
98
+ const currentInternals = findInternals(react);
99
+ if (!pinnedInternals || !currentInternals || pinnedInternals === currentInternals)
100
+ return;
101
+ for (const prop of Object.keys(pinnedInternals)) {
102
+ Object.defineProperty(currentInternals, prop, {
103
+ get() {
104
+ return pinnedInternals[prop];
105
+ },
106
+ set(v) {
107
+ pinnedInternals[prop] = v;
108
+ },
109
+ configurable: true,
110
+ enumerable: true
111
+ });
112
+ }
113
+ };
114
+ var init_bridgeInternals = __esm(() => {
115
+ INTERNALS_KEYS = [
116
+ "__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
117
+ "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED"
118
+ ];
119
+ });
120
+
82
121
  // src/utils/normalizePath.ts
83
122
  var normalizePath = (path) => path.replace(/\\/g, "/");
84
123
 
@@ -173632,6 +173671,9 @@ var FRAMEWORK_DIR_KEYS, reloadConfig = async () => {
173632
173671
  await cleanStaleAssets(state.assetStore, cached.manifest, state.resolvedPaths.buildDir);
173633
173672
  }
173634
173673
  state.rebuildCount++;
173674
+ if (state.config.reactDirectory) {
173675
+ await bridgeReactInternals();
173676
+ }
173635
173677
  } catch {} finally {
173636
173678
  state.isRebuilding = false;
173637
173679
  state.fileChangeQueue.clear();
@@ -173753,6 +173795,7 @@ var init_devBuild = __esm(() => {
173753
173795
  init_assetStore();
173754
173796
  init_rebuildTrigger();
173755
173797
  init_logger();
173798
+ init_bridgeInternals();
173756
173799
  FRAMEWORK_DIR_KEYS = [
173757
173800
  "reactDirectory",
173758
173801
  "svelteDirectory",
@@ -173890,45 +173933,14 @@ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,r
173890
173933
  };
173891
173934
 
173892
173935
  // 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
- };
173936
+ init_bridgeInternals();
173926
173937
  var handleReactPageRequest = async (PageComponent, index, ...props) => {
173927
173938
  try {
173928
173939
  const [maybeProps] = props;
173929
- const react = await import("react");
173930
- ensureReactConsistency(react);
173931
- const { createElement } = react;
173940
+ if (true) {
173941
+ await bridgeReactInternals();
173942
+ }
173943
+ const { createElement } = await import("react");
173932
173944
  const { renderToReadableStream } = await import("react-dom/server");
173933
173945
  const element = maybeProps !== undefined ? createElement(PageComponent, maybeProps) : createElement(PageComponent);
173934
173946
  const refreshStubs = "window.$RefreshReg$=function(){};window.$RefreshSig$=function(){return function(t){return t}};";
@@ -174230,5 +174242,5 @@ export {
174230
174242
  ANGULAR_INIT_TIMEOUT_MS
174231
174243
  };
174232
174244
 
174233
- //# debugId=F79346D6E7F3956564756E2164756E21
174245
+ //# debugId=108DC1BDF174039564756E2164756E21
174234
174246
  //# sourceMappingURL=index.js.map