Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance committed Oct 26, 2023
1 parent 29a4ce3 commit 0c0b640
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/guides/add-a-shared-dependency.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 30
order: 20
label: Add a shared dependency
---

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion docs/guides/implement-a-custom-logger.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 20
order: 30
---

# Implement a custom logger
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/override-the-host-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
15 changes: 3 additions & 12 deletions docs/reference/routing/ManagedRoutes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <RootLayout />,
children: [
{
// Pathless route to declare a root error boundary.
$visibility: "public",
errorElement: <RootErrorBoundary />,
children: [
{
// Pathless route to declare an authenticated layout.
element: <AuthenticatedLayout />
children: [
ManagedRoutes
]
}
ManagedRoutes
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/runtime/runtime-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0c0b640

Please sign in to comment.