@absolutejs/absolute 0.19.0-beta.64 → 0.19.0-beta.65

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.
@@ -37,16 +37,19 @@ export const handleReactUpdate = (message: {
37
37
  const pageModuleUrl = message.data.pageModuleUrl;
38
38
 
39
39
  // Non-component file: import the data file first (cache bust),
40
- // then re-import the page so the component re-renders.
41
- if (dataModuleUrl && pageModuleUrl && refreshRuntime) {
42
- applyDataThenPage(
43
- dataModuleUrl,
44
- pageModuleUrl,
45
- refreshRuntime,
46
- serverDuration
47
- );
40
+ // then re-import the page so the component re-renders with new data.
41
+ if (dataModuleUrl && refreshRuntime) {
42
+ const pageUrl = window.__REACT_PAGE_MODULE__;
43
+ if (pageUrl) {
44
+ applyDataThenPage(
45
+ dataModuleUrl,
46
+ pageUrl,
47
+ refreshRuntime,
48
+ serverDuration
49
+ );
48
50
 
49
- return;
51
+ return;
52
+ }
50
53
  }
51
54
 
52
55
  if (pageModuleUrl && refreshRuntime) {
package/dist/index.js CHANGED
@@ -203450,36 +203450,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
203450
203450
  invalidateModule2(file4);
203451
203451
  }
203452
203452
  const isComponentFile = primaryFile.endsWith(".tsx") || primaryFile.endsWith(".jsx");
203453
- let broadcastFile = primaryFile;
203454
- if (!isComponentFile) {
203455
- const pageFile = reactFiles.find((f) => f.replace(/\\/g, "/").includes("/pages/") && (f.endsWith(".tsx") || f.endsWith(".jsx")));
203456
- if (pageFile) {
203457
- broadcastFile = pageFile;
203458
- } else {
203459
- const visited = new Set;
203460
- const queue = [resolve21(primaryFile)];
203461
- while (queue.length > 0) {
203462
- const current = queue.shift();
203463
- if (visited.has(current))
203464
- continue;
203465
- visited.add(current);
203466
- if (current.replace(/\\/g, "/").includes("/pages/") && (current.endsWith(".tsx") || current.endsWith(".jsx"))) {
203467
- broadcastFile = current;
203468
- break;
203469
- }
203470
- const deps = state.dependencyGraph.dependents.get(current);
203471
- if (deps) {
203472
- for (const dep of deps)
203473
- queue.push(dep);
203474
- }
203475
- }
203476
- }
203477
- }
203478
- const pageModuleUrl = await getReactModuleUrl(broadcastFile);
203479
- let dataModuleUrl;
203480
- if (!isComponentFile && broadcastFile !== primaryFile) {
203481
- dataModuleUrl = await getReactModuleUrl(primaryFile);
203482
- }
203453
+ const pageModuleUrl = await getReactModuleUrl(primaryFile);
203454
+ const dataModuleUrl = isComponentFile ? undefined : pageModuleUrl;
203483
203455
  if (pageModuleUrl) {
203484
203456
  const serverDuration = Date.now() - startTime;
203485
203457
  state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
@@ -205250,5 +205222,5 @@ export {
205250
205222
  ANGULAR_INIT_TIMEOUT_MS
205251
205223
  };
205252
205224
 
205253
- //# debugId=B320936B9473DFEE64756E2164756E21
205225
+ //# debugId=3F65A57A3B2221F364756E2164756E21
205254
205226
  //# sourceMappingURL=index.js.map