astro 1.0.2 → 1.0.3

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.
@@ -255,10 +255,8 @@ async function parseAstroConfig(configURL) {
255
255
  return result;
256
256
  }
257
257
  const toIdent = (name) => {
258
- if (name.includes("-")) {
259
- return name.split("-")[0];
260
- }
261
- return name;
258
+ const ident = name.trim().replace(/[-_\.]?astro(?:js)?[-_\.]?/g, "").replace(/\.js/, "").replace(/(?:[\.\-\_\/]+)([a-zA-Z])/g, (_, w) => w.toUpperCase()).replace(/^[^a-zA-Z$_]+/, "");
259
+ return `${ident[0].toLowerCase()}${ident.slice(1)}`;
262
260
  };
263
261
  function createPrettyError(err) {
264
262
  err.message = `Astro could not update your astro.config.js file safely.
@@ -108,7 +108,7 @@ async function generatePage(opts, internals, pageData, ssrEntry, builtPaths) {
108
108
  const timeEnd = performance.now();
109
109
  const timeChange = getTimeStat(timeStart, timeEnd);
110
110
  const timeIncrease = `(+${timeChange})`;
111
- const filePath = getOutputFilename(opts.astroConfig, path);
111
+ const filePath = getOutputFilename(opts.astroConfig, path, pageData.route.type);
112
112
  const lineIcon = i === paths.length - 1 ? "\u2514\u2500" : "\u251C\u2500";
113
113
  info(opts.logging, null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`);
114
114
  }
@@ -46,7 +46,7 @@ async function dev(config, options) {
46
46
  https: !!((_a = viteConfig.server) == null ? void 0 : _a.https)
47
47
  })
48
48
  );
49
- const currentVersion = "1.0.2";
49
+ const currentVersion = "1.0.3";
50
50
  if (currentVersion.includes("-")) {
51
51
  warn(options.logging, null, msg.prerelease({ currentVersion }));
52
52
  }
@@ -47,7 +47,7 @@ function devStart({
47
47
  https,
48
48
  site
49
49
  }) {
50
- const version = "1.0.2";
50
+ const version = "1.0.3";
51
51
  const rootPath = site ? site.pathname : "/";
52
52
  const localPrefix = `${dim("\u2503")} Local `;
53
53
  const networkPrefix = `${dim("\u2503")} Network `;
@@ -226,7 +226,7 @@ function printHelp({
226
226
  message.push(
227
227
  linebreak(),
228
228
  ` ${bgGreen(black(` ${commandName} `))} ${green(
229
- `v${"1.0.2"}`
229
+ `v${"1.0.3"}`
230
230
  )} ${headline}`
231
231
  );
232
232
  }
@@ -2,6 +2,7 @@ import npath from "path";
2
2
  import { unwrapId } from "../../util.js";
3
3
  import { STYLE_EXTENSIONS } from "../util.js";
4
4
  const fileExtensionsToSSR = /* @__PURE__ */ new Set([".astro", ".md"]);
5
+ const STRIP_QUERY_PARAMS_REGEX = /\?.*$/;
5
6
  async function* crawlGraph(viteServer, _id, isFile, scanned = /* @__PURE__ */ new Set()) {
6
7
  const id = unwrapId(_id);
7
8
  const importedModules = /* @__PURE__ */ new Set();
@@ -15,11 +16,11 @@ async function* crawlGraph(viteServer, _id, isFile, scanned = /* @__PURE__ */ ne
15
16
  const entryIsStyle = STYLE_EXTENSIONS.has(npath.extname(id));
16
17
  for (const importedModule of entry.importedModules) {
17
18
  if (importedModule.id) {
18
- const { pathname } = new URL(`file://${importedModule.id}`);
19
- if (entryIsStyle && !STYLE_EXTENSIONS.has(npath.extname(pathname))) {
19
+ const importedModulePathname = importedModule.id.replace(STRIP_QUERY_PARAMS_REGEX, "");
20
+ if (entryIsStyle && !STYLE_EXTENSIONS.has(npath.extname(importedModulePathname))) {
20
21
  continue;
21
22
  }
22
- if (fileExtensionsToSSR.has(npath.extname(pathname))) {
23
+ if (fileExtensionsToSSR.has(npath.extname(importedModulePathname))) {
23
24
  const mod = viteServer.moduleGraph.getModuleById(importedModule.id);
24
25
  if (!(mod == null ? void 0 : mod.ssrModule)) {
25
26
  await viteServer.ssrLoadModule(importedModule.id);
package/dist/core/util.js CHANGED
@@ -5,7 +5,7 @@ import resolve from "resolve";
5
5
  import slash from "slash";
6
6
  import { fileURLToPath, pathToFileURL } from "url";
7
7
  import { prependForwardSlash, removeTrailingForwardSlash } from "./path.js";
8
- const ASTRO_VERSION = "1.0.2";
8
+ const ASTRO_VERSION = "1.0.3";
9
9
  function isObject(value) {
10
10
  return typeof value === "object" && value != null;
11
11
  }
@@ -18,7 +18,10 @@ function padMultilineString(source, n = 2) {
18
18
  `);
19
19
  }
20
20
  const STATUS_CODE_REGEXP = /^\/?[0-9]{3}$/;
21
- function getOutputFilename(astroConfig, name) {
21
+ function getOutputFilename(astroConfig, name, type) {
22
+ if (type === "endpoint") {
23
+ return name;
24
+ }
22
25
  if (name === "/" || name === "") {
23
26
  return path.posix.join(name, "index.html");
24
27
  }
@@ -1,14 +1,4 @@
1
- var idle_prebuilt_default = `(self.Astro = self.Astro || {}).idle = (getHydrateCallback) => {
2
- const cb = async () => {
3
- let hydrate = await getHydrateCallback();
4
- await hydrate();
5
- };
6
- if ("requestIdleCallback" in window) {
7
- window.requestIdleCallback(cb);
8
- } else {
9
- setTimeout(cb, 200);
10
- }
11
- };`;
1
+ var idle_prebuilt_default = `(self.Astro=self.Astro||{}).idle=a=>{const e=async()=>{await(await a())()};"requestIdleCallback"in window?window.requestIdleCallback(e):setTimeout(e,200)};`;
12
2
  export {
13
3
  idle_prebuilt_default as default
14
4
  };
@@ -1,9 +1,4 @@
1
- var load_prebuilt_default = `(self.Astro = self.Astro || {}).load = (getHydrateCallback) => {
2
- (async () => {
3
- let hydrate = await getHydrateCallback();
4
- await hydrate();
5
- })();
6
- };`;
1
+ var load_prebuilt_default = `(self.Astro=self.Astro||{}).load=a=>{(async()=>await(await a())())()};`;
7
2
  export {
8
3
  load_prebuilt_default as default
9
4
  };
@@ -1,17 +1,4 @@
1
- var media_prebuilt_default = `(self.Astro = self.Astro || {}).media = (getHydrateCallback, options) => {
2
- const cb = async () => {
3
- let hydrate = await getHydrateCallback();
4
- await hydrate();
5
- };
6
- if (options.value) {
7
- const mql = matchMedia(options.value);
8
- if (mql.matches) {
9
- cb();
10
- } else {
11
- mql.addEventListener("change", cb, { once: true });
12
- }
13
- }
14
- };`;
1
+ var media_prebuilt_default = `(self.Astro=self.Astro||{}).media=(s,a)=>{const t=async()=>{await(await s())()};if(a.value){const e=matchMedia(a.value);e.matches?t():e.addEventListener("change",t,{once:!0})}};`;
15
2
  export {
16
3
  media_prebuilt_default as default
17
4
  };
@@ -1,9 +1,4 @@
1
- var only_prebuilt_default = `(self.Astro = self.Astro || {}).only = (getHydrateCallback) => {
2
- (async () => {
3
- let hydrate = await getHydrateCallback();
4
- await hydrate();
5
- })();
6
- };`;
1
+ var only_prebuilt_default = `(self.Astro=self.Astro||{}).only=a=>{(async()=>await(await a())())()};`;
7
2
  export {
8
3
  only_prebuilt_default as default
9
4
  };
@@ -1,22 +1,4 @@
1
- var visible_prebuilt_default = `(self.Astro = self.Astro || {}).visible = (getHydrateCallback, _opts, root) => {
2
- const cb = async () => {
3
- let hydrate = await getHydrateCallback();
4
- await hydrate();
5
- };
6
- let io = new IntersectionObserver((entries) => {
7
- for (const entry of entries) {
8
- if (!entry.isIntersecting)
9
- continue;
10
- io.disconnect();
11
- cb();
12
- break;
13
- }
14
- });
15
- for (let i = 0; i < root.children.length; i++) {
16
- const child = root.children[i];
17
- io.observe(child);
18
- }
19
- };`;
1
+ var visible_prebuilt_default = `(self.Astro=self.Astro||{}).visible=(i,c,n)=>{const r=async()=>{await(await i())()};let s=new IntersectionObserver(e=>{for(const t of e)if(!!t.isIntersecting){s.disconnect(),r();break}});for(let e=0;e<n.children.length;e++){const t=n.children[e];s.observe(t)}};`;
20
2
  export {
21
3
  visible_prebuilt_default as default
22
4
  };
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "1.0.2";
1
+ const ASTRO_VERSION = "1.0.3";
2
2
  function createDeprecatedFetchContentFn() {
3
3
  return () => {
4
4
  throw new Error("Deprecated: Astro.fetchContent() has been replaced with Astro.glob().");
@@ -1,92 +1,4 @@
1
- var astro_island_prebuilt_default = `var _a;
2
- {
3
- const propTypes = {
4
- 0: (value) => value,
5
- 1: (value) => JSON.parse(value, reviver),
6
- 2: (value) => new RegExp(value),
7
- 3: (value) => new Date(value),
8
- 4: (value) => new Map(JSON.parse(value, reviver)),
9
- 5: (value) => new Set(JSON.parse(value, reviver)),
10
- 6: (value) => BigInt(value),
11
- 7: (value) => new URL(value)
12
- };
13
- const reviver = (propKey, raw) => {
14
- if (propKey === "" || !Array.isArray(raw))
15
- return raw;
16
- const [type, value] = raw;
17
- return type in propTypes ? propTypes[type](value) : void 0;
18
- };
19
- if (!customElements.get("astro-island")) {
20
- customElements.define(
21
- "astro-island",
22
- (_a = class extends HTMLElement {
23
- constructor() {
24
- super(...arguments);
25
- this.hydrate = () => {
26
- if (!this.hydrator || this.parentElement?.closest("astro-island[ssr]")) {
27
- return;
28
- }
29
- const slotted = this.querySelectorAll("astro-slot");
30
- const slots = {};
31
- const templates = this.querySelectorAll("template[data-astro-template]");
32
- for (const template of templates) {
33
- if (!template.closest(this.tagName)?.isSameNode(this))
34
- continue;
35
- slots[template.getAttribute("data-astro-template") || "default"] = template.innerHTML;
36
- template.remove();
37
- }
38
- for (const slot of slotted) {
39
- if (!slot.closest(this.tagName)?.isSameNode(this))
40
- continue;
41
- slots[slot.getAttribute("name") || "default"] = slot.innerHTML;
42
- }
43
- const props = this.hasAttribute("props") ? JSON.parse(this.getAttribute("props"), reviver) : {};
44
- this.hydrator(this)(this.Component, props, slots, {
45
- client: this.getAttribute("client")
46
- });
47
- this.removeAttribute("ssr");
48
- window.removeEventListener("astro:hydrate", this.hydrate);
49
- window.dispatchEvent(new CustomEvent("astro:hydrate"));
50
- };
51
- }
52
- connectedCallback() {
53
- if (!this.hasAttribute("await-children") || this.firstChild) {
54
- this.childrenConnectedCallback();
55
- } else {
56
- new MutationObserver((_, mo) => {
57
- mo.disconnect();
58
- this.childrenConnectedCallback();
59
- }).observe(this, { childList: true });
60
- }
61
- }
62
- async childrenConnectedCallback() {
63
- window.addEventListener("astro:hydrate", this.hydrate);
64
- await import(this.getAttribute("before-hydration-url"));
65
- const opts = JSON.parse(this.getAttribute("opts"));
66
- Astro[this.getAttribute("client")](
67
- async () => {
68
- const rendererUrl = this.getAttribute("renderer-url");
69
- const [componentModule, { default: hydrator }] = await Promise.all([
70
- import(this.getAttribute("component-url")),
71
- rendererUrl ? import(rendererUrl) : () => () => {
72
- }
73
- ]);
74
- this.Component = componentModule[this.getAttribute("component-export") || "default"];
75
- this.hydrator = hydrator;
76
- return this.hydrate;
77
- },
78
- opts,
79
- this
80
- );
81
- }
82
- attributeChangedCallback() {
83
- if (this.hydrator)
84
- this.hydrate();
85
- }
86
- }, _a.observedAttributes = ["props"], _a)
87
- );
88
- }
89
- }`;
1
+ var astro_island_prebuilt_default = `var a;{const l={0:t=>t,1:t=>JSON.parse(t,n),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(JSON.parse(t,n)),5:t=>new Set(JSON.parse(t,n)),6:t=>BigInt(t),7:t=>new URL(t)},n=(t,r)=>{if(t===""||!Array.isArray(r))return r;const[e,i]=r;return e in l?l[e](i):void 0};customElements.get("astro-island")||customElements.define("astro-island",(a=class extends HTMLElement{constructor(){super(...arguments);this.hydrate=()=>{if(!this.hydrator||this.parentElement?.closest("astro-island[ssr]"))return;const r=this.querySelectorAll("astro-slot"),e={},i=this.querySelectorAll("template[data-astro-template]");for(const s of i)!s.closest(this.tagName)?.isSameNode(this)||(e[s.getAttribute("data-astro-template")||"default"]=s.innerHTML,s.remove());for(const s of r)!s.closest(this.tagName)?.isSameNode(this)||(e[s.getAttribute("name")||"default"]=s.innerHTML);const o=this.hasAttribute("props")?JSON.parse(this.getAttribute("props"),n):{};this.hydrator(this)(this.Component,o,e,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),window.removeEventListener("astro:hydrate",this.hydrate),window.dispatchEvent(new CustomEvent("astro:hydrate"))}}connectedCallback(){!this.hasAttribute("await-children")||this.firstChild?this.childrenConnectedCallback():new MutationObserver((r,e)=>{e.disconnect(),this.childrenConnectedCallback()}).observe(this,{childList:!0})}async childrenConnectedCallback(){window.addEventListener("astro:hydrate",this.hydrate),await import(this.getAttribute("before-hydration-url"));const r=JSON.parse(this.getAttribute("opts"));Astro[this.getAttribute("client")](async()=>{const e=this.getAttribute("renderer-url"),[i,{default:o}]=await Promise.all([import(this.getAttribute("component-url")),e?import(e):()=>()=>{}]);return this.Component=i[this.getAttribute("component-export")||"default"],this.hydrator=o,this.hydrate},r,this)}attributeChangedCallback(){this.hydrator&&this.hydrate()}},a.observedAttributes=["props"],a))}`;
90
2
  export {
91
3
  astro_island_prebuilt_default as default
92
4
  };
@@ -1,5 +1,5 @@
1
1
  import type { ErrorPayload, ViteDevServer } from 'vite';
2
- import type { AstroConfig } from '../@types/astro';
2
+ import type { AstroConfig, RouteType } from '../@types/astro';
3
3
  export declare const ASTRO_VERSION: string;
4
4
  /** Returns true if argument is an object of any prototype/class (but not null). */
5
5
  export declare function isObject(value: unknown): value is Record<string, any>;
@@ -11,7 +11,7 @@ export declare function padMultilineString(source: string, n?: number): string;
11
11
  * Handles both "/foo" and "foo" `name` formats.
12
12
  * Handles `/404` and `/` correctly.
13
13
  */
14
- export declare function getOutputFilename(astroConfig: AstroConfig, name: string): string;
14
+ export declare function getOutputFilename(astroConfig: AstroConfig, name: string, type: RouteType): string;
15
15
  /** is a specifier an npm package? */
16
16
  export declare function parseNpmName(spec: string): {
17
17
  scope?: string;
@@ -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: "(self.Astro = self.Astro || {}).idle = (getHydrateCallback) => {\n const cb = async () => {\n let hydrate = await getHydrateCallback();\n await hydrate();\n };\n if (\"requestIdleCallback\" in window) {\n window.requestIdleCallback(cb);\n } else {\n setTimeout(cb, 200);\n }\n};";
6
+ declare const _default: "(self.Astro=self.Astro||{}).idle=a=>{const e=async()=>{await(await a())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};";
7
7
  export default _default;
@@ -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: "(self.Astro = self.Astro || {}).load = (getHydrateCallback) => {\n (async () => {\n let hydrate = await getHydrateCallback();\n await hydrate();\n })();\n};";
6
+ declare const _default: "(self.Astro=self.Astro||{}).load=a=>{(async()=>await(await a())())()};";
7
7
  export default _default;
@@ -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: "(self.Astro = self.Astro || {}).media = (getHydrateCallback, options) => {\n const cb = async () => {\n let hydrate = await getHydrateCallback();\n await hydrate();\n };\n if (options.value) {\n const mql = matchMedia(options.value);\n if (mql.matches) {\n cb();\n } else {\n mql.addEventListener(\"change\", cb, { once: true });\n }\n }\n};";
6
+ declare const _default: "(self.Astro=self.Astro||{}).media=(s,a)=>{const t=async()=>{await(await s())()};if(a.value){const e=matchMedia(a.value);e.matches?t():e.addEventListener(\"change\",t,{once:!0})}};";
7
7
  export default _default;
@@ -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: "(self.Astro = self.Astro || {}).only = (getHydrateCallback) => {\n (async () => {\n let hydrate = await getHydrateCallback();\n await hydrate();\n })();\n};";
6
+ declare const _default: "(self.Astro=self.Astro||{}).only=a=>{(async()=>await(await a())())()};";
7
7
  export default _default;
@@ -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: "(self.Astro = self.Astro || {}).visible = (getHydrateCallback, _opts, root) => {\n const cb = async () => {\n let hydrate = await getHydrateCallback();\n await hydrate();\n };\n let io = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (!entry.isIntersecting)\n continue;\n io.disconnect();\n cb();\n break;\n }\n });\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\n io.observe(child);\n }\n};";
6
+ declare const _default: "(self.Astro=self.Astro||{}).visible=(i,c,n)=>{const r=async()=>{await(await i())()};let s=new IntersectionObserver(e=>{for(const t of e)if(!!t.isIntersecting){s.disconnect(),r();break}});for(let e=0;e<n.children.length;e++){const t=n.children[e];s.observe(t)}};";
7
7
  export default _default;
@@ -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;\n{\n const propTypes = {\n 0: (value) => value,\n 1: (value) => JSON.parse(value, reviver),\n 2: (value) => new RegExp(value),\n 3: (value) => new Date(value),\n 4: (value) => new Map(JSON.parse(value, reviver)),\n 5: (value) => new Set(JSON.parse(value, reviver)),\n 6: (value) => BigInt(value),\n 7: (value) => new URL(value)\n };\n const reviver = (propKey, raw) => {\n if (propKey === \"\" || !Array.isArray(raw))\n return raw;\n const [type, value] = raw;\n return type in propTypes ? propTypes[type](value) : void 0;\n };\n if (!customElements.get(\"astro-island\")) {\n customElements.define(\n \"astro-island\",\n (_a = class extends HTMLElement {\n constructor() {\n super(...arguments);\n this.hydrate = () => {\n if (!this.hydrator || this.parentElement?.closest(\"astro-island[ssr]\")) {\n return;\n }\n const slotted = this.querySelectorAll(\"astro-slot\");\n const slots = {};\n const templates = this.querySelectorAll(\"template[data-astro-template]\");\n for (const template of templates) {\n if (!template.closest(this.tagName)?.isSameNode(this))\n continue;\n slots[template.getAttribute(\"data-astro-template\") || \"default\"] = template.innerHTML;\n template.remove();\n }\n for (const slot of slotted) {\n if (!slot.closest(this.tagName)?.isSameNode(this))\n continue;\n slots[slot.getAttribute(\"name\") || \"default\"] = slot.innerHTML;\n }\n const props = this.hasAttribute(\"props\") ? JSON.parse(this.getAttribute(\"props\"), reviver) : {};\n this.hydrator(this)(this.Component, props, slots, {\n client: this.getAttribute(\"client\")\n });\n this.removeAttribute(\"ssr\");\n window.removeEventListener(\"astro:hydrate\", this.hydrate);\n window.dispatchEvent(new CustomEvent(\"astro:hydrate\"));\n };\n }\n connectedCallback() {\n if (!this.hasAttribute(\"await-children\") || this.firstChild) {\n this.childrenConnectedCallback();\n } else {\n new MutationObserver((_, mo) => {\n mo.disconnect();\n this.childrenConnectedCallback();\n }).observe(this, { childList: true });\n }\n }\n async childrenConnectedCallback() {\n window.addEventListener(\"astro:hydrate\", this.hydrate);\n await import(this.getAttribute(\"before-hydration-url\"));\n const opts = JSON.parse(this.getAttribute(\"opts\"));\n Astro[this.getAttribute(\"client\")](\n async () => {\n const rendererUrl = this.getAttribute(\"renderer-url\");\n const [componentModule, { default: hydrator }] = await Promise.all([\n import(this.getAttribute(\"component-url\")),\n rendererUrl ? import(rendererUrl) : () => () => {\n }\n ]);\n this.Component = componentModule[this.getAttribute(\"component-export\") || \"default\"];\n this.hydrator = hydrator;\n return this.hydrate;\n },\n opts,\n this\n );\n }\n attributeChangedCallback() {\n if (this.hydrator)\n this.hydrate();\n }\n }, _a.observedAttributes = [\"props\"], _a)\n );\n }\n}";
6
+ declare const _default: "var a;{const l={0:t=>t,1:t=>JSON.parse(t,n),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(JSON.parse(t,n)),5:t=>new Set(JSON.parse(t,n)),6:t=>BigInt(t),7:t=>new URL(t)},n=(t,r)=>{if(t===\"\"||!Array.isArray(r))return r;const[e,i]=r;return e in l?l[e](i):void 0};customElements.get(\"astro-island\")||customElements.define(\"astro-island\",(a=class extends HTMLElement{constructor(){super(...arguments);this.hydrate=()=>{if(!this.hydrator||this.parentElement?.closest(\"astro-island[ssr]\"))return;const r=this.querySelectorAll(\"astro-slot\"),e={},i=this.querySelectorAll(\"template[data-astro-template]\");for(const s of i)!s.closest(this.tagName)?.isSameNode(this)||(e[s.getAttribute(\"data-astro-template\")||\"default\"]=s.innerHTML,s.remove());for(const s of r)!s.closest(this.tagName)?.isSameNode(this)||(e[s.getAttribute(\"name\")||\"default\"]=s.innerHTML);const o=this.hasAttribute(\"props\")?JSON.parse(this.getAttribute(\"props\"),n):{};this.hydrator(this)(this.Component,o,e,{client:this.getAttribute(\"client\")}),this.removeAttribute(\"ssr\"),window.removeEventListener(\"astro:hydrate\",this.hydrate),window.dispatchEvent(new CustomEvent(\"astro:hydrate\"))}}connectedCallback(){!this.hasAttribute(\"await-children\")||this.firstChild?this.childrenConnectedCallback():new MutationObserver((r,e)=>{e.disconnect(),this.childrenConnectedCallback()}).observe(this,{childList:!0})}async childrenConnectedCallback(){window.addEventListener(\"astro:hydrate\",this.hydrate),await import(this.getAttribute(\"before-hydration-url\"));const r=JSON.parse(this.getAttribute(\"opts\"));Astro[this.getAttribute(\"client\")](async()=>{const e=this.getAttribute(\"renderer-url\"),[i,{default:o}]=await Promise.all([import(this.getAttribute(\"component-url\")),e?import(e):()=>()=>{}]);return this.Component=i[this.getAttribute(\"component-export\")||\"default\"],this.hydrator=o,this.hydrate},r,this)}attributeChangedCallback(){this.hydrator&&this.hydrate()}},a.observedAttributes=[\"props\"],a))}";
7
7
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
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",