@absolutejs/absolute 0.19.0-beta.97 → 0.19.0-beta.99

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/build.js CHANGED
@@ -199,9 +199,6 @@ var indexContentCache, resolveDevClientDir = () => {
199
199
  ` reset() {`,
200
200
  ` this.setState({ hasError: false });`,
201
201
  ` }`,
202
- ` hmrUpdate() {`,
203
- ` this.forceUpdate();`,
204
- ` }`,
205
202
  ` render() {`,
206
203
  ` if (this.state.hasError) return null;`,
207
204
  ``,
@@ -202328,8 +202325,6 @@ var init_pageHandler = __esm(() => {
202328
202325
  var exports_transformCache = {};
202329
202326
  __export(exports_transformCache, {
202330
202327
  setTransformed: () => setTransformed,
202331
- markAsDataFile: () => markAsDataFile,
202332
- isDataFile: () => isDataFile,
202333
202328
  invalidateAll: () => invalidateAll,
202334
202329
  invalidate: () => invalidate,
202335
202330
  getTransformed: () => getTransformed,
@@ -202357,9 +202352,7 @@ var globalStore, cache, importers, getTransformed = (filePath) => cache.get(file
202357
202352
  }, invalidateAll = () => {
202358
202353
  cache.clear();
202359
202354
  importers.clear();
202360
- }, dataFiles, markAsDataFile = (filePath) => {
202361
- dataFiles.add(filePath);
202362
- }, isDataFile = (filePath) => dataFiles.has(filePath), findNearestComponent = (filePath) => {
202355
+ }, findNearestComponent = (filePath) => {
202363
202356
  const visited = new Set;
202364
202357
  const queue = [filePath];
202365
202358
  while (queue.length > 0) {
@@ -202387,8 +202380,6 @@ var init_transformCache = __esm(() => {
202387
202380
  globalStore.__transformImporters = importers;
202388
202381
  invalidationVersions = globalStore.__transformInvalidationVersions ?? new Map;
202389
202382
  globalStore.__transformInvalidationVersions = invalidationVersions;
202390
- dataFiles = globalStore.__transformDataFiles ?? new Set;
202391
- globalStore.__transformDataFiles = dataFiles;
202392
202383
  });
202393
202384
 
202394
202385
  // src/dev/moduleServer.ts
@@ -202532,20 +202523,6 @@ ${stubs}
202532
202523
  return _match;
202533
202524
  });
202534
202525
  return result;
202535
- }, NAMED_IMPORT_RE, rewriteDataImports = (code, projectRoot) => {
202536
- let counter = 0;
202537
- return code.replace(NAMED_IMPORT_RE, (_match, names, q1, srcUrl2, q2) => {
202538
- const urlPath = srcUrl2.replace(/^\/\@src\//, "").split("?")[0];
202539
- if (!urlPath)
202540
- return _match;
202541
- const absPath = resolve17(projectRoot, urlPath);
202542
- if (!isDataFile(absPath))
202543
- return _match;
202544
- const alias = `__hmr_${counter++}`;
202545
- const trimmedNames = names.trim();
202546
- return `import ${alias} from ${q1}${srcUrl2}${q2};
202547
- const { ${trimmedNames} } = ${alias}`;
202548
- });
202549
202526
  }, HOOK_NAMES, REFRESH_PREAMBLE, JSX_AUTO_RE, JSXS_AUTO_RE, JSX_PROD_RE, FRAGMENT_RE, addJsxImport = (code) => {
202550
202527
  const imports = [];
202551
202528
  const jsxDevMatch = JSX_AUTO_RE.exec(code);
@@ -202583,34 +202560,7 @@ const { ${trimmedNames} } = ${alias}`;
202583
202560
  ` + transpiled;
202584
202561
  const relPath = relative7(projectRoot, filePath).replace(/\\/g, "/");
202585
202562
  transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
202586
- let result = rewriteImports2(transpiled, filePath, projectRoot, rewriter);
202587
- result = rewriteDataImports(result, projectRoot);
202588
- return result;
202589
- }, isDataOnlyFile = (exports, transpiled) => {
202590
- if (exports.length === 0)
202591
- return false;
202592
- if (exports.some((e) => /^[A-Z]/.test(e) && /^(use|[A-Z])/.test(e)))
202593
- return false;
202594
- if (/export\s+(function|class|async\s+function)\s/.test(transpiled))
202595
- return false;
202596
- return true;
202597
- }, wrapDataExports = (transpiled, filePath, exports) => {
202598
- const storeKey = filePath.replace(/\\/g, "/");
202599
- let result = transpiled;
202600
- const preamble = `const __hmr = ((globalThis.__HMR_DATA__ ??= {})[${JSON.stringify(storeKey)}] ??= {});
202601
- `;
202602
- for (const name of exports) {
202603
- result = result.replace(new RegExp(`export\\s+const\\s+${name}\\s*=`), `__hmr.${name} =`);
202604
- result = result.replace(new RegExp(`export\\s+var\\s+${name}\\s*=`), `__hmr.${name} =`);
202605
- result = result.replace(new RegExp(`export\\s+let\\s+${name}\\s*=`), `__hmr.${name} =`);
202606
- }
202607
- const defaultExport = `
202608
- export default __hmr;
202609
- `;
202610
- const namedExports = exports.map((name) => `export const ${name} = __hmr.${name};`).join(`
202611
- `);
202612
- return preamble + result + `
202613
- ` + namedExports + defaultExport;
202563
+ return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
202614
202564
  }, transformPlainFile = (filePath, projectRoot, rewriter) => {
202615
202565
  const raw = readFileSync9(filePath, "utf-8");
202616
202566
  const ext = extname3(filePath);
@@ -202622,13 +202572,7 @@ export default __hmr;
202622
202572
  if (isTS) {
202623
202573
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
202624
202574
  }
202625
- if (isTS && !isTSX && isDataOnlyFile(valueExports, transpiled)) {
202626
- transpiled = wrapDataExports(transpiled, filePath, valueExports);
202627
- markAsDataFile(filePath);
202628
- }
202629
- let result = rewriteImports2(transpiled, filePath, projectRoot, rewriter);
202630
- result = rewriteDataImports(result, projectRoot);
202631
- return result;
202575
+ return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
202632
202576
  }, svelteExternalCss, svelteCompiler = null, vueCompiler = null, warmCompilers = async (frameworks) => {
202633
202577
  const [sc, vc] = await Promise.all([
202634
202578
  frameworks.svelte ? import("svelte/compiler") : undefined,
@@ -202770,12 +202714,16 @@ ${code}`;
202770
202714
  if (existsSync13(`${path}.js`))
202771
202715
  return `${path}.js`;
202772
202716
  return path;
202773
- }, jsResponse = (body) => new Response(body, {
202774
- headers: {
202775
- "Cache-Control": "no-cache",
202776
- "Content-Type": "application/javascript"
202777
- }
202778
- }), handleCssRequest = (filePath) => {
202717
+ }, jsResponse = (body) => {
202718
+ const etag = `"${Bun.hash(body).toString(36)}"`;
202719
+ return new Response(body, {
202720
+ headers: {
202721
+ "Cache-Control": "no-cache",
202722
+ "Content-Type": "application/javascript",
202723
+ ETag: etag
202724
+ }
202725
+ });
202726
+ }, handleCssRequest = (filePath) => {
202779
202727
  const raw = readFileSync9(filePath, "utf-8");
202780
202728
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
202781
202729
  return [
@@ -203006,7 +202954,6 @@ var init_moduleServer = __esm(() => {
203006
202954
  STRING_CONTENTS_RE = /`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/gs;
203007
202955
  REACT_EXTENSIONS = new Set([".tsx", ".jsx"]);
203008
202956
  mtimeCache = new Map;
203009
- NAMED_IMPORT_RE = /import\s*\{([^}]+)\}\s*from\s*(["'])(\/\@src\/[^"']+)(["']);?/g;
203010
202957
  HOOK_NAMES = new Set([
203011
202958
  "useState",
203012
202959
  "useReducer",
@@ -204960,5 +204907,5 @@ export {
204960
204907
  build
204961
204908
  };
204962
204909
 
204963
- //# debugId=212AF9B72308BD8264756E2164756E21
204910
+ //# debugId=C820298FC4C29C7664756E2164756E21
204964
204911
  //# sourceMappingURL=build.js.map