-
-
Notifications
You must be signed in to change notification settings - Fork 860
Move route data to Astro.locals
#2390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
db2f072
Add route data to `Astro.locals`
delucis 988c554
Use local instead of props in Starlight’s components
delucis 286e9c8
Refactor route components
delucis 34129ab
Merge branch 'main' into chris/locals-route-data
delucis 9aa7f35
Merge branch 'main' into chris/locals-route-data
delucis 990bc51
Merge branch 'main' into chris/locals-route-data
delucis 28039b4
Fix 404 render
delucis 08c18a7
Make `routeData` a getter to avoid null checks in components
delucis 52a13fe
Move 404 route data logic up out of components
delucis c1ffade
Fix SSR 404s
delucis e7ced3d
Rename `routeData` => `starlightRoute`
delucis 8c67752
Merge branch 'main' into chris/locals-route-data
delucis 243786a
Draft docs & schema
delucis a547e92
Add default and description in middleware config schema
delucis 8f44f89
Tweak proposed middleware API in docs
delucis 2cc0a8f
Move route data docs to dedicated reference page
delucis c21fba9
Update component overrides guide to match locals usage
delucis 1e79b85
Add reference link to guide
delucis f150aba
Update config test snapshot
delucis 840fd32
Fix links in English pages
delucis 8db3c72
Merge branch 'main' into chris/locals-route-data
delucis 6d0c68b
Refactor routing utilities to avoid type issues
delucis 67cb8ed
Also move `StarlightRouteData` type
delucis 33e6d53
More type refactoring
delucis bac78a0
Remove deprecated `labels` prop from route data
delucis 2f19039
Add virtual module that exports route middleware
delucis f6f9af5
Add new dependency to deep clone route data
delucis 0107e9a
Run user middleware when adding route data to pages
delucis 72a9577
FIx tests
delucis b362c7a
Remove unused import
delucis 72f3bfb
Merge branch 'main' into chris/locals-route-data
delucis 9aa3461
Add changeset for move of route data to locals
delucis 3a30a0b
Remove props type import in DocSearch component
delucis 503b46d
Step up and Badge on (#2778)
trueberryless c8e26f8
Create `@astrojs/starlight/route-data` module to export utilities
delucis 4eb3adf
Export `StarlightRouteData` type
delucis eb0357f
Deprecate the old override props export
delucis 4e1e936
`pnpm format`
delucis a7eebad
Document `defineRouteMiddleware()` and `StarlightRouteData` type
delucis 7554878
Reorganise `Props` type deprecation to fix JSDoc tooltip
delucis 18faac2
Add a demo route middleware file
delucis e5df5ec
Merge branch 'main' into chris/locals-route-data
delucis 3c91de4
Use `AstroError` for invalid plugin config mutation
delucis 0ec6e4e
Add support for `next()` callback to middleware system
delucis bb35c02
Implement `addRouteMiddleware()` plugin API
delucis b4acdb6
Add tests
delucis 621a59e
Document support for multiple user middleware and use of `next()`
delucis 3cb40cd
Document `addRouteMiddleware()` plugin API
delucis b87650c
Fix `injectTranslations()` type in plugin quick API docs
delucis 15da794
Fix typo
delucis 650e14c
Update virtual module types to include `next()`
delucis a743cee
deprecated > not required
delucis ca6f249
More extensive comment
delucis 47988d4
Move route data generation to route component
delucis 50bec23
Add tests for starlightRoute getter
delucis 765beca
Handle route data for SSR route
delucis 0de3e36
Fix missing `next` type in middleware handler type
delucis ca58aed
Add `order: default` to `addRouteMiddleware` types in docs and tweak …
delucis 9ad43c1
Merge branch 'main' into chris/locals-route-data
delucis 13d2038
Switch to alternative SSR approach more close to what we already did
delucis 883d4a5
Add doc comments to `locals` types
delucis 56621a6
Merge branch 'main' into chris/locals-route-data
delucis 5471975
Improve `starlightRoute` error message
delucis 102bd61
Fix test snapshot of error message
delucis 43b67a3
`this` > `that`
delucis 6d05cd9
Docs pass
delucis 8a41943
Remove demo middleware from docs
delucis 9f3475a
Fix broken links
delucis bd785d9
Update Docsearch plugin peer dependency version
delucis 8238a86
Add DocSearch plugin changeset
delucis 1820dec
Merge branch 'main' into chris/locals-route-data
delucis 1ffda84
Fix type that got lost in the merge
delucis 0496d99
Removes DocSearch plugin changeset as one was already added to the sa…
delucis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Export
StarlightRouteData type
- Loading branch information
commit 4eb3adfa5ca8fa561e95966cefb86f5df1a205c5
There are no files selected for viewing
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.