astro 1.4.1 → 1.4.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.
@@ -46,7 +46,7 @@ async function dev(settings, options) {
46
46
  isRestart
47
47
  })
48
48
  );
49
- const currentVersion = "1.4.1";
49
+ const currentVersion = "1.4.2";
50
50
  if (currentVersion.includes("-")) {
51
51
  warn(options.logging, null, msg.prerelease({ currentVersion }));
52
52
  }
@@ -47,7 +47,7 @@ function serverStart({
47
47
  site,
48
48
  isRestart = false
49
49
  }) {
50
- const version = "1.4.1";
50
+ const version = "1.4.2";
51
51
  const rootPath = site ? site.pathname : "/";
52
52
  const localPrefix = `${dim("\u2503")} Local `;
53
53
  const networkPrefix = `${dim("\u2503")} Network `;
@@ -250,7 +250,7 @@ function printHelp({
250
250
  message.push(
251
251
  linebreak(),
252
252
  ` ${bgGreen(black(` ${commandName} `))} ${green(
253
- `v${"1.4.1"}`
253
+ `v${"1.4.2"}`
254
254
  )} ${headline}`
255
255
  );
256
256
  }
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.4.1";
8
+ const ASTRO_VERSION = "1.4.2";
9
9
  function isObject(value) {
10
10
  return typeof value === "object" && value != null;
11
11
  }
@@ -1,6 +1,7 @@
1
- import { Fragment } from '../runtime/server/index.js';
1
+ import { Fragment, Renderer } from '../runtime/server/index.js';
2
2
  declare const AstroJSX = "astro:jsx";
3
3
  export interface AstroVNode {
4
+ [Renderer]: string;
4
5
  [AstroJSX]: boolean;
5
6
  type: string | ((...args: any) => any);
6
7
  props: Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { Fragment, markHTMLString } from "../runtime/server/index.js";
1
+ import { Fragment, markHTMLString, Renderer } from "../runtime/server/index.js";
2
2
  const AstroJSX = "astro:jsx";
3
3
  const Empty = Symbol("empty");
4
4
  const toSlotName = (str) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase());
@@ -65,6 +65,7 @@ function transformSetDirectives(vnode) {
65
65
  }
66
66
  function createVNode(type, props) {
67
67
  const vnode = {
68
+ [Renderer]: "astro:jsx",
68
69
  [AstroJSX]: true,
69
70
  type,
70
71
  props: props ?? {}
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "1.4.1";
1
+ const ASTRO_VERSION = "1.4.2";
2
2
  function createDeprecatedFetchContentFn() {
3
3
  return () => {
4
4
  throw new Error("Deprecated: Astro.fetchContent() has been replaced with Astro.glob().");
@@ -31,6 +31,10 @@ async function renderJSX(result, vnode) {
31
31
  }
32
32
  if (isVNode(vnode)) {
33
33
  switch (true) {
34
+ case !vnode.type: {
35
+ throw new Error(`Unable to render ${result._metadata.pathname} because it contains an undefined Component!
36
+ Did you forget to import the component or is it possible there is a typo?`);
37
+ }
34
38
  case vnode.type === Symbol.for("astro:fragment"):
35
39
  return renderJSX(result, vnode.props.children);
36
40
  case vnode.type.isAstroComponentFactory: {
@@ -51,7 +51,7 @@ class HTMLParts {
51
51
  }
52
52
  toArrayBuffer() {
53
53
  this.parts.forEach((part, i) => {
54
- if (typeof part === "string") {
54
+ if (!ArrayBuffer.isView(part)) {
55
55
  this.parts[i] = encoder.encode(String(part));
56
56
  }
57
57
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "1.4.1",
3
+ "version": "1.4.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",