-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for the automatic dev runtime #2
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
Changes from 6 commits
8f6309d
7bac503
e3ea95e
2fab741
fff3d99
9fbb1bc
543b4ff
c6ac054
ecc7a6a
9585e87
09710c2
66e0051
e8b8bc5
1cb4fc9
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 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -113,6 +113,16 @@ runtime is automatic (`string`, default: `'react'`). | |||||||||||||
Comment: `@jsxImportSource theSource`. | ||||||||||||||
Note that `/jsx-runtime` is appended to this provided source. | ||||||||||||||
|
||||||||||||||
##### `options.development` | ||||||||||||||
|
||||||||||||||
If the automatic runtime is used, this compiles JSX into automatic runtime | ||||||||||||||
development mode (`boolean`, default: `false`). | ||||||||||||||
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
Btw: does React still show somewhat useful info without a 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. 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. So it doesn’t show anything? 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. My screenshot was a bit unclear. This error view replaces what would normally be the part that display component details. Anyway, showing 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. Now I’m interested whether you have a screenshot that shows this, because I haven’t seen it yet! 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. Sure! I created the following Next.js page in recma-nextjs-static-props, then tweaked the source parameters: import { jsxDEV } from 'react/jsx-dev-runtime'
export default function Foo() {
return jsxDEV(
'p',
{ children: 'Hello world!' },
'key',
false,
{
fileName: '/home/remco/Projects/recma-nextjs-static-props/pages/foo.jsx',
lineNumber: 35,
columnNumber: 42,
},
this,
)
} Using the React devtools chrome extension, it looks like this: The source copy button copies The Log this component data to the console button logs the following positional data to the console: With removed positional information, it looks like this: With a removed filename, it looks like this: With And just for you, a screenshot with |
||||||||||||||
|
||||||||||||||
###### `options.filePath` | ||||||||||||||
|
||||||||||||||
If the automatic runtime development mode is used, this option is used to | ||||||||||||||
provide a file path to map the JSX node to a source file (`string`). | ||||||||||||||
remcohaszing marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
###### `options.pragma` | ||||||||||||||
|
||||||||||||||
Identifier or member expression to call when the effective runtime is classic | ||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.