@astrojs/mdx 4.0.0-alpha.2 → 4.0.0-beta.1

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.
@@ -19,7 +19,10 @@ const rehypeOptimizeStatic = (options) => {
19
19
  const elementStack = [];
20
20
  const elementMetadatas = /* @__PURE__ */ new WeakMap();
21
21
  const isNodeNonStatic = (node) => {
22
- return node.type.startsWith("mdx") || ignoreElementNames.has(node.tagName);
22
+ return node.type.startsWith("mdx") || // @ts-expect-error `node` should never have `type: 'root'`, but in some cases plugins may inject it as children,
23
+ // which MDX will render as a fragment instead (an MDX fragment is a `mdxJsxFlowElement` type).
24
+ node.type === "root" || // @ts-expect-error Access `.tagName` naively for perf
25
+ ignoreElementNames.has(node.tagName);
23
26
  };
24
27
  visit(tree, {
25
28
  // @ts-expect-error Force coerce node as hast node
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/mdx",
3
3
  "description": "Add support for MDX pages in your Astro site",
4
- "version": "4.0.0-alpha.2",
4
+ "version": "4.0.0-beta.1",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -41,7 +41,7 @@
41
41
  "source-map": "^0.7.4",
42
42
  "unist-util-visit": "^5.0.0",
43
43
  "vfile": "^6.0.3",
44
- "@astrojs/markdown-remark": "6.0.0-alpha.1"
44
+ "@astrojs/markdown-remark": "6.0.0-beta.1"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "astro": "^5.0.0-alpha.0"
@@ -61,10 +61,10 @@
61
61
  "remark-rehype": "^11.1.0",
62
62
  "remark-shiki-twoslash": "^3.1.3",
63
63
  "remark-toc": "^9.0.0",
64
- "shiki": "^1.16.1",
64
+ "shiki": "^1.16.2",
65
65
  "unified": "^11.0.5",
66
- "vite": "^5.4.2",
67
- "astro": "5.0.0-alpha.3",
66
+ "vite": "^5.4.3",
67
+ "astro": "5.0.0-beta.1",
68
68
  "astro-scripts": "0.0.14"
69
69
  },
70
70
  "engines": {