Skip to content
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

[UI v2] feat: Loads data and url state to concurrency limit route for UX to consume #16227

Merged

Conversation

devinvillarosa
Copy link
Contributor

@devinvillarosa devinvillarosa commented Dec 5, 2024

image

This PR focuses on passing data from react query cache and url state into the route component, which will be consumed by the page component

  1. Add a useSuspenseQuery wrapper.
  2. Adds search validator and loader to route and UX component
Screen.Recording.2024-12-05.at.4.24.30.PM.mov

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

Related to #15512

@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch from d3d5098 to 7131ab2 Compare December 5, 2024 01:42
@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch 4 times, most recently from 4146d73 to be83e4a Compare December 5, 2024 22:43
@devinvillarosa devinvillarosa marked this pull request as ready for review December 5, 2024 22:49
filter: GlobalConcurrencyLimitsFilter = { offset: 0 },
) => useSuspenseQuery(buildListGlobalConcurrencyLimitsQuery(filter));

useListGlobalConcurrencyLimits.loader = ({
Copy link
Contributor Author

@devinvillarosa devinvillarosa Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ended up using this .loader style for consistency with Variable.

But one principal I'm trying to keep in mind is

How do we keep our server data reusable throughout the webapp as it grows and evolve?

I think only exposing queryOptions and mutations exposed to the webapp gives this flexibility because you can feed it into different loaders, useQuery, useQueries, useSuspenseQuery, and useSuspenseQueries for different scenarios.

But let keep building more stuff to see some similar patterns

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could end up with multiple entry points. In most cases, you can use the prebuilt hooks (a la useVariables), but developers can import and use the query options factory in cases where more customization is needed.

@devinvillarosa devinvillarosa marked this pull request as draft December 6, 2024 00:25
@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch from be83e4a to d1fdb57 Compare December 6, 2024 00:25
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't get <Link> to style correctly when wrapping over TabsTrigger.

Opting to use navigation for now, even though semantics is a bit off

@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch from d1fdb57 to 07c4882 Compare December 6, 2024 00:28
@devinvillarosa devinvillarosa marked this pull request as ready for review December 6, 2024 00:33
@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch 2 times, most recently from 5476a4a to 6d4c42a Compare December 6, 2024 00:42
@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch 2 times, most recently from 7bb94a6 to 35d8240 Compare December 6, 2024 17:45
@devinvillarosa devinvillarosa force-pushed the add-loaders-and-data-to-concurrency-limit-route branch from 35d8240 to 8151ac2 Compare December 6, 2024 17:51
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@devinvillarosa devinvillarosa merged commit 09412d1 into main Dec 6, 2024
8 checks passed
@devinvillarosa devinvillarosa deleted the add-loaders-and-data-to-concurrency-limit-route branch December 6, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants