astro 3.2.1 → 3.2.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.
@@ -1967,7 +1967,7 @@ export interface SSRMetadata {
1967
1967
  hasRenderedHead: boolean;
1968
1968
  headInTree: boolean;
1969
1969
  extraHead: string[];
1970
- propagators: Map<AstroComponentFactory, AstroComponentInstance>;
1970
+ propagators: Set<AstroComponentInstance>;
1971
1971
  }
1972
1972
  export interface PreviewServer {
1973
1973
  host?: string;
@@ -49,7 +49,7 @@ function astroContentAssetPropagationPlugin({
49
49
  if (!devModuleLoader.getModuleById(basePath)?.ssrModule) {
50
50
  await devModuleLoader.import(basePath);
51
51
  }
52
- const { stylesMap, urls } = await getStylesForURL(
52
+ const { styles, urls } = await getStylesForURL(
53
53
  pathToFileURL(basePath),
54
54
  devModuleLoader,
55
55
  "development"
@@ -60,7 +60,7 @@ function astroContentAssetPropagationPlugin({
60
60
  devModuleLoader
61
61
  );
62
62
  stringifiedLinks = JSON.stringify([...urls]);
63
- stringifiedStyles = JSON.stringify([...stylesMap.values()]);
63
+ stringifiedStyles = JSON.stringify(styles.map((s) => s.content));
64
64
  stringifiedScripts = JSON.stringify([...hoistedScripts]);
65
65
  } else {
66
66
  stringifiedLinks = JSON.stringify(LINKS_PLACEHOLDER);
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "3.2.1";
1
+ const ASTRO_VERSION = "3.2.2";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -20,7 +20,7 @@ async function dev(inlineConfig) {
20
20
  base: restart.container.settings.config.base
21
21
  })
22
22
  );
23
- const currentVersion = "3.2.1";
23
+ const currentVersion = "3.2.2";
24
24
  if (currentVersion.includes("-")) {
25
25
  logger.warn(null, msg.prerelease({ currentVersion }));
26
26
  }
@@ -50,7 +50,7 @@ function serverStart({
50
50
  base,
51
51
  isRestart = false
52
52
  }) {
53
- const version = "3.2.1";
53
+ const version = "3.2.2";
54
54
  const localPrefix = `${dim("\u2503")} Local `;
55
55
  const networkPrefix = `${dim("\u2503")} Network `;
56
56
  const emptyPrefix = " ".repeat(11);
@@ -235,7 +235,7 @@ function printHelp({
235
235
  message.push(
236
236
  linebreak(),
237
237
  ` ${bgGreen(black(` ${commandName} `))} ${green(
238
- `v${"3.2.1"}`
238
+ `v${"3.2.2"}`
239
239
  )} ${headline}`
240
240
  );
241
241
  }
@@ -156,7 +156,7 @@ function createResult(args) {
156
156
  hasDirectives: /* @__PURE__ */ new Set(),
157
157
  headInTree: false,
158
158
  extraHead: [],
159
- propagators: /* @__PURE__ */ new Map()
159
+ propagators: /* @__PURE__ */ new Set()
160
160
  }
161
161
  };
162
162
  return result;
@@ -55,8 +55,8 @@ function validateComponentProps(props, displayName) {
55
55
  function createAstroComponentInstance(result, displayName, factory, props, slots = {}) {
56
56
  validateComponentProps(props, displayName);
57
57
  const instance = new AstroComponentInstance(result, props, slots, factory);
58
- if (isAPropagatingComponent(result, factory) && !result._metadata.propagators.has(factory)) {
59
- result._metadata.propagators.set(factory, instance);
58
+ if (isAPropagatingComponent(result, factory)) {
59
+ result._metadata.propagators.add(instance);
60
60
  }
61
61
  return instance;
62
62
  }
@@ -1,7 +1,13 @@
1
1
  import type { RuntimeMode } from '../@types/astro.js';
2
2
  import type { ModuleLoader } from '../core/module-loader/index.js';
3
+ interface ImportedStyle {
4
+ id: string;
5
+ url: string;
6
+ content: string;
7
+ }
3
8
  /** Given a filePath URL, crawl Vite’s module graph to find all style imports. */
4
9
  export declare function getStylesForURL(filePath: URL, loader: ModuleLoader, mode: RuntimeMode): Promise<{
5
10
  urls: Set<string>;
6
- stylesMap: Map<string, string>;
11
+ styles: ImportedStyle[];
7
12
  }>;
13
+ export {};
@@ -14,7 +14,11 @@ async function getStylesForURL(filePath, loader, mode) {
14
14
  }
15
15
  if (mode === "development" && // only inline in development
16
16
  typeof ssrModule?.default === "string") {
17
- importedStylesMap.set(importedModule.id ?? importedModule.url, ssrModule.default);
17
+ importedStylesMap.set(importedModule.url, {
18
+ id: importedModule.id ?? importedModule.url,
19
+ url: importedModule.url,
20
+ content: ssrModule.default
21
+ });
18
22
  } else {
19
23
  importedCssUrls.add(importedModule.url);
20
24
  }
@@ -22,7 +26,7 @@ async function getStylesForURL(filePath, loader, mode) {
22
26
  }
23
27
  return {
24
28
  urls: importedCssUrls,
25
- stylesMap: importedStylesMap
29
+ styles: [...importedStylesMap.values()]
26
30
  };
27
31
  }
28
32
  export {
@@ -213,7 +213,11 @@ async function getScriptsAndStyles({ pipeline, filePath }) {
213
213
  });
214
214
  }
215
215
  }
216
- const { urls: styleUrls, stylesMap } = await getStylesForURL(filePath, moduleLoader, mode);
216
+ const { urls: styleUrls, styles: importedStyles } = await getStylesForURL(
217
+ filePath,
218
+ moduleLoader,
219
+ mode
220
+ );
217
221
  let links = /* @__PURE__ */ new Set();
218
222
  [...styleUrls].forEach((href) => {
219
223
  links.add({
@@ -225,7 +229,7 @@ async function getScriptsAndStyles({ pipeline, filePath }) {
225
229
  });
226
230
  });
227
231
  let styles = /* @__PURE__ */ new Set();
228
- [...stylesMap].forEach(([url, content]) => {
232
+ importedStyles.forEach(({ id, url, content }) => {
229
233
  scripts.add({
230
234
  props: {
231
235
  type: "module",
@@ -235,7 +239,7 @@ async function getScriptsAndStyles({ pipeline, filePath }) {
235
239
  });
236
240
  styles.add({
237
241
  props: {
238
- "data-vite-dev-id": url
242
+ "data-vite-dev-id": id
239
243
  },
240
244
  children: content
241
245
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "3.2.1",
3
+ "version": "3.2.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",