zetkin / lyra

3 stars 3 forks source link

Upgrade to Next v14 #95

Closed henrycatalinismith closed 5 months ago

henrycatalinismith commented 5 months ago

The work I'm doing in https://github.com/zetkin/lyra/compare/issue-73/translation-page?expand=1 uses a Next 14 feature called parallel routes. So there's currently a Next 14 upgrade buried in that diff, and it seems like an excellent candidate to extract into its own dedicated pull request.

richardolsson commented 5 months ago

Very interesting with the "parallel routes" feature. Why is it superior for this feature, compared to just having a layout with the sidebar in it, and then render the children on the right with whatever filtered content the URL dictates?

henrycatalinismith commented 5 months ago

This is actually quite a fun question and im going to throw together a little demo project to answer it.

henrycatalinismith commented 5 months ago

Here you go! Check out https://github.com/henrycatalinismith/next-routing-comparison. The executive summary is that parallel routes are the only way to satisfy all the following constraints:

henrycatalinismith commented 5 months ago

Building that helped me understand this whole area a lot better. I now see that only the sidebar should be a slot, and the main content should not be nested in a @main directory, but rather rendered as the plain old children of the layout,

WULCAN commented 4 months ago

I made another attempt at this in #103