astro 7.3.0 → 7.3.2

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.
@@ -94,11 +94,14 @@ const addStaticImageFactory = (settings) => {
94
94
  };
95
95
  const RUNTIME_LOGGER_SETUP = `
96
96
  import { createConsoleLogger as _createConsoleLogger } from "astro/logger/console";
97
- import { astroToRuntimeLogger as _astroToRuntimeLogger } from "astro/_internal/logger";
98
97
  import _loggerDestination, { level as _loggerLevel } from "virtual:astro:logger";
99
98
  const _astroLogger = _createConsoleLogger({ level: _loggerLevel });
100
99
  if (_loggerDestination) _astroLogger.setDestination(_loggerDestination);
101
- const _runtimeLogger = _astroToRuntimeLogger(_astroLogger);
100
+ const _runtimeLogger = {
101
+ info: (message) => _astroLogger.info(null, message),
102
+ warn: (message) => _astroLogger.warn(null, message),
103
+ error: (message) => _astroLogger.error(null, message),
104
+ };
102
105
  `;
103
106
  const CLIENT_RUNTIME_LOGGER_SETUP = `
104
107
  const _runtimeLogger = {
@@ -1,6 +1,6 @@
1
1
  class BuildTimeAstroVersionProvider {
2
2
  // Injected during the build through esbuild define
3
- version = "7.3.0";
3
+ version = "7.3.2";
4
4
  }
5
5
  export {
6
6
  BuildTimeAstroVersionProvider
@@ -196,7 +196,7 @@ ${contentConfig.error.message}`
196
196
  logger.info("Content config changed");
197
197
  shouldClear = true;
198
198
  }
199
- if (previousAstroVersion && previousAstroVersion !== "7.3.0") {
199
+ if (previousAstroVersion && previousAstroVersion !== "7.3.2") {
200
200
  logger.info("Astro version changed");
201
201
  shouldClear = true;
202
202
  }
@@ -204,8 +204,8 @@ ${contentConfig.error.message}`
204
204
  logger.info("Clearing content store");
205
205
  this.#store.clearAll();
206
206
  }
207
- if ("7.3.0") {
208
- this.#store.metaStore().set("astro-version", "7.3.0");
207
+ if ("7.3.2") {
208
+ this.#store.metaStore().set("astro-version", "7.3.2");
209
209
  }
210
210
  if (currentConfigDigest) {
211
211
  this.#store.metaStore().set("content-config-digest", currentConfigDigest);
@@ -1,4 +1,4 @@
1
- import fetchable from "virtual:astro:fetchable";
1
+ import fetchable, { isDefaultFetchHandler } from "virtual:astro:fetchable";
2
2
  import { manifest } from "virtual:astro:manifest";
3
3
  import { clearActions } from "../../../../actions/load.js";
4
4
  import { createNonRunnableEnvironment } from "../../../environment/dev-nonrunnable.js";
@@ -14,7 +14,9 @@ const createApp = ({ streaming } = {}) => {
14
14
  setLogger(manifest, createConsoleLogger({ level: manifest.logLevel }));
15
15
  setEnvironment(manifest, createNonRunnableEnvironment());
16
16
  const app = new DevFacadeApp(manifest, streaming);
17
- app.setFetchHandler(fetchable);
17
+ if (!isDefaultFetchHandler) {
18
+ app.setFetchHandler(fetchable);
19
+ }
18
20
  if (import.meta.hot && !hmrWired) {
19
21
  hmrWired = true;
20
22
  import.meta.hot.on("astro:routes-updated", async () => {
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "7.3.0";
1
+ const ASTRO_VERSION = "7.3.2";
2
2
  const ASTRO_GENERATOR = `Astro v${ASTRO_VERSION}`;
3
3
  const ASTRO_ERROR_HEADER = "X-Astro-Error";
4
4
  const DEFAULT_404_COMPONENT = "astro-default-404.astro";
@@ -26,7 +26,7 @@ async function dev(inlineConfig) {
26
26
  await telemetry.record([]);
27
27
  const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
28
28
  const logger = restart.container.logger;
29
- const currentVersion = "7.3.0";
29
+ const currentVersion = "7.3.2";
30
30
  const isPrerelease = currentVersion.includes("-");
31
31
  if (!isPrerelease) {
32
32
  try {
@@ -270,7 +270,7 @@ function printHelp({
270
270
  message.push(
271
271
  linebreak(),
272
272
  ` ${bgGreen(black(` ${commandName} `))} ${green(
273
- `v${"7.3.0"}`
273
+ `v${"7.3.2"}`
274
274
  )} ${headline}`
275
275
  );
276
276
  }
@@ -1,15 +1,6 @@
1
1
  import { getPathByLocale } from "./index.js";
2
2
  function computeFallbackRoute(options) {
3
- const {
4
- pathname,
5
- responseStatus,
6
- fallback,
7
- fallbackType,
8
- locales,
9
- defaultLocale,
10
- strategy,
11
- base
12
- } = options;
3
+ const { pathname, responseStatus, fallback, fallbackType, locales, defaultLocale, strategy } = options;
13
4
  if (responseStatus !== 404) {
14
5
  return { type: "none" };
15
6
  }
@@ -38,15 +29,14 @@ function computeFallbackRoute(options) {
38
29
  }
39
30
  const fallbackLocale = fallback[urlLocale];
40
31
  const pathFallbackLocale = getPathByLocale(fallbackLocale, locales);
32
+ const localeIndex = segments.indexOf(urlLocale);
41
33
  let newPathname;
42
34
  if (pathFallbackLocale === defaultLocale && strategy === "pathname-prefix-other-locales") {
43
- if (pathname.includes(`${base}`)) {
44
- newPathname = pathname.replace(`/${urlLocale}`, ``);
45
- } else {
46
- newPathname = pathname.replace(`/${urlLocale}`, `/`);
47
- }
35
+ segments.splice(localeIndex, 1);
36
+ newPathname = segments.join("/") || "/";
48
37
  } else {
49
- newPathname = pathname.replace(`/${urlLocale}`, `/${pathFallbackLocale}`);
38
+ segments[localeIndex] = pathFallbackLocale;
39
+ newPathname = segments.join("/");
50
40
  }
51
41
  return {
52
42
  type: fallbackType,
@@ -1,4 +1,5 @@
1
1
  import { AstroJSX, isVNode } from "../../jsx-runtime/index.js";
2
+ import { escapeStyleText } from "./escape.js";
2
3
  import {
3
4
  escapeHTML,
4
5
  HTMLString,
@@ -166,11 +167,10 @@ async function renderElement(result, tag, { children, ...props }) {
166
167
  );
167
168
  }
168
169
  function prerenderElementChildren(tag, children) {
169
- if (typeof children === "string" && (tag === "style" || tag === "script")) {
170
- return markHTMLString(children);
171
- } else {
172
- return children;
170
+ if (typeof children === "string" && tag === "style") {
171
+ return markHTMLString(escapeStyleText(children));
173
172
  }
173
+ return children;
174
174
  }
175
175
  export {
176
176
  renderJSX
@@ -1,5 +1,11 @@
1
1
  import { isVNode } from "../../../jsx-runtime/index.js";
2
- import { escapeHTML, HTMLString, isHTMLString, markHTMLString } from "../escape.js";
2
+ import {
3
+ escapeHTML,
4
+ escapeStyleText,
5
+ HTMLString,
6
+ isHTMLString,
7
+ markHTMLString
8
+ } from "../escape.js";
3
9
  import { spreadAttributes } from "../index.js";
4
10
  import { isPromise } from "../util.js";
5
11
  import { renderJSX } from "../jsx.js";
@@ -125,8 +131,8 @@ Did you forget to import the component or is it possible there is a typo?`
125
131
  stack.push(markHTMLString(`</${type}>`));
126
132
  }
127
133
  if (!isVoid && children != null && children !== "") {
128
- if (typeof children === "string" && (type === "style" || type === "script")) {
129
- stack.push(markHTMLString(children));
134
+ if (typeof children === "string" && type === "style") {
135
+ stack.push(markHTMLString(escapeStyleText(children)));
130
136
  } else {
131
137
  stack.push(children);
132
138
  }
@@ -67,8 +67,13 @@ function vitePluginEnvironment({
67
67
  "astro/runtime/client/dev-toolbar/entrypoint.js"
68
68
  ],
69
69
  exclude: ["astro:*", "virtual:astro:*", "astro/virtual-modules/prefetch.js"],
70
- // Astro files can't be rendered on the client
71
- entries: [`${srcDirPattern}**/*.{jsx,tsx,vue,svelte,html}`]
70
+ // .astro files can't be rendered on the client, but Vite's dep
71
+ // scanner extracts their <script> tags to discover client-side
72
+ // imports. Without .astro here, deps reachable only through
73
+ // <script> (e.g. workspace packages and their transitive deps)
74
+ // are missed during the initial scan, causing late re-optimization
75
+ // that 504s already-served modules like the dev toolbar.
76
+ entries: [`${srcDirPattern}**/*.{jsx,tsx,vue,svelte,html,astro}`]
72
77
  };
73
78
  }
74
79
  return finalEnvironmentOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "7.3.0",
3
+ "version": "7.3.2",
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",
@@ -154,7 +154,7 @@
154
154
  "yargs-parser": "^22.0.0",
155
155
  "zod": "^4.5.4",
156
156
  "@astrojs/internal-helpers": "0.11.0",
157
- "@astrojs/markdown-satteri": "0.4.0",
157
+ "@astrojs/markdown-satteri": "0.4.1",
158
158
  "@astrojs/telemetry": "3.3.3"
159
159
  },
160
160
  "optionalDependencies": {
@@ -194,7 +194,7 @@
194
194
  "undici": "^7.22.0",
195
195
  "vitest": "^4.1.0",
196
196
  "@astrojs/check": "0.9.10",
197
- "@astrojs/markdown-remark": "7.3.0",
197
+ "@astrojs/markdown-remark": "7.3.1",
198
198
  "astro-scripts": "0.0.14"
199
199
  },
200
200
  "engines": {