@absolutejs/absolute 0.19.0-beta.101 → 0.19.0-beta.102

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.
@@ -34,9 +34,15 @@ export const handleReactUpdate = (message: {
34
34
  const serverDuration = message.data.serverDuration;
35
35
  const pageModuleUrl = message.data.pageModuleUrl;
36
36
 
37
- // If the root accept handler is active (index file re-renders
38
- // the root), skip the Fast Refresh import root.render() handles it.
39
- if ((window as unknown as Record<string, unknown>).__HMR_ROOT_ACCEPT__) {
37
+ // For non-component files (.ts data), the root accept handler
38
+ // re-imports the page and calls root.render(). Skip Fast Refresh.
39
+ // For component files (.tsx/.jsx), use Fast Refresh directly.
40
+ const src = message.data.primarySource ?? '';
41
+ const isComponent = src.endsWith('.tsx') || src.endsWith('.jsx');
42
+ if (
43
+ !isComponent &&
44
+ (window as unknown as Record<string, unknown>).__HMR_ROOT_ACCEPT__
45
+ ) {
40
46
  return;
41
47
  }
42
48
 
package/dist/index.js CHANGED
@@ -505,7 +505,7 @@ var indexContentCache, resolveDevClientDir = () => {
505
505
  ` if (origOnMessage) origOnMessage.call(this, event);`,
506
506
  ` try {`,
507
507
  ` const msg = JSON.parse(event.data);`,
508
- ` if (msg.type === 'react-update') {`,
508
+ ` if (msg.type === 'react-update' && msg.data?.primarySource && !msg.data.primarySource.endsWith('.tsx') && !msg.data.primarySource.endsWith('.jsx')) {`,
509
509
  ` const url = "/@src/${relative(process.cwd(), resolve2(reactPagesDirectory, componentName + ".tsx")).replace(/\\/g, "/")}";`,
510
510
  ` const start = performance.now();`,
511
511
  ` import(url + '?t=' + Date.now()).then(mod => {`,
@@ -205319,5 +205319,5 @@ export {
205319
205319
  ANGULAR_INIT_TIMEOUT_MS
205320
205320
  };
205321
205321
 
205322
- //# debugId=24BFD70A245036F364756E2164756E21
205322
+ //# debugId=9822FF122B8382B864756E2164756E21
205323
205323
  //# sourceMappingURL=index.js.map