-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding public and protected outlets (#195)
* More stuff * More stuff * More stuff * More stuff * More stuff * Added changeset file * Fix CI
- Loading branch information
1 parent
704b495
commit 98e4839
Showing
35 changed files
with
757 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
"@squide/react-router": minor | ||
"@squide/firefly": minor | ||
"@squide/core": minor | ||
--- | ||
|
||
Replaced the `ManagedRoutes` placeholder by the `PublicRoutes` and `ProtectedRoutes` placeholder. | ||
|
||
Before: | ||
|
||
```tsx | ||
import { ManagedRoutes, type ModuleRegisterFunction, type FireflyRuntime } from "@squide/firefly"; | ||
import { RootLayout } from "./RootLayout.tsx"; | ||
|
||
export const registerHost: ModuleRegisterFunction<FireflyRuntime> = runtime => { | ||
runtime.registerRoute({ | ||
element: <RootLayout />, | ||
children: [ | ||
ManagedRoutes | ||
] | ||
}, { | ||
hoist: true | ||
}); | ||
}; | ||
``` | ||
|
||
Now: | ||
|
||
```tsx | ||
import { PublicRoutes, ProtectedRoutes, type ModuleRegisterFunction, type FireflyRuntime } from "@squide/firefly"; | ||
import { RootLayout } from "./RootLayout.tsx"; | ||
|
||
export const registerHost: ModuleRegisterFunction<FireflyRuntime> = runtime => { | ||
runtime.registerRoute({ | ||
element: <RootLayout />, | ||
children: [ | ||
PublicRoutes, | ||
ProtectedRoutes | ||
] | ||
}, { | ||
hoist: true | ||
}); | ||
}; | ||
``` | ||
|
||
Or: | ||
|
||
```tsx | ||
import { PublicRoutes, ProtectedRoutes, type ModuleRegisterFunction, type FireflyRuntime } from "@squide/firefly"; | ||
import { RootLayout } from "./RootLayout.tsx"; | ||
|
||
export const registerHost: ModuleRegisterFunction<FireflyRuntime> = runtime => { | ||
runtime.registerRoute({ | ||
element: <RootLayout />, | ||
children: [ | ||
PublicRoutes, | ||
{ | ||
element: <AuthenticationBoundary />, | ||
children: [ | ||
{ | ||
element: <AuthenticatedLayout />, | ||
children: [ | ||
ProtectedRoutes | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, { | ||
hoist: true | ||
}); | ||
}; | ||
``` | ||
|
||
This release also includes a new `runtime.registerPublicRoute()` function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.