Skip to content

Commit

Permalink
Update MDX example to address failure (#3799)
Browse files Browse the repository at this point in the history
* fix: do not use symbol in JSX runtime

* chore: update MDX example

Co-authored-by: Nate Moore <[email protected]>
  • Loading branch information
natemoo-re and natemoo-re authored Jul 1, 2022
1 parent b9d26f3 commit 5fe5273
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-balloons-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix internal error for MDX integration
5 changes: 4 additions & 1 deletion examples/with-mdx/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"recommendations": ["astro-build.astro-vscode"],
"recommendations": [
"astro-build.astro-vscode",
"silvenon.mdx"
],
"unwantedRecommendations": []
}
8 changes: 5 additions & 3 deletions examples/with-mdx/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import Counter from '../components/Counter.jsx';
import Title from '../components/Title.astro';
export const components = { h1: Title };

# Hello world!

export const authors = [
{ name: 'Jane', email: '[email protected]' },
{ name: 'John', twitter: '@john2002' },
];
export const published = new Date('2022-02-01');

# Hello world!

Written by: {new Intl.ListFormat('en').format(authors.map(d => d.name))}.

Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(published)}.

<Counter client:idle>## Counter</Counter>
<Counter client:idle>
## This is a counter!
</Counter>
2 changes: 1 addition & 1 deletion packages/astro/src/jsx-runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Fragment, markHTMLString } from '../runtime/server/index.js';

const AstroJSX = Symbol('@astrojs/jsx');
const AstroJSX = 'astro:jsx';
const Empty = Symbol('empty');

interface AstroVNode {
Expand Down

0 comments on commit 5fe5273

Please sign in to comment.