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

Nested Layouts #346

Closed
brillout opened this issue Jun 21, 2022 · 17 comments
Closed

Nested Layouts #346

brillout opened this issue Jun 21, 2022 · 17 comments
Labels

Comments

@brillout
Copy link
Member

brillout commented Jun 21, 2022

See https://vite-plugin-ssr.com/layouts#nested-layouts.

While the workaround works, its DX isn't ideal.

@brillout brillout added the enhancement 🚀 New feature or request label Jun 21, 2022
@Jearce
Copy link

Jearce commented Jul 25, 2022

This feature would be great to use in my current project. Currently, using the solution given here. Thank you!

@brillout
Copy link
Member Author

@Jearce Thanks for the comment! I'm busy with high prio things at the moment (e.g. bug/design fixes), but let me know if/when the current situation is getting too annoying for you. I'll then implement this.

@taylorfsteele
Copy link

+1 to this DX enhancement and parallel onBeforeRender() calls. Working on a project using the solution in the docs like @Jearce, but would still be a nice feature. Thanks!

@brillout
Copy link
Member Author

brillout commented Sep 5, 2022

FYI I'm still thinking about this. The design I will come up with may be quite different from what others are doing. Stay tuned.

For (other) readers: feel free to further push for this by adding a comment here.

@brillout
Copy link
Member Author

brillout commented Oct 5, 2022

The overall design is starting to crystalize.

The Single Route File design will play a central role here.

Stay tuned.

As always, if this is urgent for someone, then definitely let me know!

@binajmen
Copy link

(I follow your request to comment, as I'm interested as well 😉)

Switching to something-not-React + vite-plugin-ssr, and coming from Remix, I can tell you a nested layout feature would be appreciated ;)

@CanRau
Copy link
Contributor

CanRau commented Oct 28, 2022

I'm in the same boat, was missing Vite, or at least more configurability with Remix and React alternatives.

vite-plugin-ssr is definitely amazing though also missing some of Remix's simplicity 😇

@brillout
Copy link
Member Author

For folks who need/want improved Nested Layouts, please PM on discord.

@MrQinYQ
Copy link

MrQinYQ commented Nov 22, 2022

I want to use this feature. What should I do?

@brillout
Copy link
Member Author

PM on discord

@nitedani
Copy link
Member

nitedani commented Dec 17, 2022

The state of Page should be preserved on navigation to a sibling route. If it's a navigation to a sibling route, only swap out the pageContext.nested[0] in the context, don't run the client-side render entry.

@brillout
Copy link
Member Author

Yes the pageContext is preserved, but the onBeforeRender() of the nested view is (re-)run and the whole page's onRenderClient (the upcoming new name for the client-side render() hook) is re-run.

@lutzissler
Copy link

Also interested – nested views using the render() solution is working but bad DX.

@rossanmol
Copy link

This feature would simplify a lot of things in my projects ;) Looking forward for it.

@brillout
Copy link
Member Author

brillout commented May 9, 2023

Also interested – nested views using the render() solution is working but bad DX.

This feature would simplify a lot of things in my projects ;) Looking forward for it.

Thanks for the push.

FYI it's slowy but surely creeping towards the top of the TODO list.

Sponsoring much welcome to give it a signficant bump to the top.

And, as always, feel free to let me know and elaborte when the workaround becomes painful. That definitely makes a difference in priority as well.

@pencilcheck
Copy link

Sound like a good idea to have this DX. Please support if possible. Thanks!

@brillout
Copy link
Member Author

Closing in favor of improved docs https://vike.dev/Layout#nested-layouts and upcoming uproved DX #1459 (including deep integration with data fetching tools).

@brillout brillout closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants