Skip to content

Why not render to the document.body? #1143

@thednp

Description

@thednp

With the advent of new tech comes new opportunities, so I'm just wondering, if all gets modernized and re-invented, why not make the DOM faster by rendering/mounting directly into the document.body. Why not FIX this, IMO, broken pattern for good.

What I mean is: instead of having

<!-- the current output markup -->
<html>
  <head />
  <body>
    <div id="root">
      <header />
      <main />
      <footer />
    </div>
  </body>
</html>

with mounting directive render(App, document.getElementById('root'))...

We should have

<!-- the desired output markup -->
<html>
  <head />
  <body>
    <header />
    <main />
    <footer />
  </body>
</html>

with mounting directive render(App, document.body).

Wouldn't this make more sense for a faster and more modern things to come with say... SolidStart or Vite examples?

PS: I've asked you Ryan during your last stream but you ignored it, probably for good reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions