astro 6.0.0-beta.13 → 6.0.0-beta.14

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.
Files changed (47) hide show
  1. package/bin/astro.mjs +1 -1
  2. package/components/Image.astro +2 -2
  3. package/dist/actions/runtime/client.js +2 -4
  4. package/dist/assets/fonts/infra/capsize-font-metrics-resolver.js +1 -1
  5. package/dist/assets/fonts/infra/levenshtein-string-matcher.js +1 -1
  6. package/dist/assets/index.d.ts +1 -1
  7. package/dist/assets/index.js +0 -1
  8. package/dist/assets/services/service.js +5 -5
  9. package/dist/assets/utils/queryParams.js +2 -2
  10. package/dist/cli/add/index.js +1 -1
  11. package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
  12. package/dist/content/content-layer.js +3 -3
  13. package/dist/content/utils.js +2 -2
  14. package/dist/content/vite-plugin-content-virtual-mod.js +1 -0
  15. package/dist/core/app/entrypoints/virtual/dev.js +4 -0
  16. package/dist/core/app/validate-headers.js +3 -1
  17. package/dist/core/build/generate.js +1 -1
  18. package/dist/core/config/schemas/base.js +1 -1
  19. package/dist/core/constants.js +1 -1
  20. package/dist/core/create-vite.js +1 -1
  21. package/dist/core/dev/container.js +1 -1
  22. package/dist/core/dev/dev.js +1 -1
  23. package/dist/core/messages.js +2 -2
  24. package/dist/core/preview/vite-plugin-astro-preview.js +2 -2
  25. package/dist/core/render/paginate.js +1 -1
  26. package/dist/core/routing/rewrite.js +1 -1
  27. package/dist/env/validators.js +1 -1
  28. package/dist/events/session.js +1 -1
  29. package/dist/integrations/features-validation.js +1 -1
  30. package/dist/integrations/hooks.js +1 -1
  31. package/dist/manifest/virtual-module.js +1 -1
  32. package/dist/runtime/client/dev-toolbar/apps/audit/rules/perf.js +3 -3
  33. package/dist/runtime/client/dev-toolbar/apps/utils/icons.js +1 -1
  34. package/dist/runtime/server/astro-island.js +1 -1
  35. package/dist/runtime/server/astro-island.prebuilt-dev.d.ts +1 -1
  36. package/dist/runtime/server/astro-island.prebuilt-dev.js +1 -1
  37. package/dist/runtime/server/astro-island.prebuilt.d.ts +1 -1
  38. package/dist/runtime/server/astro-island.prebuilt.js +1 -1
  39. package/dist/runtime/server/jsx.js +1 -1
  40. package/dist/runtime/server/render/head.js +1 -1
  41. package/dist/runtime/server/render/util.js +1 -1
  42. package/dist/runtime/server/serialize.js +2 -2
  43. package/dist/vite-plugin-adapter-config/index.js +9 -4
  44. package/dist/vite-plugin-app/app.d.ts +5 -0
  45. package/dist/vite-plugin-app/app.js +7 -0
  46. package/dist/vite-plugin-app/createAstroServerApp.js +4 -0
  47. package/package.json +1 -1
package/bin/astro.mjs CHANGED
@@ -19,7 +19,7 @@ const skipSemverCheckIfAbove = IS_STACKBLITZ ? 21 : 23;
19
19
  async function main() {
20
20
  const version = process.versions.node;
21
21
  // Fast-path for higher Node.js versions
22
- if ((parseInt(version) || 0) <= skipSemverCheckIfAbove) {
22
+ if ((Number.parseInt(version) || 0) <= skipSemverCheckIfAbove) {
23
23
  const semver = await import('semver');
24
24
  try {
25
25
  if (!semver.satisfies(version, engines)) {
@@ -17,11 +17,11 @@ if (props.alt === undefined || props.alt === null) {
17
17
 
18
18
  // As a convenience, allow width and height to be string with a number in them, to match HTML's native `img`.
19
19
  if (typeof props.width === 'string') {
20
- props.width = parseInt(props.width);
20
+ props.width = Number.parseInt(props.width);
21
21
  }
22
22
 
23
23
  if (typeof props.height === 'string') {
24
- props.height = parseInt(props.height);
24
+ props.height = Number.parseInt(props.height);
25
25
  }
26
26
 
27
27
  const layout = props.layout ?? imageConfig.layout ?? 'none';
@@ -43,10 +43,8 @@ const codeToStatusMap = {
43
43
  LOOP_DETECTED: 508,
44
44
  NETWORK_AUTHENTICATION_REQUIRED: 511
45
45
  };
46
- const statusToCodeMap = Object.entries(codeToStatusMap).reduce(
47
- // reverse the key-value pairs
48
- (acc, [key, value]) => ({ ...acc, [value]: key }),
49
- {}
46
+ const statusToCodeMap = Object.fromEntries(
47
+ Object.entries(codeToStatusMap).map(([key, value]) => [value, key])
50
48
  );
51
49
  class ActionError extends Error {
52
50
  type = "AstroActionError";
@@ -16,7 +16,7 @@ function filterRequiredMetrics({
16
16
  };
17
17
  }
18
18
  function round(value) {
19
- return parseFloat(value.toFixed(4));
19
+ return Number.parseFloat(value.toFixed(4));
20
20
  }
21
21
  function toPercentString(value) {
22
22
  return `${round(value * 100)}%`;
@@ -125,7 +125,7 @@ class LevenshteinStringMatcher {
125
125
  return this.#myers_x(a, b);
126
126
  }
127
127
  #closest(str, arr) {
128
- let min_distance = Infinity;
128
+ let min_distance = Number.POSITIVE_INFINITY;
129
129
  let min_index = 0;
130
130
  for (let i = 0; i < arr.length; i++) {
131
131
  const dist = this.#distance(str, arr[i]);
@@ -1,3 +1,3 @@
1
1
  export { getConfiguredImageService, getImage } from './internal.js';
2
2
  export { baseService, isLocalService } from './services/service.js';
3
- export { type LocalImageProps, type RemoteImageProps } from './types.js';
3
+ export type { LocalImageProps, RemoteImageProps } from './types.js';
@@ -1,6 +1,5 @@
1
1
  import { getConfiguredImageService, getImage } from "./internal.js";
2
2
  import { baseService, isLocalService } from "./services/service.js";
3
- import {} from "./types.js";
4
3
  export {
5
4
  baseService,
6
5
  getConfiguredImageService,
@@ -11,7 +11,7 @@ function isLocalService(service) {
11
11
  return "transform" in service;
12
12
  }
13
13
  function parseQuality(quality) {
14
- let result = parseInt(quality);
14
+ let result = Number.parseInt(quality);
15
15
  if (Number.isNaN(result)) {
16
16
  return quality;
17
17
  }
@@ -124,7 +124,7 @@ const baseService = {
124
124
  const targetFormat = options.format ?? DEFAULT_OUTPUT_FORMAT;
125
125
  let transformedWidths = (widths ?? []).sort(sortNumeric);
126
126
  let imageWidth = options.width;
127
- let maxWidth = Infinity;
127
+ let maxWidth = Number.POSITIVE_INFINITY;
128
128
  if (isESMImportedImage(options.src)) {
129
129
  imageWidth = options.src.width;
130
130
  maxWidth = imageWidth;
@@ -145,7 +145,7 @@ const baseService = {
145
145
  if (typeof density === "number") {
146
146
  return density;
147
147
  } else {
148
- return parseFloat(density);
148
+ return Number.parseFloat(density);
149
149
  }
150
150
  });
151
151
  const densityWidths = densityValues.sort(sortNumeric).map((density) => Math.round(targetWidth * density));
@@ -209,8 +209,8 @@ const baseService = {
209
209
  }
210
210
  const transform = {
211
211
  src: params.get("href"),
212
- width: params.has("w") ? parseInt(params.get("w")) : void 0,
213
- height: params.has("h") ? parseInt(params.get("h")) : void 0,
212
+ width: params.has("w") ? Number.parseInt(params.get("w")) : void 0,
213
+ height: params.has("h") ? Number.parseInt(params.get("h")) : void 0,
214
214
  format: params.get("f"),
215
215
  quality: params.get("q"),
216
216
  fit: params.get("fit"),
@@ -6,8 +6,8 @@ function getOrigQueryParams(params) {
6
6
  return void 0;
7
7
  }
8
8
  return {
9
- width: parseInt(width),
10
- height: parseInt(height),
9
+ width: Number.parseInt(width),
10
+ height: Number.parseInt(height),
11
11
  format
12
12
  };
13
13
  }
@@ -692,7 +692,7 @@ async function tryToInstallIntegrations({
692
692
  logger.debug("add", `package manager: "${packageManager?.name}"`);
693
693
  if (!packageManager) return 0 /* none */;
694
694
  const inheritedFlags = Object.entries(flags).map(([flag]) => {
695
- if (flag == "_") return;
695
+ if (flag === "_") return;
696
696
  if (INHERITED_FLAGS.has(flag)) {
697
697
  if (flag.length === 1) return `-${flag}`;
698
698
  return `--${flag}`;
@@ -1,6 +1,6 @@
1
1
  class BuildTimeAstroVersionProvider {
2
2
  // Injected during the build through esbuild define
3
- version = "6.0.0-beta.13";
3
+ version = "6.0.0-beta.14";
4
4
  }
5
5
  export {
6
6
  BuildTimeAstroVersionProvider
@@ -181,7 +181,7 @@ ${contentConfig.error.message}`
181
181
  logger.info("Content config changed");
182
182
  shouldClear = true;
183
183
  }
184
- if (previousAstroVersion && previousAstroVersion !== "6.0.0-beta.13") {
184
+ if (previousAstroVersion && previousAstroVersion !== "6.0.0-beta.14") {
185
185
  logger.info("Astro version changed");
186
186
  shouldClear = true;
187
187
  }
@@ -189,8 +189,8 @@ ${contentConfig.error.message}`
189
189
  logger.info("Clearing content store");
190
190
  this.#store.clearAll();
191
191
  }
192
- if ("6.0.0-beta.13") {
193
- await this.#store.metaStore().set("astro-version", "6.0.0-beta.13");
192
+ if ("6.0.0-beta.14") {
193
+ await this.#store.metaStore().set("astro-version", "6.0.0-beta.14");
194
194
  }
195
195
  if (currentConfigDigest) {
196
196
  await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
@@ -176,10 +176,10 @@ async function getEntryData(entry, collectionConfig, shouldEmitFile, pluginConte
176
176
  return data;
177
177
  }
178
178
  function getContentEntryExts(settings) {
179
- return settings.contentEntryTypes.map((t) => t.extensions).flat();
179
+ return settings.contentEntryTypes.flatMap((t) => t.extensions);
180
180
  }
181
181
  function getDataEntryExts(settings) {
182
- return settings.dataEntryTypes.map((t) => t.extensions).flat();
182
+ return settings.dataEntryTypes.flatMap((t) => t.extensions);
183
183
  }
184
184
  function getEntryConfigByExtMap(entryTypes) {
185
185
  const map = /* @__PURE__ */ new Map();
@@ -30,6 +30,7 @@ function invalidateDataStore(viteServer) {
30
30
  const timestamp = Date.now();
31
31
  environment.moduleGraph.invalidateModule(module, void 0, timestamp, true);
32
32
  }
33
+ environment.hot.send("astro:content-changed", {});
33
34
  viteServer.environments.client.hot.send({
34
35
  type: "full-reload",
35
36
  path: "*"
@@ -19,6 +19,10 @@ const createApp = ({ streaming } = {}) => {
19
19
  ${e}`);
20
20
  }
21
21
  });
22
+ import.meta.hot.on("astro:content-changed", () => {
23
+ if (!currentDevApp) return;
24
+ currentDevApp.pipeline.routeCache.clearAll();
25
+ });
22
26
  }
23
27
  return currentDevApp;
24
28
  };
@@ -39,7 +39,9 @@ function validateForwardedHeaders(forwardedProtocol, forwardedHost, forwardedPor
39
39
  if (hasProtocolPatterns) {
40
40
  try {
41
41
  const testUrl = new URL(`${forwardedProtocol}://example.com`);
42
- const isAllowed = allowedDomains.some((pattern) => matchPattern(testUrl, pattern));
42
+ const isAllowed = allowedDomains.some(
43
+ (pattern) => matchPattern(testUrl, { protocol: pattern.protocol })
44
+ );
43
45
  if (isAllowed) {
44
46
  result.protocol = forwardedProtocol;
45
47
  }
@@ -181,7 +181,7 @@ async function generatePathWithPrerenderer(prerenderer, pathname, route, options
181
181
  if (routeData.pattern.test(pathname)) {
182
182
  if (routeData.params && routeData.params.length !== 0) {
183
183
  if (routeData.distURL && !routeData.distURL.find(
184
- (url2) => url2.href.replace(config.outDir.toString(), "").replace(/(?:\/index\.html|\.html)$/, "") == trimSlashes(pathname)
184
+ (url2) => url2.href.replace(config.outDir.toString(), "").replace(/(?:\/index\.html|\.html)$/, "") === trimSlashes(pathname)
185
185
  )) {
186
186
  return false;
187
187
  }
@@ -80,7 +80,7 @@ const AstroConfigSchema = z.object({
80
80
  adapter: z.object({ name: z.string(), hooks: z.object({}).passthrough().default({}) }).optional(),
81
81
  integrations: z.preprocess(
82
82
  // preprocess
83
- (val) => Array.isArray(val) ? val.flat(Infinity).filter(Boolean) : val,
83
+ (val) => Array.isArray(val) ? val.flat(Number.POSITIVE_INFINITY).filter(Boolean) : val,
84
84
  // validate
85
85
  z.array(z.object({ name: z.string(), hooks: z.object({}).passthrough().default({}) })).default(ASTRO_CONFIG_DEFAULTS.integrations)
86
86
  ),
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "6.0.0-beta.13";
1
+ const ASTRO_VERSION = "6.0.0-beta.14";
2
2
  const ASTRO_GENERATOR = `Astro v${ASTRO_VERSION}`;
3
3
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
4
4
  const REWRITE_DIRECTIVE_HEADER_KEY = "X-Astro-Rewrite";
@@ -208,7 +208,7 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
208
208
  { ...settings.config.vite, mode },
209
209
  { command: command === "dev" ? "serve" : command, mode }
210
210
  ];
211
- plugins = plugins.flat(Infinity).filter((p) => {
211
+ plugins = plugins.flat(Number.POSITIVE_INFINITY).filter((p) => {
212
212
  if (!p || p?.apply === applyToFilter) {
213
213
  return false;
214
214
  }
@@ -27,7 +27,7 @@ async function createContainer({
27
27
  base,
28
28
  server: { host, headers, open: serverOpen, allowedHosts }
29
29
  } = settings.config;
30
- const isServerOpenURL = typeof serverOpen == "string" && !isRestart;
30
+ const isServerOpenURL = typeof serverOpen === "string" && !isRestart;
31
31
  const isServerOpenBoolean = serverOpen && !isRestart;
32
32
  const open = isServerOpenURL ? serverOpen : isServerOpenBoolean ? base : false;
33
33
  const rendererClientEntries = settings.renderers.map((r) => r.clientEntrypoint).filter(Boolean);
@@ -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 = "6.0.0-beta.13";
25
+ const currentVersion = "6.0.0-beta.14";
26
26
  const isPrerelease = currentVersion.includes("-");
27
27
  if (!isPrerelease) {
28
28
  try {
@@ -28,7 +28,7 @@ function serverStart({
28
28
  host,
29
29
  base
30
30
  }) {
31
- const version = "6.0.0-beta.13";
31
+ const version = "6.0.0-beta.14";
32
32
  const localPrefix = `${dim("\u2503")} Local `;
33
33
  const networkPrefix = `${dim("\u2503")} Network `;
34
34
  const emptyPrefix = " ".repeat(11);
@@ -265,7 +265,7 @@ function printHelp({
265
265
  message.push(
266
266
  linebreak(),
267
267
  ` ${bgGreen(black(` ${commandName} `))} ${green(
268
- `v${"6.0.0-beta.13"}`
268
+ `v${"6.0.0-beta.14"}`
269
269
  )} ${headline}`
270
270
  );
271
271
  }
@@ -31,12 +31,12 @@ function vitePluginAstroPreview(settings) {
31
31
  const isRoot = pathname === "/";
32
32
  if (!isRoot) {
33
33
  const hasTrailingSlash = pathname.endsWith("/");
34
- if (hasTrailingSlash && trailingSlash == "never") {
34
+ if (hasTrailingSlash && trailingSlash === "never") {
35
35
  res.statusCode = 404;
36
36
  res.end(notFoundTemplate(pathname, 'Not Found (trailingSlash is set to "never")'));
37
37
  return;
38
38
  }
39
- if (!hasTrailingSlash && trailingSlash == "always" && !HAS_FILE_EXTENSION_REGEXP.test(pathname)) {
39
+ if (!hasTrailingSlash && trailingSlash === "always" && !HAS_FILE_EXTENSION_REGEXP.test(pathname)) {
40
40
  res.statusCode = 404;
41
41
  res.end(notFoundTemplate(pathname, 'Not Found (trailingSlash is set to "always")'));
42
42
  return;
@@ -23,7 +23,7 @@ function generatePaginateFunction(routeMatch, base, trailingSlash) {
23
23
  const lastPage = Math.max(1, Math.ceil(data.length / pageSize));
24
24
  const result = [...Array(lastPage).keys()].map((num) => {
25
25
  const pageNum = num + 1;
26
- const start = pageSize === Infinity ? 0 : (pageNum - 1) * pageSize;
26
+ const start = pageSize === Number.POSITIVE_INFINITY ? 0 : (pageNum - 1) * pageSize;
27
27
  const end = Math.min(start + pageSize, data.length);
28
28
  const params = {
29
29
  ...additionalParams,
@@ -58,7 +58,7 @@ function findRouteToRewrite({
58
58
  if (route.pattern.test(decodedPathname)) {
59
59
  if (route.params && route.params.length !== 0 && route.distURL && route.distURL.length !== 0) {
60
60
  if (!route.distURL.find(
61
- (url) => url.href.replace(outDir.toString(), "").replace(/(?:\/index\.html|\.html)$/, "") == trimSlashes(pathname)
61
+ (url) => url.href.replace(outDir.toString(), "").replace(/(?:\/index\.html|\.html)$/, "") === trimSlashes(pathname)
62
62
  )) {
63
63
  continue;
64
64
  }
@@ -49,7 +49,7 @@ const stringValidator = ({ max, min, length, url, includes, startsWith, endsWith
49
49
  };
50
50
  };
51
51
  const numberValidator = ({ gt, min, lt, max, int }) => (input) => {
52
- const num = parseFloat(input ?? "");
52
+ const num = Number.parseFloat(input ?? "");
53
53
  if (isNaN(num)) {
54
54
  return {
55
55
  ok: false,
@@ -64,7 +64,7 @@ function createAnonymousConfigInfo(userConfig) {
64
64
  return configInfo;
65
65
  }
66
66
  function eventCliSession(cliCommand, userConfig, flags) {
67
- const cliFlags = flags ? Object.keys(flags).filter((name) => name != "_") : void 0;
67
+ const cliFlags = flags ? Object.keys(flags).filter((name) => name !== "_") : void 0;
68
68
  const payload = {
69
69
  cliCommand,
70
70
  config: createAnonymousConfigInfo(userConfig),
@@ -27,7 +27,7 @@ function validateSupportedFeatures(adapterName, featureMap, settings, logger) {
27
27
  adapterName,
28
28
  logger,
29
29
  "hybridOutput",
30
- () => settings.config.output == "static" && settings.buildOutput === "server"
30
+ () => settings.config.output === "static" && settings.buildOutput === "server"
31
31
  );
32
32
  validationResult.serverOutput = validateSupportKind(
33
33
  serverOutput,
@@ -220,7 +220,7 @@ async function runHookConfigSetup({
220
220
  }
221
221
  };
222
222
  function addPageExtension(...input) {
223
- const exts = input.flat(Infinity).map(
223
+ const exts = input.flat(Number.POSITIVE_INFINITY).map(
224
224
  (ext) => `.${ext.replace(/^\./, "")}`
225
225
  );
226
226
  updatedSettings.pageExtensions.push(...exts);
@@ -62,7 +62,7 @@ export { base, i18n, trailingSlash, site, compressHTML, build, image };
62
62
  `;
63
63
  return { code };
64
64
  }
65
- if (id == RESOLVED_VIRTUAL_SERVER_ID) {
65
+ if (id === RESOLVED_VIRTUAL_SERVER_ID) {
66
66
  if (this.environment.name === ASTRO_VITE_ENVIRONMENT_NAMES.client) {
67
67
  throw new AstroError({
68
68
  ...AstroErrorData.ServerOnlyModule,
@@ -79,7 +79,7 @@ const perf = [
79
79
  match(element) {
80
80
  const serverRenderTime = element.getAttribute("server-render-time");
81
81
  if (!serverRenderTime) return false;
82
- const renderingTime = parseFloat(serverRenderTime);
82
+ const renderingTime = Number.parseFloat(serverRenderTime);
83
83
  if (Number.isNaN(renderingTime)) return false;
84
84
  return renderingTime > 500;
85
85
  }
@@ -94,7 +94,7 @@ const perf = [
94
94
  match(element) {
95
95
  const clientRenderTime = element.getAttribute("client-render-time");
96
96
  if (!clientRenderTime) return false;
97
- const renderingTime = parseFloat(clientRenderTime);
97
+ const renderingTime = Number.parseFloat(clientRenderTime);
98
98
  if (Number.isNaN(renderingTime)) return false;
99
99
  return renderingTime > 500;
100
100
  }
@@ -102,7 +102,7 @@ const perf = [
102
102
  ];
103
103
  function getCleanRenderingTime(time) {
104
104
  if (!time) return "unknown";
105
- const renderingTime = parseFloat(time);
105
+ const renderingTime = Number.parseFloat(time);
106
106
  if (Number.isNaN(renderingTime)) return "unknown";
107
107
  return renderingTime.toFixed(2) + "s";
108
108
  }
@@ -13,7 +13,7 @@ const categoryIcons = new Map(
13
13
  })
14
14
  );
15
15
  function iconForIntegration(integration) {
16
- const icons = integration.categories.filter((category) => categoryIcons.has(category)).map((category) => categoryIcons.get(category)).flat();
16
+ const icons = integration.categories.filter((category) => categoryIcons.has(category)).flatMap((category) => categoryIcons.get(category));
17
17
  return randomFromArray(icons);
18
18
  }
19
19
  const iconColors = [
@@ -11,7 +11,7 @@
11
11
  8: (value) => new Uint8Array(value),
12
12
  9: (value) => new Uint16Array(value),
13
13
  10: (value) => new Uint32Array(value),
14
- 11: (value) => Infinity * value
14
+ 11: (value) => Number.POSITIVE_INFINITY * value
15
15
  };
16
16
  const reviveTuple = (raw) => {
17
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),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)}})();";
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=>Number.POSITIVE_INFINITY*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),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)}})();`;
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=>Number.POSITIVE_INFINITY*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),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)}})();";
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=>Number.POSITIVE_INFINITY*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),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)}})();`;
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=>Number.POSITIVE_INFINITY*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
  };
@@ -160,7 +160,7 @@ Did you forget to import the component or is it possible there is a typo?`);
160
160
  async function renderElement(result, tag, { children, ...props }) {
161
161
  return markHTMLString(
162
162
  `<${tag}${spreadAttributes(props)}${markHTMLString(
163
- (children == null || children == "") && voidElementNames.test(tag) ? `/>` : `>${children == null ? "" : await renderJSX(result, prerenderElementChildren(tag, children))}</${tag}>`
163
+ (children == null || children === "") && voidElementNames.test(tag) ? `/>` : `>${children == null ? "" : await renderJSX(result, prerenderElementChildren(tag, children))}</${tag}>`
164
164
  )}`
165
165
  );
166
166
  }
@@ -5,7 +5,7 @@ import { renderElement } from "./util.js";
5
5
  const uniqueElements = (item, index, all) => {
6
6
  const props = JSON.stringify(item.props);
7
7
  const children = item.children;
8
- return index === all.findIndex((i) => JSON.stringify(i.props) === props && i.children == children);
8
+ return index === all.findIndex((i) => JSON.stringify(i.props) === props && i.children === children);
9
9
  };
10
10
  function renderAllHeadContent(result) {
11
11
  result._metadata.hasRenderedHead = true;
@@ -111,7 +111,7 @@ function renderElement(name, { props: _props, children = "" }, shouldEscape = tr
111
111
  children = defineScriptVars(defineVars) + "\n" + children;
112
112
  }
113
113
  }
114
- if ((children == null || children == "") && voidElementNames.test(name)) {
114
+ if ((children == null || children === "") && voidElementNames.test(name)) {
115
115
  return `<${name}${internalSpreadAttributes(props, shouldEscape, name)}>`;
116
116
  }
117
117
  return `<${name}${internalSpreadAttributes(props, shouldEscape, name)}>${children}</${name}>`;
@@ -78,10 +78,10 @@ function convertToSerializedForm(value, metadata = {}, parents = /* @__PURE__ */
78
78
  if (value !== null && typeof value === "object") {
79
79
  return [PROP_TYPE.Value, serializeObject(value, metadata, parents)];
80
80
  }
81
- if (value === Infinity) {
81
+ if (value === Number.POSITIVE_INFINITY) {
82
82
  return [PROP_TYPE.Infinity, 1];
83
83
  }
84
- if (value === -Infinity) {
84
+ if (value === Number.NEGATIVE_INFINITY) {
85
85
  return [PROP_TYPE.Infinity, -1];
86
86
  }
87
87
  if (value === void 0) {
@@ -1,5 +1,6 @@
1
1
  import { isAstroServerEnvironment } from "../environments.js";
2
2
  import { fileURLToPath } from "node:url";
3
+ import { ASTRO_VITE_ENVIRONMENT_NAMES } from "../core/constants.js";
3
4
  const VIRTUAL_CLIENT_ID = "virtual:astro:adapter-config/client";
4
5
  const RESOLVED_VIRTUAL_CLIENT_ID = "\0" + VIRTUAL_CLIENT_ID;
5
6
  function vitePluginAdapterConfig(settings) {
@@ -9,10 +10,14 @@ function vitePluginAdapterConfig(settings) {
9
10
  const { adapter } = settings;
10
11
  if (adapter && adapter.entrypointResolution === "auto" && adapter.serverEntrypoint) {
11
12
  return {
12
- build: {
13
- rollupOptions: {
14
- input: {
15
- index: typeof adapter.serverEntrypoint === "string" ? adapter.serverEntrypoint : fileURLToPath(adapter.serverEntrypoint)
13
+ environments: {
14
+ [ASTRO_VITE_ENVIRONMENT_NAMES.ssr]: {
15
+ build: {
16
+ rollupOptions: {
17
+ input: {
18
+ index: typeof adapter.serverEntrypoint === "string" ? adapter.serverEntrypoint : fileURLToPath(adapter.serverEntrypoint)
19
+ }
20
+ }
16
21
  }
17
22
  }
18
23
  }
@@ -22,6 +22,11 @@ export declare class AstroServerApp extends BaseApp<RunnablePipeline> {
22
22
  * Called via HMR when new pages are added/removed.
23
23
  */
24
24
  updateRoutes(newRoutesList: RoutesList): void;
25
+ /**
26
+ * Clears the route cache so that getStaticPaths() is re-evaluated.
27
+ * Called via HMR when content collection data changes.
28
+ */
29
+ clearRouteCache(): void;
25
30
  devMatch(pathname: string): Promise<DevMatch | undefined>;
26
31
  static create(manifest: SSRManifest, routesList: RoutesList, logger: Logger, loader: ModuleLoader, settings: AstroSettings, getDebugInfo: () => Promise<string>): Promise<AstroServerApp>;
27
32
  createPipeline(_streaming: boolean, manifest: SSRManifest, settings: AstroSettings, logger: Logger, loader: ModuleLoader, manifestData: RoutesList, getDebugInfo: () => Promise<string>): RunnablePipeline;
@@ -41,6 +41,13 @@ class AstroServerApp extends BaseApp {
41
41
  this.pipeline.setManifestData(newRoutesList);
42
42
  ensure404Route(this.manifestData);
43
43
  }
44
+ /**
45
+ * Clears the route cache so that getStaticPaths() is re-evaluated.
46
+ * Called via HMR when content collection data changes.
47
+ */
48
+ clearRouteCache() {
49
+ this.pipeline.clearRouteCache();
50
+ }
44
51
  async devMatch(pathname) {
45
52
  const matchedRoute = await matchRoute(
46
53
  pathname,
@@ -54,6 +54,10 @@ async function createAstroServerApp(controller, settings, loader, logger) {
54
54
  ${e}`);
55
55
  }
56
56
  });
57
+ import.meta.hot.on("astro:content-changed", () => {
58
+ app.clearRouteCache();
59
+ actualLogger.debug("router", "Route cache cleared due to content change");
60
+ });
57
61
  }
58
62
  return {
59
63
  handler(incomingRequest, incomingResponse) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "6.0.0-beta.13",
3
+ "version": "6.0.0-beta.14",
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",