QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.86k stars 1.31k forks source link

PROPOSAL: Change `<Content/>` name to a more descriptive name #902

Closed shairez closed 2 years ago

shairez commented 2 years ago

Is your feature request related to a problem?

Currently the component <Content/> that renders the _layout + page has a name that is too generic and doesn't really reveal the "magic" that goes behind the scenes.

Describe the solution you'd like

Because what's happening behind the scenes is that QwikCity uses the router info to know which files to render

We discussed 2 possible alternative names:

  1. <RouterOutlet/>
  2. <Page/>

Describe alternatives you've considered

described above

Additional context

We would like to open it for a vote:

πŸŽ‰ for <RouterOutlet/> πŸš€ for <Page/>

Please use the emoji of the name you prefer

mhevery commented 2 years ago

I don't think <RouterOutlet> is correct. You would expect that you would have exactly one <RouterOutlet> but you will actually have one for each layout component.

shairez commented 2 years ago

So you're saying that for each nested layout we would have to add a nested <RouterOutlet> ?

Isn't that the same concept as having nested routes and nested outlets accordingly like in client-side frameworks?

nnelgxorz commented 2 years ago

I hate to be the guy who is given two choices and picks 3 (especially when I suggested one of the two choices) but I have some more thoughts on this.

RouterOutlet feels off because it is so tied to client-side, SPA routing in my mind.

Page feels more comfortable to me, but I agree that it's incomplete because it's ignoring the idea of layouts.

My understanding of what Qwik City is doing is:

So, here's my suggested compromise: <Route/>

I like it because it's:

Curious about everyone's thoughts.

manucorporat commented 2 years ago

Layouts dont use RouterOutlet, or Content, just Slot, whatever this API is named, it’s using a single time to indicate where the routers will renders the layouts and page

adamdbradley commented 2 years ago

I think <RouterOutlet/> describes what it is, and a page would only have 1. Layouts on the other hand are just normal qwik components, and use the existing <Slot/> component for content projection.