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

[Fizz] Implement renderDocument #25970

Closed
wants to merge 11 commits into from
Closed

Commits on Jan 16, 2023

  1. implement renderIntoContainer

    renderIntoContainer allows you to stream react into a specific DOM node identified by a element ID.
    
    It returns a ReadableStream but differs from renderToReadableStream in that you get access to the stream syncronously.
    
    Since the top level Component gets inserted like a boundary I am calling what would normally be the "Shell" of a React app the Root Boundary when using renderIntoContainer. While the top level Components stream in like a boundary there is not actually a Suspense Boundary wrapper. However it will act like one in that stylesheets will be loaded before the content is revealed in the container Node. If stylehseet loading fails hydration will fall back to client rendering
    
    It allows the passing of fallback bootstrap scripts which are used if the Root Boundary errors.
    gnoff committed Jan 16, 2023
    Configuration menu
    Copy the full SHA
    90d4c87 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d19b102 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c2c4a3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8be28e5 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2023

  1. refactor root boundary ID out of responseState and eliminate forking …

    …in instruction writing
    gnoff committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    f472e4b View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2023

  1. Configuration menu
    Copy the full SHA
    d6002cf View commit details
    Browse the repository at this point in the history
  2. revert change to ReactVersion

    gnoff committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    3273db7 View commit details
    Browse the repository at this point in the history
  3. reduce stack assignment

    gnoff committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    9bad42a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8e5cd60 View commit details
    Browse the repository at this point in the history
  5. Implement renderIntoDocument

    This commit adds the function renderIntoDocument in react-dom/server and adds the ability to embed the rendered children in the necessary html tags to repereset a full document. this means you can render "<html>...</html>" or "<div>...</div>" and either way the render will emit html, head, and body tags as necessary to describe a valid and complete HTML page.
    
    Like renderIntoContainer, renderIntoDocument provides a stream immediately. While there is a shell of sorts this fucntion will start writing content from the preamble (html and head tags, plus resources that flush in the head) before finishing the shell.
    
    Additionally renderIntoContainer accepts fallback children and fallback bootstrap script options. If the Shell errors the  fallback children will render instead of children. The expectation is that the client will attempt to render fresh on the client.
    gnoff committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    3ec1561 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    15e4c45 View commit details
    Browse the repository at this point in the history