@absolutejs/absolute 0.20.0-beta.123 → 0.20.0-beta.125

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
@@ -23455,10 +23455,14 @@ var resolveDevClientDir3 = () => {
23455
23455
  return "template-only";
23456
23456
  }
23457
23457
  return "full";
23458
- }, generateVueHmrId = (sourceFilePath, vueRootDir) => relative18(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => {
23459
- const staticImports = Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g));
23460
- const dynamicImports = Array.from(sourceCode.matchAll(/\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g));
23461
- return Array.from(new Set([...staticImports, ...dynamicImports].map((match) => match[1]).filter((importPath) => importPath !== undefined)));
23458
+ }, generateVueHmrId = (sourceFilePath, vueRootDir) => relative18(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), importScanner, IMPORT_PATTERNS, matchImports = (sourceCode) => IMPORT_PATTERNS.flatMap((pattern) => Array.from(sourceCode.matchAll(pattern), (match) => match[1])).filter((importPath) => importPath !== undefined), extractImports = (sourceCode) => {
23459
+ let found;
23460
+ try {
23461
+ found = importScanner.scanImports(sourceCode).map(({ path: path2 }) => path2);
23462
+ } catch {
23463
+ found = matchImports(sourceCode);
23464
+ }
23465
+ return Array.from(new Set(found));
23462
23466
  }, resolveHelperTsPath = (sourceDir, helper) => {
23463
23467
  if (helper.endsWith(".ts"))
23464
23468
  return resolve34(sourceDir, helper);
@@ -24033,6 +24037,12 @@ var init_compileVue = __esm(() => {
24033
24037
  persistentBuildCache = new Map;
24034
24038
  vueSourceHashCache = new Map;
24035
24039
  vueHmrMetadata = new Map;
24040
+ importScanner = new Bun.Transpiler({ loader: "ts" });
24041
+ IMPORT_PATTERNS = [
24042
+ /import\s+[\s\S]+?['"]([^'"]+)['"]/g,
24043
+ /\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g,
24044
+ /\bexport\s+(?:type\s+)?(?:\*(?:\s+as\s+[\w$]+)?|\{[^}]*\})\s*from\s*['"]([^'"]+)['"]/g
24045
+ ];
24036
24046
  EXTERNAL_STYLE_DEPENDENCY = /@(?:import|use|forward)\b/;
24037
24047
  fingerprintCache2 = new Map;
24038
24048
  pendingWrites = new Set;
@@ -30723,6 +30733,15 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
30723
30733
  const oldest = state.hmrUpdates.keys().next().value;
30724
30734
  if (typeof oldest === "number")
30725
30735
  state.hmrUpdates.delete(oldest);
30736
+ }, canonicalClients, canonicalClient = (client2) => {
30737
+ const { raw } = client2;
30738
+ if (!raw)
30739
+ return client2;
30740
+ const known = canonicalClients.get(raw);
30741
+ if (known)
30742
+ return known;
30743
+ canonicalClients.set(raw, client2);
30744
+ return client2;
30726
30745
  }, trySendMessage = (client2, messageStr) => {
30727
30746
  try {
30728
30747
  client2.send(messageStr);
@@ -30749,7 +30768,7 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
30749
30768
  state.clientTargets.delete(client2);
30750
30769
  });
30751
30770
  }, handleClientConnect = (state, client2, manifest) => {
30752
- state.connectedClients.add(client2);
30771
+ state.connectedClients.add(canonicalClient(client2));
30753
30772
  const serverVersions = serializeModuleVersions(state.moduleVersions);
30754
30773
  client2.send(JSON.stringify({
30755
30774
  data: {
@@ -30786,8 +30805,11 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
30786
30805
  }));
30787
30806
  }
30788
30807
  }, handleClientDisconnect = (state, client2) => {
30789
- state.connectedClients.delete(client2);
30790
- state.clientTargets.delete(client2);
30808
+ const known = canonicalClient(client2);
30809
+ state.connectedClients.delete(known);
30810
+ state.clientTargets.delete(known);
30811
+ if (client2.raw)
30812
+ canonicalClients.delete(client2.raw);
30791
30813
  }, parseJsonSafe = (raw) => JSON.parse(raw), parseMessage = (message) => {
30792
30814
  if (typeof message === "string") {
30793
30815
  return parseJsonSafe(message);
@@ -30863,12 +30885,13 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
30863
30885
  if (!isValidHMRClientMessage(parsedData)) {
30864
30886
  return;
30865
30887
  }
30866
- handleParsedMessage(state, client2, parsedData);
30888
+ handleParsedMessage(state, canonicalClient(client2), parsedData);
30867
30889
  } catch {}
30868
30890
  };
30869
30891
  var init_webSocket = __esm(() => {
30870
30892
  init_telemetryEvent();
30871
30893
  init_logger();
30894
+ canonicalClients = new WeakMap;
30872
30895
  });
30873
30896
 
30874
30897
  // src/dev/moduleServer.ts
@@ -45778,5 +45801,5 @@ export {
45778
45801
  wrapPageHandlerWithStreamingSlots
45779
45802
  };
45780
45803
 
45781
- //# debugId=B86705ABD58A04A464756E2164756E21
45804
+ //# debugId=105F7E3CA690A8B864756E2164756E21
45782
45805
  //# sourceMappingURL=index.js.map