astro 5.6.0 → 5.6.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.
Files changed (46) hide show
  1. package/dist/actions/plugins.js +1 -1
  2. package/dist/assets/utils/index.d.ts +5 -1
  3. package/dist/assets/utils/index.js +5 -1
  4. package/dist/assets/utils/node/emitAsset.d.ts +8 -0
  5. package/dist/assets/utils/node/emitAsset.js +45 -3
  6. package/dist/assets/vite-plugin-assets.d.ts +3 -1
  7. package/dist/assets/vite-plugin-assets.js +36 -30
  8. package/dist/cli/add/index.js +3 -1
  9. package/dist/cli/install-package.js +3 -0
  10. package/dist/content/content-layer.js +3 -3
  11. package/dist/content/utils.d.ts +10 -10
  12. package/dist/content/vite-plugin-content-virtual-mod.js +7 -9
  13. package/dist/core/build/plugins/plugin-component-entry.js +3 -1
  14. package/dist/core/build/plugins/plugin-manifest.js +1 -1
  15. package/dist/core/build/plugins/plugin-pages.js +1 -1
  16. package/dist/core/build/plugins/plugin-renderers.js +3 -3
  17. package/dist/core/build/plugins/plugin-ssr.js +2 -2
  18. package/dist/core/config/schemas/base.d.ts +10 -10
  19. package/dist/core/config/schemas/base.js +1 -0
  20. package/dist/core/config/schemas/refined.js +0 -7
  21. package/dist/core/config/schemas/relative.d.ts +14 -14
  22. package/dist/core/constants.js +1 -1
  23. package/dist/core/create-vite.js +1 -1
  24. package/dist/core/dev/dev.js +1 -1
  25. package/dist/core/messages.js +2 -2
  26. package/dist/core/middleware/vite-plugin.js +3 -3
  27. package/dist/core/render-context.js +1 -0
  28. package/dist/core/server-islands/vite-plugin-server-islands.js +1 -1
  29. package/dist/env/schema.d.ts +6 -6
  30. package/dist/env/vite-plugin-env.js +3 -3
  31. package/dist/integrations/hooks.js +3 -0
  32. package/dist/manifest/virtual-module.js +2 -2
  33. package/dist/prefetch/vite-plugin-prefetch.js +1 -1
  34. package/dist/runtime/server/render/common.js +8 -0
  35. package/dist/runtime/server/render/instruction.d.ts +5 -5
  36. package/dist/runtime/server/render/server-islands.d.ts +1 -0
  37. package/dist/runtime/server/render/server-islands.js +29 -31
  38. package/dist/toolbar/vite-plugin-dev-toolbar.js +41 -39
  39. package/dist/transitions/swap-functions.d.ts +1 -1
  40. package/dist/transitions/swap-functions.js +7 -6
  41. package/dist/transitions/vite-plugin-transitions.js +22 -18
  42. package/dist/types/public/internal.d.ts +1 -0
  43. package/dist/vite-plugin-load-fallback/index.js +4 -2
  44. package/dist/vite-plugin-scripts/index.js +9 -3
  45. package/dist/vite-plugin-ssr-manifest/index.js +4 -3
  46. package/package.json +3 -3
@@ -22,26 +22,30 @@ function astroTransitions({ settings }) {
22
22
  },
23
23
  load(id) {
24
24
  if (id === resolvedVirtualModuleId) {
25
- return `
26
- export * from "astro/virtual-modules/transitions.js";
27
- export {
28
- default as ViewTransitions,
29
- default as ClientRouter
30
- } from "astro/components/ClientRouter.astro";
31
- `;
25
+ return {
26
+ code: `
27
+ export * from "astro/virtual-modules/transitions.js";
28
+ export {
29
+ default as ViewTransitions,
30
+ default as ClientRouter
31
+ } from "astro/components/ClientRouter.astro";
32
+ `
33
+ };
32
34
  }
33
35
  if (id === resolvedVirtualClientModuleId) {
34
- return `
35
- export { navigate, supportsViewTransitions, transitionEnabledOnThisPage } from "astro/virtual-modules/transitions-router.js";
36
- export * from "astro/virtual-modules/transitions-types.js";
37
- export {
38
- TRANSITION_BEFORE_PREPARATION, isTransitionBeforePreparationEvent, TransitionBeforePreparationEvent,
39
- TRANSITION_AFTER_PREPARATION,
40
- TRANSITION_BEFORE_SWAP, isTransitionBeforeSwapEvent, TransitionBeforeSwapEvent,
41
- TRANSITION_AFTER_SWAP, TRANSITION_PAGE_LOAD
42
- } from "astro/virtual-modules/transitions-events.js";
43
- export { swapFunctions } from "astro/virtual-modules/transitions-swap-functions.js";
44
- `;
36
+ return {
37
+ code: `
38
+ export { navigate, supportsViewTransitions, transitionEnabledOnThisPage } from "astro/virtual-modules/transitions-router.js";
39
+ export * from "astro/virtual-modules/transitions-types.js";
40
+ export {
41
+ TRANSITION_BEFORE_PREPARATION, isTransitionBeforePreparationEvent, TransitionBeforePreparationEvent,
42
+ TRANSITION_AFTER_PREPARATION,
43
+ TRANSITION_BEFORE_SWAP, isTransitionBeforeSwapEvent, TransitionBeforeSwapEvent,
44
+ TRANSITION_AFTER_SWAP, TRANSITION_PAGE_LOAD
45
+ } from "astro/virtual-modules/transitions-events.js";
46
+ export { swapFunctions } from "astro/virtual-modules/transitions-swap-functions.js";
47
+ `
48
+ };
45
49
  }
46
50
  },
47
51
  transform(code, id) {
@@ -258,6 +258,7 @@ export interface SSRMetadata {
258
258
  renderedScripts: Set<string>;
259
259
  hasDirectives: Set<string>;
260
260
  hasRenderedHead: boolean;
261
+ hasRenderedServerIslandRuntime: boolean;
261
262
  headInTree: boolean;
262
263
  extraHead: string[];
263
264
  propagators: Set<AstroComponentInstance>;
@@ -41,8 +41,10 @@ function loadFallbackPlugin({
41
41
  }
42
42
  },
43
43
  async load(id) {
44
- const source = await tryLoadModule(id);
45
- return source;
44
+ const code = await tryLoadModule(id);
45
+ if (code) {
46
+ return { code };
47
+ }
46
48
  }
47
49
  },
48
50
  {
@@ -17,13 +17,19 @@ function astroScriptsPlugin({ settings }) {
17
17
  },
18
18
  async load(id) {
19
19
  if (id === BEFORE_HYDRATION_SCRIPT_ID) {
20
- return settings.scripts.filter((s) => s.stage === "before-hydration").map((s) => s.content).join("\n");
20
+ return {
21
+ code: settings.scripts.filter((s) => s.stage === "before-hydration").map((s) => s.content).join("\n")
22
+ };
21
23
  }
22
24
  if (id === PAGE_SCRIPT_ID) {
23
- return settings.scripts.filter((s) => s.stage === "page").map((s) => s.content).join("\n");
25
+ return {
26
+ code: settings.scripts.filter((s) => s.stage === "page").map((s) => s.content).join("\n")
27
+ };
24
28
  }
25
29
  if (id === PAGE_SSR_SCRIPT_ID) {
26
- return settings.scripts.filter((s) => s.stage === "page-ssr").map((s) => s.content).join("\n");
30
+ return {
31
+ code: settings.scripts.filter((s) => s.stage === "page-ssr").map((s) => s.content).join("\n")
32
+ };
27
33
  }
28
34
  return null;
29
35
  },
@@ -11,12 +11,13 @@ function vitePluginSSRManifest() {
11
11
  },
12
12
  load(id) {
13
13
  if (id === resolvedManifestVirtualModuleId) {
14
- return `export let manifest = {};
14
+ return {
15
+ code: `export let manifest = {};
15
16
  export function _privateSetManifestDontUseThis(ssrManifest) {
16
17
  manifest = ssrManifest;
17
- }`;
18
+ }`
19
+ };
18
20
  }
19
- return void 0;
20
21
  }
21
22
  };
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "5.6.0",
3
+ "version": "5.6.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",
@@ -145,11 +145,11 @@
145
145
  "tinyexec": "^0.3.2",
146
146
  "tinyglobby": "^0.2.12",
147
147
  "tsconfck": "^3.1.5",
148
- "ultrahtml": "^1.5.3",
148
+ "ultrahtml": "^1.6.0",
149
149
  "unist-util-visit": "^5.0.0",
150
150
  "unstorage": "^1.15.0",
151
151
  "vfile": "^6.0.3",
152
- "vite": "^6.2.4",
152
+ "vite": "^6.2.6",
153
153
  "vitefu": "^1.0.6",
154
154
  "xxhash-wasm": "^1.1.0",
155
155
  "yargs-parser": "^21.1.1",