Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Pope committed Sep 3, 2024
1 parent 87482f0 commit 24c51eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const EnvironmentConfigSchema = z.object({
/**
* Enables inlining ReactElement object literals in place of JSX
* An alternative to the standard JSX transform which replaces JSX with React's jsxProd() runtime
* Currently a prod-only optimizaiton, requiring Fast JSX features from React 19
* Currently a prod-only optimization, requiring Fast JSX dependencies
*/
enableInlineJsxTransform: z.boolean().default(false),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ function createPropsProperties(
return {refProperty, keyProperty, propsProperty};
}

// TODO: Make PROD only with conditional statements
export function inlineJsxTransform(fn: HIRFunction): void {
for (const [, block] of fn.body.blocks) {
let nextInstructions: Array<Instruction> | null = null;
Expand Down Expand Up @@ -301,6 +302,8 @@ export function inlineJsxTransform(fn: HIRFunction): void {
instr,
nextInstructions,
'$$typeof',
// TODO: Add this to config so we can switch between

Check failure on line 305 in compiler/packages/babel-plugin-react-compiler/src/Optimization/InlineJsxTransform.ts

View workflow job for this annotation

GitHub Actions / Lint babel-plugin-react-compiler

Expected a block comment instead of consecutive line comments
// react.element / react.transitional.element
'react.transitional.element',
),
createTagProperty(fn, instr, nextInstructions, instr.value.tag),
Expand Down Expand Up @@ -337,6 +340,8 @@ export function inlineJsxTransform(fn: HIRFunction): void {
instr,
nextInstructions,
'$$typeof',
// TODO: Add this to config so we can switch between

Check failure on line 343 in compiler/packages/babel-plugin-react-compiler/src/Optimization/InlineJsxTransform.ts

View workflow job for this annotation

GitHub Actions / Lint babel-plugin-react-compiler

Expected a block comment instead of consecutive line comments
// react.element / react.transitional.element
'react.transitional.element',
),
createSymbolProperty(
Expand Down

0 comments on commit 24c51eb

Please sign in to comment.