0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Update MDX example to address failure (#3799)

* fix: do not use symbol in JSX runtime

* chore: update MDX example

Co-authored-by: Nate Moore <nate@astro.build>
This commit is contained in:
Nate Moore 2022-07-01 16:51:28 -04:00 committed by GitHub
parent b9d26f39e2
commit 5fe52737cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix internal error for MDX integration

View file

@ -1,4 +1,7 @@
{ {
"recommendations": ["astro-build.astro-vscode"], "recommendations": [
"astro-build.astro-vscode",
"silvenon.mdx"
],
"unwantedRecommendations": [] "unwantedRecommendations": []
} }

View file

@ -2,16 +2,18 @@ import Counter from '../components/Counter.jsx';
import Title from '../components/Title.astro'; import Title from '../components/Title.astro';
export const components = { h1: Title }; export const components = { h1: Title };
# Hello world!
export const authors = [ export const authors = [
{ name: 'Jane', email: 'hi@jane.com' }, { name: 'Jane', email: 'hi@jane.com' },
{ name: 'John', twitter: '@john2002' }, { name: 'John', twitter: '@john2002' },
]; ];
export const published = new Date('2022-02-01'); export const published = new Date('2022-02-01');
# Hello world!
Written by: {new Intl.ListFormat('en').format(authors.map(d => d.name))}. Written by: {new Intl.ListFormat('en').format(authors.map(d => d.name))}.
Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(published)}. Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(published)}.
<Counter client:idle>## Counter</Counter> <Counter client:idle>
## This is a counter!
</Counter>

View file

@ -1,6 +1,6 @@
import { Fragment, markHTMLString } from '../runtime/server/index.js'; import { Fragment, markHTMLString } from '../runtime/server/index.js';
const AstroJSX = Symbol('@astrojs/jsx'); const AstroJSX = 'astro:jsx';
const Empty = Symbol('empty'); const Empty = Symbol('empty');
interface AstroVNode { interface AstroVNode {