astro 4.15.10 → 4.15.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/client.d.ts CHANGED
@@ -24,7 +24,7 @@ interface ImportMeta {
24
24
  * Astro and Vite expose environment variables through `import.meta.env`. For a complete list of the environment variables available, see the two references below.
25
25
  *
26
26
  * - [Astro reference](https://docs.astro.build/en/guides/environment-variables/#default-environment-variables)
27
- * - [Vite reference](https://vitejs.dev/guide/env-and-mode.html#env-variables)
27
+ * - [Vite reference](https://vite.dev/guide/env-and-mode.html#env-variables)
28
28
  */
29
29
  readonly env: ImportMetaEnv;
30
30
  }
@@ -747,7 +747,7 @@ export interface AstroUserConfig {
747
747
  *
748
748
  * Pass additional configuration options to Vite. Useful when Astro doesn't support some advanced configuration that you may need.
749
749
  *
750
- * View the full `vite` configuration object documentation on [vitejs.dev](https://vitejs.dev/config/).
750
+ * View the full `vite` configuration object documentation on [vite.dev](https://vite.dev/config/).
751
751
  *
752
752
  * #### Examples
753
753
  *
@@ -1,7 +1,7 @@
1
1
  import { ActionNotFoundError } from "../../../core/errors/errors-data.js";
2
2
  import { AstroError } from "../../../core/errors/errors.js";
3
3
  async function getAction(path) {
4
- const pathKeys = path.replace("/_actions/", "").split(".");
4
+ const pathKeys = path.replace("/_actions/", "").split(".").map((key) => decodeURIComponent(key));
5
5
  let { server: actionLookup } = await import("astro:internal-actions");
6
6
  if (actionLookup == null || !(typeof actionLookup === "object")) {
7
7
  throw new TypeError(
@@ -6,7 +6,11 @@ import { isESMImportedImage } from "./imageKind.js";
6
6
  function propsToFilename(filePath, transform, hash) {
7
7
  let filename = decodeURIComponent(removeQueryString(filePath));
8
8
  const ext = extname(filename);
9
- filename = basename(filename, ext);
9
+ if (filePath.startsWith("data:")) {
10
+ filename = shorthash(filePath);
11
+ } else {
12
+ filename = basename(filename, ext);
13
+ }
10
14
  const prefixDirname = isESMImportedImage(transform.src) ? dirname(filePath) : "";
11
15
  let outputExt = transform.format ? `.${transform.format}` : ext;
12
16
  return decodeURIComponent(`${prefixDirname}/${filename}_${hash}${outputExt}`);
@@ -114,10 +114,25 @@ class ContentLayer {
114
114
  logger.info("Syncing content");
115
115
  const { digest: currentConfigDigest } = contentConfig.config;
116
116
  this.#lastConfigDigest = currentConfigDigest;
117
+ let shouldClear = false;
117
118
  const previousConfigDigest = await this.#store.metaStore().get("config-digest");
119
+ const previousAstroVersion = await this.#store.metaStore().get("astro-version");
118
120
  if (currentConfigDigest && previousConfigDigest !== currentConfigDigest) {
119
- logger.info("Content config changed, clearing cache");
121
+ logger.info("Content config changed");
122
+ shouldClear = true;
123
+ }
124
+ if (previousAstroVersion !== "4.15.12") {
125
+ logger.info("Astro version changed");
126
+ shouldClear = true;
127
+ }
128
+ if (shouldClear) {
129
+ logger.info("Clearing content store");
120
130
  this.#store.clearAll();
131
+ }
132
+ if ("4.15.12") {
133
+ await this.#store.metaStore().set("astro-version", "4.15.12");
134
+ }
135
+ if (currentConfigDigest) {
121
136
  await this.#store.metaStore().set("config-digest", currentConfigDigest);
122
137
  }
123
138
  await Promise.all(
@@ -307,7 +307,10 @@ function updateImageReferencesInData(data, fileName, imageAssetMap) {
307
307
  });
308
308
  }
309
309
  async function renderEntry(entry) {
310
- if (entry && "render" in entry) {
310
+ if (!entry) {
311
+ throw new AstroError(AstroErrorData.RenderUndefinedEntryError);
312
+ }
313
+ if ("render" in entry) {
311
314
  return entry.render();
312
315
  }
313
316
  if (entry.deferredRender) {
@@ -431,13 +434,6 @@ function createReference({ lookupMap }) {
431
434
  });
432
435
  return;
433
436
  }
434
- if (!lookupMap[collection] && !collectionIsInStore) {
435
- ctx.addIssue({
436
- code: ZodIssueCode.custom,
437
- message: `**${flattenedErrorPath}:** Reference to ${collection} invalid. Collection does not exist or is empty.`
438
- });
439
- return;
440
- }
441
437
  return lookup;
442
438
  }
443
439
  if (collectionIsInStore) {
@@ -451,7 +447,7 @@ function createReference({ lookupMap }) {
451
447
  }
452
448
  return { id: lookup, collection };
453
449
  }
454
- if (!lookupMap[collection] && store.collections().size === 0) {
450
+ if (!lookupMap[collection] && store.collections().size <= 1) {
455
451
  return { id: lookup, collection };
456
452
  }
457
453
  const { type, entries } = lookupMap[collection];
@@ -392,7 +392,8 @@ async function writeContentFiles({
392
392
  collection: ${collectionKey};
393
393
  data: ${dataType};
394
394
  rendered?: RenderedContent;
395
- filePath?: string
395
+ filePath?: string;
396
+ body?: string
396
397
  }>;
397
398
  `;
398
399
  break;
@@ -72,7 +72,8 @@ class NodeApp extends App {
72
72
  * @param destination NodeJS ServerResponse
73
73
  */
74
74
  static async writeResponse(source, destination) {
75
- const { status, headers, body } = source;
75
+ const { status, headers, body, statusText } = source;
76
+ destination.statusMessage = statusText;
76
77
  destination.writeHead(status, createOutgoingHttpHeaders(headers));
77
78
  if (!body) return destination.end();
78
79
  try {
@@ -54,7 +54,7 @@ export type SSRManifest = {
54
54
  serverIslandNameMap?: Map<string, string>;
55
55
  key: Promise<CryptoKey>;
56
56
  i18n: SSRManifestI18n | undefined;
57
- middleware: () => Promise<AstroMiddlewareInstance> | AstroMiddlewareInstance;
57
+ middleware?: () => Promise<AstroMiddlewareInstance> | AstroMiddlewareInstance;
58
58
  checkOrigin: boolean;
59
59
  experimentalEnvGetSecretEnabled: boolean;
60
60
  };
@@ -29,7 +29,7 @@ export declare abstract class Pipeline {
29
29
  readonly inlinedScripts: Map<string, string>;
30
30
  readonly compressHTML: boolean;
31
31
  readonly i18n: import("./app/types.js").SSRManifestI18n | undefined;
32
- readonly middleware: () => Promise<import("../@types/astro.js").AstroMiddlewareInstance> | import("../@types/astro.js").AstroMiddlewareInstance;
32
+ readonly middleware: (() => Promise<import("../@types/astro.js").AstroMiddlewareInstance> | import("../@types/astro.js").AstroMiddlewareInstance) | undefined;
33
33
  readonly routeCache: RouteCache;
34
34
  /**
35
35
  * Used for `Astro.site`.
@@ -60,7 +60,7 @@ export declare abstract class Pipeline {
60
60
  /**
61
61
  * Used to provide better error messages for `Astro.clientAddress`
62
62
  */
63
- adapterName?: string, clientDirectives?: Map<string, string>, inlinedScripts?: Map<string, string>, compressHTML?: boolean, i18n?: import("./app/types.js").SSRManifestI18n | undefined, middleware?: () => Promise<import("../@types/astro.js").AstroMiddlewareInstance> | import("../@types/astro.js").AstroMiddlewareInstance, routeCache?: RouteCache,
63
+ adapterName?: string, clientDirectives?: Map<string, string>, inlinedScripts?: Map<string, string>, compressHTML?: boolean, i18n?: import("./app/types.js").SSRManifestI18n | undefined, middleware?: (() => Promise<import("../@types/astro.js").AstroMiddlewareInstance> | import("../@types/astro.js").AstroMiddlewareInstance) | undefined, routeCache?: RouteCache,
64
64
  /**
65
65
  * Used for `Astro.site`.
66
66
  */
@@ -47,7 +47,7 @@ class Pipeline {
47
47
  async getMiddleware() {
48
48
  if (this.resolvedMiddleware) {
49
49
  return this.resolvedMiddleware;
50
- } else {
50
+ } else if (this.middleware) {
51
51
  const middlewareInstance = await this.middleware();
52
52
  const onRequest = middlewareInstance.onRequest ?? NOOP_MIDDLEWARE_FN;
53
53
  if (this.manifest.checkOrigin) {
@@ -56,6 +56,9 @@ class Pipeline {
56
56
  this.resolvedMiddleware = onRequest;
57
57
  }
58
58
  return this.resolvedMiddleware;
59
+ } else {
60
+ this.resolvedMiddleware = NOOP_MIDDLEWARE_FN;
61
+ return this.resolvedMiddleware;
59
62
  }
60
63
  }
61
64
  }
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "4.15.10";
1
+ const ASTRO_VERSION = "4.15.12";
2
2
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
3
3
  const REWRITE_DIRECTIVE_HEADER_KEY = "X-Astro-Rewrite";
4
4
  const REWRITE_DIRECTIVE_HEADER_VALUE = "yes";
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
22
22
  await telemetry.record([]);
23
23
  const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
24
24
  const logger = restart.container.logger;
25
- const currentVersion = "4.15.10";
25
+ const currentVersion = "4.15.12";
26
26
  const isPrerelease = currentVersion.includes("-");
27
27
  if (!isPrerelease) {
28
28
  try {
@@ -1,9 +1,9 @@
1
1
  import * as fs from "node:fs";
2
2
  import { isAbsolute, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
+ import { stripVTControlCharacters } from "node:util";
4
5
  import { escape } from "html-escaper";
5
6
  import { bold, underline } from "kleur/colors";
6
- import stripAnsi from "strip-ansi";
7
7
  import { normalizePath } from "vite";
8
8
  import { removeLeadingForwardSlashWindows } from "../../path.js";
9
9
  import { AggregateError } from "../errors.js";
@@ -16,7 +16,7 @@ function collectErrorMetadata(e, rootFolder) {
16
16
  if (e.stack) {
17
17
  const stackInfo = collectInfoFromStacktrace(e);
18
18
  try {
19
- error.stack = stripAnsi(stackInfo.stack);
19
+ error.stack = stripVTControlCharacters(stackInfo.stack);
20
20
  } catch {
21
21
  }
22
22
  error.loc = stackInfo.loc;
@@ -33,7 +33,7 @@ function collectErrorMetadata(e, rootFolder) {
33
33
  const fileContents = fs.readFileSync(error.loc.file, "utf8");
34
34
  if (!error.frame) {
35
35
  const frame = codeFrame(fileContents, error.loc);
36
- error.frame = stripAnsi(frame);
36
+ error.frame = stripVTControlCharacters(frame);
37
37
  }
38
38
  if (!error.fullCode) {
39
39
  error.fullCode = fileContents;
@@ -44,7 +44,7 @@ function collectErrorMetadata(e, rootFolder) {
44
44
  error.hint = generateHint(e);
45
45
  if (error.message) {
46
46
  try {
47
- error.message = stripAnsi(error.message);
47
+ error.message = stripVTControlCharacters(error.message);
48
48
  } catch {
49
49
  }
50
50
  }
@@ -111,7 +111,7 @@ function collectInfoFromStacktrace(error) {
111
111
  loc: error.loc
112
112
  };
113
113
  stackInfo.stack = normalizeLF(error.stack);
114
- const stackText = stripAnsi(error.stack);
114
+ const stackText = stripVTControlCharacters(error.stack);
115
115
  if (!stackInfo.loc || !stackInfo.loc.column && !stackInfo.loc.line) {
116
116
  const possibleFilePath = error.loc?.file || error.pluginCode || error.id || // TODO: this could be better, `src` might be something else
117
117
  stackText.split("\n").find((ln) => ln.includes("src") || ln.includes("node_modules"));
@@ -793,7 +793,7 @@ export declare const LocalImageUsedWrongly: {
793
793
  * @see
794
794
  * - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
795
795
  * @description
796
- * `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vitejs.dev/guide/features.html#glob-import) instead to achieve the same result.
796
+ * `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) instead to achieve the same result.
797
797
  */
798
798
  export declare const AstroGlobUsedOutside: {
799
799
  name: string;
@@ -866,7 +866,7 @@ export declare const MissingSharp: {
866
866
  /**
867
867
  * @docs
868
868
  * @see
869
- * - [Vite troubleshooting guide](https://vitejs.dev/guide/troubleshooting.html)
869
+ * - [Vite troubleshooting guide](https://vite.dev/guide/troubleshooting.html)
870
870
  * @description
871
871
  * Vite encountered an unknown error while rendering your project. We unfortunately do not know what happened (or we would tell you!)
872
872
  *
@@ -1270,6 +1270,16 @@ export declare const UnknownContentCollectionError: {
1270
1270
  name: string;
1271
1271
  title: string;
1272
1272
  };
1273
+ /**
1274
+ * @docs
1275
+ * @description
1276
+ * Astro tried to render a content collection entry that was undefined. This can happen if you try to render an entry that does not exist.
1277
+ */
1278
+ export declare const RenderUndefinedEntryError: {
1279
+ name: string;
1280
+ title: string;
1281
+ hint: string;
1282
+ };
1273
1283
  /**
1274
1284
  * @docs
1275
1285
  * @description
@@ -274,7 +274,7 @@ const AstroGlobUsedOutside = {
274
274
  name: "AstroGlobUsedOutside",
275
275
  title: "Astro.glob() used outside of an Astro file.",
276
276
  message: (globStr) => `\`Astro.glob(${globStr})\` can only be used in \`.astro\` files. \`import.meta.glob(${globStr})\` can be used instead to achieve a similar result.`,
277
- hint: "See Vite's documentation on `import.meta.glob` for more information: https://vitejs.dev/guide/features.html#glob-import"
277
+ hint: "See Vite's documentation on `import.meta.glob` for more information: https://vite.dev/guide/features.html#glob-import"
278
278
  };
279
279
  const AstroGlobNoMatch = {
280
280
  name: "AstroGlobNoMatch",
@@ -458,6 +458,11 @@ const UnknownContentCollectionError = {
458
458
  name: "UnknownContentCollectionError",
459
459
  title: "Unknown Content Collection Error."
460
460
  };
461
+ const RenderUndefinedEntryError = {
462
+ name: "RenderUndefinedEntryError",
463
+ title: "Attempted to render an undefined content collection entry.",
464
+ hint: "Check if the entry is undefined before passing it to `render()`"
465
+ };
461
466
  const GetEntryDeprecationError = {
462
467
  name: "GetEntryDeprecationError",
463
468
  title: "Invalid use of `getDataEntryById` or `getEntryBySlug` function.",
@@ -629,6 +634,7 @@ export {
629
634
  PrerenderClientAddressNotAvailable,
630
635
  PrerenderDynamicEndpointPathCollide,
631
636
  RedirectWithNoLocation,
637
+ RenderUndefinedEntryError,
632
638
  ReservedSlotName,
633
639
  ResponseSentError,
634
640
  RewriteWithBodyUsed,
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from "node:url";
2
- import stripAnsi from "strip-ansi";
2
+ import { stripVTControlCharacters } from "node:util";
3
3
  import { isAstroError } from "../errors/errors.js";
4
4
  import { serverShortcuts as formatServerShortcuts } from "../messages.js";
5
5
  import { isLogLevelEnabled } from "./core.js";
@@ -20,7 +20,7 @@ function createViteLogger(astroLogger, viteLogLevel = "info") {
20
20
  hasWarned: false,
21
21
  info(msg) {
22
22
  if (!isLogLevelEnabled(viteLogLevel, "info")) return;
23
- const stripped = stripAnsi(msg);
23
+ const stripped = stripVTControlCharacters(msg);
24
24
  let m;
25
25
  if (m = vitePageReloadMsg.exec(stripped)) {
26
26
  if (isAstroSrcFile(m[1])) return;
@@ -38,7 +38,7 @@ function serverStart({
38
38
  host,
39
39
  base
40
40
  }) {
41
- const version = "4.15.10";
41
+ const version = "4.15.12";
42
42
  const localPrefix = `${dim("\u2503")} Local `;
43
43
  const networkPrefix = `${dim("\u2503")} Network `;
44
44
  const emptyPrefix = " ".repeat(11);
@@ -270,7 +270,7 @@ function printHelp({
270
270
  message.push(
271
271
  linebreak(),
272
272
  ` ${bgGreen(black(` ${commandName} `))} ${green(
273
- `v${"4.15.10"}`
273
+ `v${"4.15.12"}`
274
274
  )} ${headline}`
275
275
  );
276
276
  }
@@ -10,7 +10,8 @@
10
10
  7: (value) => new URL(value),
11
11
  8: (value) => new Uint8Array(value),
12
12
  9: (value) => new Uint16Array(value),
13
- 10: (value) => new Uint32Array(value)
13
+ 10: (value) => new Uint32Array(value),
14
+ 11: (value) => Infinity * value
14
15
  };
15
16
  const reviveTuple = (raw) => {
16
17
  const [type, value] = raw;
@@ -3,5 +3,5 @@
3
3
  * Do not edit this directly, but instead edit that file and rerun the prebuild
4
4
  * to generate this file.
5
5
  */
6
- declare const _default: "(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var l=(i,o,a)=>g(i,typeof o!=\"symbol\"?o+\"\":o,a);{let i={0:t=>y(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t)},o=t=>{let[h,e]=t;return h in i?i[h](e):void 0},a=t=>t.map(o),y=t=>typeof t!=\"object\"||t===null?t:Object.fromEntries(Object.entries(t).map(([h,e])=>[h,o(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,\"Component\");l(this,\"hydrator\");l(this,\"hydrate\",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest(\"astro-island[ssr]\");if(e){e.addEventListener(\"astro:hydrate\",this.hydrate,{once:!0});return}let c=this.querySelectorAll(\"astro-slot\"),n={},p=this.querySelectorAll(\"template[data-astro-template]\");for(let r of p){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"data-astro-template\")||\"default\"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"name\")||\"default\"]=r.innerHTML)}let u;try{u=this.hasAttribute(\"props\")?y(JSON.parse(this.getAttribute(\"props\"))):{}}catch(r){let s=this.getAttribute(\"component-url\")||\"<unknown>\",v=this.getAttribute(\"component-export\");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute(\"props\"),r),r}let d,m=this.hydrator(this);d=performance.now(),await m(this.Component,u,n,{client:this.getAttribute(\"client\")}),d&&this.setAttribute(\"client-render-time\",(performance.now()-d).toString()),this.removeAttribute(\"ssr\"),this.dispatchEvent(new CustomEvent(\"astro:hydrate\"))});l(this,\"unmount\",()=>{this.isConnected||this.dispatchEvent(new CustomEvent(\"astro:unmount\"))})}disconnectedCallback(){document.removeEventListener(\"astro:after-swap\",this.unmount),document.addEventListener(\"astro:after-swap\",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(\"await-children\")||document.readyState===\"interactive\"||document.readyState===\"complete\")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(\"DOMContentLoaded\",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===\"astro:end\"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener(\"DOMContentLoaded\",e)}}async childrenConnectedCallback(){let e=this.getAttribute(\"before-hydration-url\");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute(\"opts\")),c=this.getAttribute(\"client\");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute(\"renderer-url\"),[p,{default:u}]=await Promise.all([import(this.getAttribute(\"component-url\")),n?import(n):()=>()=>{}]),d=this.getAttribute(\"component-export\")||\"default\";if(!d.includes(\".\"))this.Component=p[d];else{this.Component=p;for(let m of d.split(\".\"))this.Component=this.Component[m]}return this.hydrator=u,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute(\"component-url\")}`,n)}}attributeChangedCallback(){this.hydrate()}}l(f,\"observedAttributes\",[\"props\"]),customElements.get(\"astro-island\")||customElements.define(\"astro-island\",f)}})();";
6
+ declare const _default: "(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var l=(i,o,a)=>g(i,typeof o!=\"symbol\"?o+\"\":o,a);{let i={0:t=>y(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[h,e]=t;return h in i?i[h](e):void 0},a=t=>t.map(o),y=t=>typeof t!=\"object\"||t===null?t:Object.fromEntries(Object.entries(t).map(([h,e])=>[h,o(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,\"Component\");l(this,\"hydrator\");l(this,\"hydrate\",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest(\"astro-island[ssr]\");if(e){e.addEventListener(\"astro:hydrate\",this.hydrate,{once:!0});return}let c=this.querySelectorAll(\"astro-slot\"),n={},p=this.querySelectorAll(\"template[data-astro-template]\");for(let r of p){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"data-astro-template\")||\"default\"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"name\")||\"default\"]=r.innerHTML)}let u;try{u=this.hasAttribute(\"props\")?y(JSON.parse(this.getAttribute(\"props\"))):{}}catch(r){let s=this.getAttribute(\"component-url\")||\"<unknown>\",v=this.getAttribute(\"component-export\");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute(\"props\"),r),r}let d,m=this.hydrator(this);d=performance.now(),await m(this.Component,u,n,{client:this.getAttribute(\"client\")}),d&&this.setAttribute(\"client-render-time\",(performance.now()-d).toString()),this.removeAttribute(\"ssr\"),this.dispatchEvent(new CustomEvent(\"astro:hydrate\"))});l(this,\"unmount\",()=>{this.isConnected||this.dispatchEvent(new CustomEvent(\"astro:unmount\"))})}disconnectedCallback(){document.removeEventListener(\"astro:after-swap\",this.unmount),document.addEventListener(\"astro:after-swap\",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(\"await-children\")||document.readyState===\"interactive\"||document.readyState===\"complete\")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(\"DOMContentLoaded\",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===\"astro:end\"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener(\"DOMContentLoaded\",e)}}async childrenConnectedCallback(){let e=this.getAttribute(\"before-hydration-url\");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute(\"opts\")),c=this.getAttribute(\"client\");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute(\"renderer-url\"),[p,{default:u}]=await Promise.all([import(this.getAttribute(\"component-url\")),n?import(n):()=>()=>{}]),d=this.getAttribute(\"component-export\")||\"default\";if(!d.includes(\".\"))this.Component=p[d];else{this.Component=p;for(let m of d.split(\".\"))this.Component=this.Component[m]}return this.hydrator=u,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute(\"component-url\")}`,n)}}attributeChangedCallback(){this.hydrate()}}l(f,\"observedAttributes\",[\"props\"]),customElements.get(\"astro-island\")||customElements.define(\"astro-island\",f)}})();";
7
7
  export default _default;
@@ -1,4 +1,4 @@
1
- var astro_island_prebuilt_dev_default = `(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var l=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>y(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t)},o=t=>{let[h,e]=t;return h in i?i[h](e):void 0},a=t=>t.map(o),y=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([h,e])=>[h,o(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,"Component");l(this,"hydrator");l(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},p=this.querySelectorAll("template[data-astro-template]");for(let r of p){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let u;try{u=this.hasAttribute("props")?y(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=\` (export \${v})\`),console.error(\`[hydrate] Error parsing props for component \${s}\`,this.getAttribute("props"),r),r}let d,m=this.hydrator(this);d=performance.now(),await m(this.Component,u,n,{client:this.getAttribute("client")}),d&&this.setAttribute("client-render-time",(performance.now()-d).toString()),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});l(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(\`astro:\${c}\`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[p,{default:u}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),d=this.getAttribute("component-export")||"default";if(!d.includes("."))this.Component=p[d];else{this.Component=p;for(let m of d.split("."))this.Component=this.Component[m]}return this.hydrator=u,this.hydrate},e,this)}catch(n){console.error(\`[astro-island] Error hydrating \${this.getAttribute("component-url")}\`,n)}}attributeChangedCallback(){this.hydrate()}}l(f,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",f)}})();`;
1
+ var astro_island_prebuilt_dev_default = `(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var l=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>y(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[h,e]=t;return h in i?i[h](e):void 0},a=t=>t.map(o),y=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([h,e])=>[h,o(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,"Component");l(this,"hydrator");l(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},p=this.querySelectorAll("template[data-astro-template]");for(let r of p){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let u;try{u=this.hasAttribute("props")?y(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=\` (export \${v})\`),console.error(\`[hydrate] Error parsing props for component \${s}\`,this.getAttribute("props"),r),r}let d,m=this.hydrator(this);d=performance.now(),await m(this.Component,u,n,{client:this.getAttribute("client")}),d&&this.setAttribute("client-render-time",(performance.now()-d).toString()),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});l(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(\`astro:\${c}\`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[p,{default:u}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),d=this.getAttribute("component-export")||"default";if(!d.includes("."))this.Component=p[d];else{this.Component=p;for(let m of d.split("."))this.Component=this.Component[m]}return this.hydrator=u,this.hydrate},e,this)}catch(n){console.error(\`[astro-island] Error hydrating \${this.getAttribute("component-url")}\`,n)}}attributeChangedCallback(){this.hydrate()}}l(f,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",f)}})();`;
2
2
  export {
3
3
  astro_island_prebuilt_dev_default as default
4
4
  };
@@ -3,5 +3,5 @@
3
3
  * Do not edit this directly, but instead edit that file and rerun the prebuild
4
4
  * to generate this file.
5
5
  */
6
- declare const _default: "(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!=\"symbol\"?o+\"\":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t)},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!=\"object\"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,\"Component\");d(this,\"hydrator\");d(this,\"hydrate\",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest(\"astro-island[ssr]\");if(e){e.addEventListener(\"astro:hydrate\",this.hydrate,{once:!0});return}let c=this.querySelectorAll(\"astro-slot\"),n={},h=this.querySelectorAll(\"template[data-astro-template]\");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"data-astro-template\")||\"default\"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"name\")||\"default\"]=r.innerHTML)}let p;try{p=this.hasAttribute(\"props\")?m(JSON.parse(this.getAttribute(\"props\"))):{}}catch(r){let s=this.getAttribute(\"component-url\")||\"<unknown>\",v=this.getAttribute(\"component-export\");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute(\"props\"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute(\"client\")}),this.removeAttribute(\"ssr\"),this.dispatchEvent(new CustomEvent(\"astro:hydrate\"))});d(this,\"unmount\",()=>{this.isConnected||this.dispatchEvent(new CustomEvent(\"astro:unmount\"))})}disconnectedCallback(){document.removeEventListener(\"astro:after-swap\",this.unmount),document.addEventListener(\"astro:after-swap\",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(\"await-children\")||document.readyState===\"interactive\"||document.readyState===\"complete\")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(\"DOMContentLoaded\",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===\"astro:end\"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener(\"DOMContentLoaded\",e)}}async childrenConnectedCallback(){let e=this.getAttribute(\"before-hydration-url\");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute(\"opts\")),c=this.getAttribute(\"client\");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute(\"renderer-url\"),[h,{default:p}]=await Promise.all([import(this.getAttribute(\"component-url\")),n?import(n):()=>()=>{}]),u=this.getAttribute(\"component-export\")||\"default\";if(!u.includes(\".\"))this.Component=h[u];else{this.Component=h;for(let f of u.split(\".\"))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute(\"component-url\")}`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,\"observedAttributes\",[\"props\"]),customElements.get(\"astro-island\")||customElements.define(\"astro-island\",y)}})();";
6
+ declare const _default: "(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!=\"symbol\"?o+\"\":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!=\"object\"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,\"Component\");d(this,\"hydrator\");d(this,\"hydrate\",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest(\"astro-island[ssr]\");if(e){e.addEventListener(\"astro:hydrate\",this.hydrate,{once:!0});return}let c=this.querySelectorAll(\"astro-slot\"),n={},h=this.querySelectorAll(\"template[data-astro-template]\");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"data-astro-template\")||\"default\"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute(\"name\")||\"default\"]=r.innerHTML)}let p;try{p=this.hasAttribute(\"props\")?m(JSON.parse(this.getAttribute(\"props\"))):{}}catch(r){let s=this.getAttribute(\"component-url\")||\"<unknown>\",v=this.getAttribute(\"component-export\");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute(\"props\"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute(\"client\")}),this.removeAttribute(\"ssr\"),this.dispatchEvent(new CustomEvent(\"astro:hydrate\"))});d(this,\"unmount\",()=>{this.isConnected||this.dispatchEvent(new CustomEvent(\"astro:unmount\"))})}disconnectedCallback(){document.removeEventListener(\"astro:after-swap\",this.unmount),document.addEventListener(\"astro:after-swap\",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(\"await-children\")||document.readyState===\"interactive\"||document.readyState===\"complete\")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener(\"DOMContentLoaded\",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue===\"astro:end\"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener(\"DOMContentLoaded\",e)}}async childrenConnectedCallback(){let e=this.getAttribute(\"before-hydration-url\");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute(\"opts\")),c=this.getAttribute(\"client\");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute(\"renderer-url\"),[h,{default:p}]=await Promise.all([import(this.getAttribute(\"component-url\")),n?import(n):()=>()=>{}]),u=this.getAttribute(\"component-export\")||\"default\";if(!u.includes(\".\"))this.Component=h[u];else{this.Component=h;for(let f of u.split(\".\"))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute(\"component-url\")}`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,\"observedAttributes\",[\"props\"]),customElements.get(\"astro-island\")||customElements.define(\"astro-island\",y)}})();";
7
7
  export default _default;
@@ -1,4 +1,4 @@
1
- var astro_island_prebuilt_default = `(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t)},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,"Component");d(this,"hydrator");d(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},h=this.querySelectorAll("template[data-astro-template]");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let p;try{p=this.hasAttribute("props")?m(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=\` (export \${v})\`),console.error(\`[hydrate] Error parsing props for component \${s}\`,this.getAttribute("props"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});d(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(\`astro:\${c}\`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[h,{default:p}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),u=this.getAttribute("component-export")||"default";if(!u.includes("."))this.Component=h[u];else{this.Component=h;for(let f of u.split("."))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(\`[astro-island] Error hydrating \${this.getAttribute("component-url")}\`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",y)}})();`;
1
+ var astro_island_prebuilt_default = `(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,"Component");d(this,"hydrator");d(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},h=this.querySelectorAll("template[data-astro-template]");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let p;try{p=this.hasAttribute("props")?m(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=\` (export \${v})\`),console.error(\`[hydrate] Error parsing props for component \${s}\`,this.getAttribute("props"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});d(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(\`astro:\${c}\`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[h,{default:p}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),u=this.getAttribute("component-export")||"default";if(!u.includes("."))this.Component=h[u];else{this.Component=h;for(let f of u.split("."))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(\`[astro-island] Error hydrating \${this.getAttribute("component-url")}\`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",y)}})();`;
2
2
  export {
3
3
  astro_island_prebuilt_default as default
4
4
  };
@@ -31,12 +31,21 @@ Found handlers: ${Object.keys(mod).map((exp) => JSON.stringify(exp)).join(", ")}
31
31
  );
32
32
  return new Response(null, { status: 500 });
33
33
  }
34
- const response = await handler.call(mod, context);
34
+ let response = await handler.call(mod, context);
35
35
  if (!response || response instanceof Response === false) {
36
36
  throw new AstroError(EndpointDidNotReturnAResponse);
37
37
  }
38
38
  if (REROUTABLE_STATUS_CODES.includes(response.status)) {
39
- response.headers.set(REROUTE_DIRECTIVE_HEADER, "no");
39
+ try {
40
+ response.headers.set(REROUTE_DIRECTIVE_HEADER, "no");
41
+ } catch (err) {
42
+ if (err.message?.includes("immutable")) {
43
+ response = new Response(response.body, response);
44
+ response.headers.set(REROUTE_DIRECTIVE_HEADER, "no");
45
+ } else {
46
+ throw err;
47
+ }
48
+ }
40
49
  }
41
50
  return response;
42
51
  }
@@ -27,7 +27,7 @@ function renderServerIsland(result, _displayName, props, slots) {
27
27
  delete props[key2];
28
28
  }
29
29
  }
30
- destination.write("<!--server-island-start-->");
30
+ destination.write("<!--[if astro]>server-island-start<![endif]-->");
31
31
  const renderedSlots = {};
32
32
  for (const name in slots) {
33
33
  if (name !== "fallback") {
@@ -63,7 +63,7 @@ if(response.status === 200 && response.headers.get('content-type') === 'text/htm
63
63
  // Swap!
64
64
  while(script.previousSibling &&
65
65
  script.previousSibling.nodeType !== 8 &&
66
- script.previousSibling.data !== 'server-island-start') {
66
+ script.previousSibling.data !== '[if astro]>server-island-start<![endif]') {
67
67
  script.previousSibling.remove();
68
68
  }
69
69
  script.previousSibling?.remove();
@@ -10,7 +10,8 @@ const PROP_TYPE = {
10
10
  URL: 7,
11
11
  Uint8Array: 8,
12
12
  Uint16Array: 9,
13
- Uint32Array: 10
13
+ Uint32Array: 10,
14
+ Infinity: 11
14
15
  };
15
16
  function serializeArray(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) {
16
17
  if (parents.has(value)) {
@@ -76,11 +77,17 @@ function convertToSerializedForm(value, metadata = {}, parents = /* @__PURE__ */
76
77
  default: {
77
78
  if (value !== null && typeof value === "object") {
78
79
  return [PROP_TYPE.Value, serializeObject(value, metadata, parents)];
79
- } else if (value === void 0) {
80
+ }
81
+ if (value === Infinity) {
82
+ return [PROP_TYPE.Infinity, 1];
83
+ }
84
+ if (value === -Infinity) {
85
+ return [PROP_TYPE.Infinity, -1];
86
+ }
87
+ if (value === void 0) {
80
88
  return [PROP_TYPE.Value];
81
- } else {
82
- return [PROP_TYPE.Value, value];
83
89
  }
90
+ return [PROP_TYPE.Value, value];
84
91
  }
85
92
  }
86
93
  }
@@ -37,7 +37,7 @@ function writeHtmlResponse(res, statusCode, html) {
37
37
  res.end();
38
38
  }
39
39
  async function writeWebResponse(res, webResponse) {
40
- const { status, headers, body } = webResponse;
40
+ const { status, headers, body, statusText } = webResponse;
41
41
  const setCookieHeaders = Array.from(getSetCookiesFromResponse(webResponse));
42
42
  if (setCookieHeaders.length) {
43
43
  res.setHeader("set-cookie", setCookieHeaders);
@@ -46,6 +46,7 @@ async function writeWebResponse(res, webResponse) {
46
46
  if (headers.has("set-cookie")) {
47
47
  _headers["set-cookie"] = headers.getSetCookie();
48
48
  }
49
+ res.statusMessage = statusText;
49
50
  res.writeHead(status, _headers);
50
51
  if (body) {
51
52
  if (Symbol.for("astro.responseBody") in webResponse) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "4.15.10",
3
+ "version": "4.15.12",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",
@@ -109,9 +109,9 @@
109
109
  ],
110
110
  "dependencies": {
111
111
  "@astrojs/compiler": "^2.10.3",
112
- "@babel/core": "^7.25.2",
113
- "@babel/plugin-transform-react-jsx": "^7.25.2",
114
- "@babel/types": "^7.25.6",
112
+ "@babel/core": "^7.25.7",
113
+ "@babel/plugin-transform-react-jsx": "^7.25.7",
114
+ "@babel/types": "^7.25.7",
115
115
  "@oslojs/encoding": "^1.1.0",
116
116
  "@rollup/pluginutils": "^5.1.2",
117
117
  "@types/babel__core": "^7.20.5",
@@ -123,7 +123,7 @@
123
123
  "ci-info": "^4.0.0",
124
124
  "clsx": "^2.1.1",
125
125
  "common-ancestor-path": "^1.0.1",
126
- "cookie": "^0.6.0",
126
+ "cookie": "^0.7.2",
127
127
  "cssesc": "^3.0.0",
128
128
  "debug": "^4.3.7",
129
129
  "deterministic-object-hash": "^2.0.2",
@@ -155,9 +155,8 @@
155
155
  "prompts": "^2.4.2",
156
156
  "rehype": "^13.0.2",
157
157
  "semver": "^7.6.3",
158
- "shiki": "^1.21.0",
158
+ "shiki": "^1.22.0",
159
159
  "string-width": "^7.2.0",
160
- "strip-ansi": "^7.1.0",
161
160
  "tinyexec": "^0.3.0",
162
161
  "tsconfck": "^3.1.3",
163
162
  "unist-util-visit": "^5.0.0",
@@ -170,15 +169,15 @@
170
169
  "zod": "^3.23.8",
171
170
  "zod-to-json-schema": "^3.23.3",
172
171
  "zod-to-ts": "^1.2.0",
172
+ "@astrojs/internal-helpers": "0.4.1",
173
173
  "@astrojs/markdown-remark": "5.2.0",
174
- "@astrojs/telemetry": "3.1.0",
175
- "@astrojs/internal-helpers": "0.4.1"
174
+ "@astrojs/telemetry": "3.1.0"
176
175
  },
177
176
  "optionalDependencies": {
178
177
  "sharp": "^0.33.3"
179
178
  },
180
179
  "devDependencies": {
181
- "@astrojs/check": "^0.9.3",
180
+ "@astrojs/check": "^0.9.4",
182
181
  "@playwright/test": "^1.47.2",
183
182
  "@types/aria-query": "^5.0.4",
184
183
  "@types/common-ancestor-path": "^1.0.2",
@@ -197,17 +196,17 @@
197
196
  "cheerio": "1.0.0",
198
197
  "eol": "^0.10.0",
199
198
  "execa": "^8.0.1",
200
- "expect-type": "^0.20.0",
199
+ "expect-type": "^1.0.0",
201
200
  "mdast-util-mdx": "^3.0.0",
202
201
  "mdast-util-mdx-jsx": "^3.1.3",
203
202
  "memfs": "^4.12.0",
204
- "node-mocks-http": "^1.16.0",
203
+ "node-mocks-http": "^1.16.1",
205
204
  "parse-srcset": "^1.0.2",
206
205
  "rehype-autolink-headings": "^7.1.0",
207
206
  "rehype-slug": "^6.0.0",
208
207
  "rehype-toc": "^3.0.2",
209
208
  "remark-code-titles": "^0.1.2",
210
- "rollup": "^4.22.5",
209
+ "rollup": "^4.24.0",
211
210
  "sass": "^1.79.4",
212
211
  "undici": "^6.19.8",
213
212
  "unified": "^11.0.5",
@@ -5,13 +5,17 @@ import {
5
5
  getActionQueryString,
6
6
  } from 'astro:actions';
7
7
 
8
+ const ENCODED_DOT = '%2E';
9
+
8
10
  function toActionProxy(actionCallback = {}, aggregatedPath = '') {
9
11
  return new Proxy(actionCallback, {
10
12
  get(target, objKey) {
11
13
  if (objKey in target || typeof objKey === 'symbol') {
12
14
  return target[objKey];
13
15
  }
14
- const path = aggregatedPath + objKey.toString();
16
+ // Add the key, encoding dots so they're not interpreted as nested properties.
17
+ const path =
18
+ aggregatedPath + encodeURIComponent(objKey.toString()).replaceAll('.', ENCODED_DOT);
15
19
  function action(param) {
16
20
  return handleAction(param, path, this);
17
21
  }