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.
- package/dist/core/dev/index.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/util.js +1 -1
- package/dist/jsx-runtime/index.d.ts +2 -1
- package/dist/jsx-runtime/index.js +2 -1
- package/dist/runtime/server/astro-global.js +1 -1
- package/dist/runtime/server/jsx.js +4 -0
- package/dist/runtime/server/render/common.js +1 -1
- package/package.json +1 -1
package/dist/core/dev/index.js
CHANGED
package/dist/core/messages.js
CHANGED
|
@@ -47,7 +47,7 @@ function serverStart({
|
|
|
47
47
|
site,
|
|
48
48
|
isRestart = false
|
|
49
49
|
}) {
|
|
50
|
-
const version = "1.4.
|
|
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.
|
|
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.
|
|
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 ?? {}
|
|
@@ -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: {
|