Skip to content
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

Refactor React Server entrypoint to not depend on the client one #27940

Merged
merged 3 commits into from
Jan 17, 2024

Commits on Jan 17, 2024

  1. Move createElement resolution out of entry module

    The implementation of createElement is different in production and
    development. This moves the DEV check out of the entry module and into
    the ReactElement module.
    
    There was already a TODO comment for this; I'm doing it now because I'm
    about to refactor the server entry module (ReactServer.js) to import
    createElement directly instead of going through the client entry module
    (React.js, which I'll also probably rename to ReactClient.js).
    acdlite committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    ec0e8b0 View commit details
    Browse the repository at this point in the history
  2. Refactor Server entrypoint to not import Client

    This refactors the Server Components entrypoint for the `react` package
    (ReactServer.js) so that it doesn't depend on the client entrypoint
    (React.js). In the next step, I'll also rename React.js to
    ReactClient.js to make the separation clearer.
    
    This structure will make it easier to add client-only and server-
    only features.
    acdlite committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    4a072ac View commit details
    Browse the repository at this point in the history
  3. Rename React.js entrypoint to ReactClient.js

    The server entrypoint no longer depends on this module. It's now only
    imported by the client. I've updated the name to reflect that it's
    client-only, and can include client-only features.
    acdlite committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    7570348 View commit details
    Browse the repository at this point in the history