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

[Float][Fizz][Legacy] hoisted elements no longer emit before <html> in legacy apis such as renderToString() #27269

Merged
merged 1 commit into from
Aug 22, 2023

Commits on Aug 22, 2023

  1. renderToString is a legacy server API which used a trick to avoid hav…

    …ing the DOCTYPE included when rendering full documents by setting the root formatcontext to HTML_MODE rather than ROOT_HTML_MODE. Previously this was of little consequence but with Float the Root mode started to be used for things like determining if we could flush hoistable elements yet. In issue facebook#27177 we see that hoisted elements can appear before the <html> tag when using a legacy API `renderToString`.
    
    This change exports a DOCTYPE from FizzConfigDOM and FizzConfigDOMLegacy respectively, using an empty chunk in the legacy case. The only runtime perf cost here is that for legacy APIs there is an extra empty chunk to write when rendering a top level <html> tag which is trivial enough
    gnoff committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    1120c0e View commit details
    Browse the repository at this point in the history