Skip to content

Commit eb5e13b

Browse files
committed
Combine createElement and JSX modules
There's a ton of overlap between the createElement implementation and the JSX implementation, so I combined them into a single module. In the actual build output, the shared code between JSX and createElement will get duplicated anyway, because react/jsx-runtime and react (where createElement livs) are separate, flat build artifacts. So this is more about code organization — with a few key exceptions, the implementations of createElement and jsx are highly coupled.
1 parent 881e029 commit eb5e13b

8 files changed

+350
-844
lines changed

packages/react/src/ReactChildren.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from 'shared/ReactSymbols';
2525
import {checkKeyStringCoercion} from 'shared/CheckStringCoercion';
2626

27-
import {isValidElement, cloneAndReplaceKey} from './ReactElement';
27+
import {isValidElement, cloneAndReplaceKey} from './jsx/ReactJSXElement';
2828

2929
const SEPARATOR = '.';
3030
const SUBSEPARATOR = ':';

packages/react/src/ReactClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
createFactory,
3131
cloneElement,
3232
isValidElement,
33-
} from './ReactElement';
33+
} from './jsx/ReactJSXElement';
3434
import {createContext} from './ReactContext';
3535
import {lazy} from './ReactLazy';
3636
import {forwardRef} from './ReactForwardRef';

packages/react/src/ReactElement.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)