When the user sets a `defaultGcTime` on the router or a `gcTime` on a route to the value of `0`, the current eager garbage collection we've got going on ends up setting the route-context to `undefined`.
This normally wouldn't matter on direct navigation, however, when redirects come into play this results in the route trying to execute its options (`beforeLoad`, `loader`, `component`, etc) without its processed route context being available. The current setup looks to perform garbage collection both before and after a `this.loadMatches` has been called in `router.load`.
This change makes it so that garbage collection is done after the `this.loadMatches` call has resolved.
* docs(examples): update the "authenticated routes" example with async actions
* refactor: oops didnt mean to touch that
* chore: put a comment on the sleep used on login
* docs: update the message on the home page
* chore: make sure the user can see stuff is happening during login
This will fix the example with useSuspenseQuery for the Router loader. You cannot just write `const posts = useSuspenseQuery(...)` but have to resolve the data property as so `const {data: {posts}} = useSuspenseQuery(...)`
* fix(react-router): context being undefined after a redirect
* test: move to tsx
* test: test cases and fail intentionally fail it
* fix: refix it to pass the test cases
Be sure to re-run generator after upgrading
* perf: get lazy? do less?, generate more
* feat: add support for objects for children at runtime
- add type tests for objects with children
- add runtime support for objects with children
- add runtime tests for objects with children
* perf: apply similar optimisations for merging for code based
* perf: improve performance of LinkProps when passed to `Link`
* exmaples: add to large based file examples search, params and context
* docs: add TS performance recommendations to docs
* fix: remove route groups from id
* examples: update linkprops examples
* docs: update docs based on comments
* chore: remove export of `LinkComponentProps`
* chore: clean up PR
---------
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
* test: tests for layouts without an underscore id
* test: correct the tests here
* fix: dont use the removeLayoutSegments and rework how this works
* chore: remove `@typescript-eslint/no-unnecessary-type-assertion` from router.ts
* chore: nuke the `removeLayoutSegments` function
* chore: stop eslint from freaking out