Fixture: Legacy JSX Runtimes (#20012) * Fixture: Legacy JSX Runtimes * Add more comments - #6
Fixture: Legacy JSX Runtimes (#20012)
* Fixture: Legacy JSX Runtimes
* Add more comments#6Menkalian wants to merge 1 commit into
Conversation
* Fixture: Legacy JSX Runtimes * Add more comments
There was a problem hiding this comment.
Pull request overview
This pull request adds a new fixture for testing legacy JSX runtimes. The main changes include excluding CJS directories from Prettier formatting, adding comprehensive test utilities, and creating fixture directories for React versions 15, 16, and 17 with their respective JSX runtime implementations.
- Prettier configuration updated to ignore CJS directories
- Test setup utilities added for handling console warnings/errors
- Fixture directories created for React 15, 16, and 17 with JSX runtime polyfills
Reviewed changes
Copilot reviewed 30 out of 43 changed files in this pull request and generated 75 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/prettier/index.js | Adds exclusion pattern for CJS directories from Prettier formatting |
| fixtures/legacy-jsx-runtimes/yarn.lock | Complete dependency lockfile for the fixture |
| fixtures/legacy-jsx-runtimes/setupTests.js | Test matchers for console warnings and errors |
| fixtures/legacy-jsx-runtimes/react-17/* | React 17 fixture with JSX runtime implementations |
| fixtures/legacy-jsx-runtimes/react-16/* | React 16 fixture with JSX runtime implementations |
| fixtures/legacy-jsx-runtimes/react-15/* | React 15 fixture with JSX runtime implementations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. | ||
| // TODO: Drop this when these are no longer allowed as the type argument. | ||
|
|
||
| if (element == null) { |
There was a problem hiding this comment.
This guard always evaluates to false.
| if (element == null) { | ||
| return element; | ||
| } // Skip key warning if the type isn't valid since our key validation logic |
There was a problem hiding this comment.
This guard always evaluates to false.
| if (element == null) { | |
| return element; | |
| } // Skip key warning if the type isn't valid since our key validation logic | |
| // Skip key warning if the type isn't valid since our key validation logic |
| var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. | ||
| // TODO: Drop this when these are no longer allowed as the type argument. | ||
|
|
||
| if (element == null) { |
There was a problem hiding this comment.
This guard always evaluates to false.
| var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. | ||
| // TODO: Drop this when these are no longer allowed as the type argument. | ||
|
|
||
| if (element == null) { |
There was a problem hiding this comment.
This guard always evaluates to false.
| var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. | ||
| // TODO: Drop this when these are no longer allowed as the type argument. | ||
|
|
||
| if (element == null) { |
There was a problem hiding this comment.
This guard always evaluates to false.
| REACT_BLOCK_TYPE = symbolFor('react.block'); | ||
| REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); | ||
| REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); | ||
| REACT_SCOPE_TYPE = symbolFor('react.scope'); |
There was a problem hiding this comment.
The value assigned to REACT_SCOPE_TYPE here is unused.
| REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); | ||
| REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); | ||
| REACT_SCOPE_TYPE = symbolFor('react.scope'); | ||
| REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); |
There was a problem hiding this comment.
The value assigned to REACT_OPAQUE_ID_TYPE here is unused.
| REACT_SCOPE_TYPE = symbolFor('react.scope'); | ||
| REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); | ||
| REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); | ||
| REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); |
There was a problem hiding this comment.
The value assigned to REACT_OFFSCREEN_TYPE here is unused.
| } // Fallback to just using the name if we couldn't make it throw. | ||
|
|
||
|
|
||
| var name = fn ? fn.displayName || fn.name : ''; |
There was a problem hiding this comment.
This use of variable 'fn' always evaluates to true.
| } // Fallback to just using the name if we couldn't make it throw. | ||
|
|
||
|
|
||
| var name = fn ? fn.displayName || fn.name : ''; |
There was a problem hiding this comment.
This use of variable 'fn' always evaluates to true.
No description provided.