From 0c0b640a5574ca5a420b1dac7067550c3e491023 Mon Sep 17 00:00:00 2001 From: patricklafrance Date: Wed, 25 Oct 2023 22:47:21 -0400 Subject: [PATCH] More docs --- docs/guides/add-a-shared-dependency.md | 2 +- docs/guides/default.md | 2 +- docs/guides/implement-a-custom-logger.md | 2 +- docs/guides/override-the-host-layout.md | 2 +- docs/reference/routing/ManagedRoutes.md | 15 +++------------ docs/reference/runtime/runtime-class.md | 2 +- 6 files changed, 8 insertions(+), 17 deletions(-) diff --git a/docs/guides/add-a-shared-dependency.md b/docs/guides/add-a-shared-dependency.md index bebed6aa6..27c528de9 100644 --- a/docs/guides/add-a-shared-dependency.md +++ b/docs/guides/add-a-shared-dependency.md @@ -1,5 +1,5 @@ --- -order: 30 +order: 20 label: Add a shared dependency --- diff --git a/docs/guides/default.md b/docs/guides/default.md index 03b77654b..855b6b557 100644 --- a/docs/guides/default.md +++ b/docs/guides/default.md @@ -11,7 +11,7 @@ expanded: true - [Add authentication](./add-authentication.md) - [Develop a module in isolation](./develop-a-module-in-isolation.md) - [Federated tabs](./federated-tabs.md) -- [Add a shared dependency](./add-a-shared-dependency.md) - [Implement a custom logger](./implement-a-custom-logger.md) +- [Add a shared dependency](./add-a-shared-dependency.md) - [Override a React context](./override-a-react-context.md) - [Migrating from a monolithic application](./migrating-from-a-monolith.md) diff --git a/docs/guides/implement-a-custom-logger.md b/docs/guides/implement-a-custom-logger.md index 291a035a5..446025739 100644 --- a/docs/guides/implement-a-custom-logger.md +++ b/docs/guides/implement-a-custom-logger.md @@ -1,5 +1,5 @@ --- -order: 20 +order: 30 --- # Implement a custom logger diff --git a/docs/guides/override-the-host-layout.md b/docs/guides/override-the-host-layout.md index 5aa1accbe..aa9a5ec31 100644 --- a/docs/guides/override-the-host-layout.md +++ b/docs/guides/override-the-host-layout.md @@ -71,7 +71,7 @@ export function RootLayout() { } ``` -In the previous code sample, the `RootLayout` serves as the default layout for the homepage as well as for every page (route) registered by a module that are not nested with either the [parentPath](../reference/runtime/runtime-class.md#register-nested-routes-under-an-existing-route) or the [parentName](../reference/runtime/runtime-class.md#register-a-named-route) option. +In the previous code sample, the `RootLayout` serves as the default layout for the homepage as well as for every page (route) registered by a module that are not nested under a parent route with either the [parentPath](../reference/runtime/runtime-class.md#register-nested-routes-under-an-existing-route) or the [parentName](../reference/runtime/runtime-class.md#register-a-named-route) option. For most pages, this is the behavior expected by the author. However, for pages such as a login, the default `RootLayout` isn't suitable because the page is not bound to a user session (the user is not even authenticated yet). diff --git a/docs/reference/routing/ManagedRoutes.md b/docs/reference/routing/ManagedRoutes.md index 997e4ef44..24b772d66 100644 --- a/docs/reference/routing/ManagedRoutes.md +++ b/docs/reference/routing/ManagedRoutes.md @@ -25,31 +25,22 @@ None ## Usage -The registration of the route including the `ManagedRoutes` placeholder must be [hoisted](../runtime/runtime-class.md#register-an-hoisted-route), otherwise there will be an infinite loop as the placeholder will render in the placeholder. +The route including the `ManagedRoutes` placeholder must be [hoisted](../runtime/runtime-class.md#register-an-hoisted-route); otherwise, there will be an infinite loop as the `ManagedRoutes` placeholder will render within itself. -```tsx !#20,27 shell/src/register.tsx +```tsx !#13,18 shell/src/register.tsx import { ManagedRoutes } from "@squide/react-router"; import { RootLayout } from "./RootLayout.tsx"; import { RootErrorBoundary } from "./RootErrorBoundary.tsx"; -import { AuthenticatedLayout } from "./AuthenticatedLayout.tsx"; runtime.registerRoute({ // Pathless route to declare a root layout. - $visibility: "public", element: , children: [ { // Pathless route to declare a root error boundary. - $visibility: "public", errorElement: , children: [ - { - // Pathless route to declare an authenticated layout. - element: - children: [ - ManagedRoutes - ] - } + ManagedRoutes ] } ] diff --git a/docs/reference/runtime/runtime-class.md b/docs/reference/runtime/runtime-class.md index 15c01f2dd..29e0de021 100644 --- a/docs/reference/runtime/runtime-class.md +++ b/docs/reference/runtime/runtime-class.md @@ -128,7 +128,7 @@ runtime.registerRoute({ }); ``` -[!ref text="For a detailed walkthrough, read the how to override the host layout guide"](../../guides/override-the-host-layout.md) +[!ref text="For a detailed walkthrough, refer to the how to override the host layout guide"](../../guides/override-the-host-layout.md) ### Register a public route