-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Update on-demand docs to avoid DEV JSX runtime #2204
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,7 +28,11 @@ On the server: | |||||||||||
```js path="server.js" | ||||||||||||
import {compile} from '@mdx-js/mdx' | ||||||||||||
|
||||||||||||
const code = String(await compile('# hi', {outputFormat: 'function-body' /* …otherOptions */ })) | ||||||||||||
const code = String(await compile('# hi', { | ||||||||||||
outputFormat: 'function-body', | ||||||||||||
development: false, // Avoid use of the jsxDEV runtime | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I’d suggest this: better to document what this does, instead of double negatives. Alternatively, you can show both dev and prod versions
Suggested change
And then use the following below:
|
||||||||||||
/* …otherOptions */ | ||||||||||||
})) | ||||||||||||
// To do: send `code` to the client somehow. | ||||||||||||
``` | ||||||||||||
|
||||||||||||
|
@@ -82,7 +86,11 @@ export default function Page({code}) { | |||||||||||
|
||||||||||||
export async function getStaticProps() { | ||||||||||||
const code = String( | ||||||||||||
await compile('# hi', {outputFormat: 'function-body' /* …otherOptions */}) | ||||||||||||
await compile('# hi', { | ||||||||||||
outputFormat: 'function-body', | ||||||||||||
development: false, // Avoid use of the jsxDEV runtime | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||||||||||||
/* …otherOptions */ | ||||||||||||
}) | ||||||||||||
) | ||||||||||||
return {props: {code}} | ||||||||||||
} | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m thinking maybe something like this? It’s a bit annoying, because it’s all very situational.
Maybe for the client we can use: