solidjs / solid-start

SolidStart, the Solid app framework
https://start.solidjs.com
MIT License
4.93k stars 371 forks source link

Parallel routes #1537

Open Brendonovich opened 2 weeks ago

Brendonovich commented 2 weeks ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

Start's FS Routing doesn't support parallel routes

What is the new behavior?

Putting @ at the start of a filesystem route segment turns it into a slot for a parallel route, as detailed in https://github.com/solidjs/solid-router/pull/426.

Implementing the example config from https://github.com/solidjs/solid-router/pull/426 would look something like this with FS routing (and flat routing from #1482 for conciseness):

routes/
  (app).tsx - {props.slots.breadcrumbs} <main>{props.children}</main>
  (app)/
    o.[orgSlug]/
        index.tsx - "Org Information"
        t.[tenantSlug].tsx - "Tenant Information"
    @breadcrumbs.tsx - <header>{props.children}</header>
    @breadcrumbs/
      o.[orgSlug].tsx - <span>Org Breadcrumb</span> {props.children}
      o.[orgSlug]/
        [...rest].tsx - ensures breadcrumb is matched on all org routes
        t.[tenantSlug].tsx - <span>Tenant Breadcrumb</span>
        t.[tenantSlug]/
          [...rest].tsx - ensures breadcrumb is matched on all tenant routes

Other information

changeset-bot[bot] commented 2 weeks ago

🦋 Changeset detected

Latest commit: 07e366d229476e8ae7e0fa424cd23ccb4140e0fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------- | ----- | | @solidjs/start | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR