-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: Updates loader for concurrency limit route to include active task runs logic #16522
Conversation
66ac5e7
to
47333a6
Compare
active_slots: ["task_0"], | ||
}); | ||
|
||
const MOCK_TASK_RUNS: Array<components["schemas"]["TaskRun"]> = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you could use some of the mock generators in this test to decrease the verbosity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya, I think we might be able to centralize some of these mocks to use faker (with options to ovrrride), similar to how some storybook stories does it.
Just need to centralize them in a place so its known to be re-used between storybook and vitest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated latest push to:
- Centralize mocks using faker/js so they can be used between Storybook and Vitest
- Replaces verbose mocks for mocks above
* @param id | ||
* @returns query options for a task-run concurrency limit with active run details that includes details on task run, flow run, and flow | ||
*/ | ||
export const buildConcurrenyLimitDetailsActiveRunsQuery = (id: string) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is hitting our long-standing challenge of n+1 requests to the API. This handles the challenge well, but I'm a little concerned that all these calls are contained in one query, which is then used to suspend rendering until they've all been resolved.
There are a couple of things I'd like to explore:
- Breaking these calls into separate queries and only suspending rendering for critical data (like the concurrency limit info). We can also investigate using deferred loading with
@tanstack/router
to continue using data loaders without blocking rendering. - Update the task run routes to include the flow run name to avoid needing to make another call for the flow runs filter route. I don't know how feasible this is since we'll need to take DB performance into account.
I'll do some exploration in the deployments list, but let's make sure we compare notes because we'll want a consistent approach to this in the application!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I can do some more exploration as well.
I opted for this route because the prefetching and loading mechanism comes out of the box. Also, it seems like this is more data critical stuff too
This way seems to give a faster UX because the data is loaded upon hovering over the Links
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this video is a good explanation on the different options to sync data to the client: https://www.youtube.com/watch?v=AuHqwQsf64o&t=566s
Just need to determine how critical our data really is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest push uses the await/defer approach. I do see a bit better UX performance, but it feels minimal compared to throwing it all in useSuspense
230935e
to
d1d71ba
Compare
f281e5f
to
6f6f193
Compare
6f6f193
to
6b27c63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great! Thanks for the exploration and finding the right levers to pull to balance fetching critical data vs. not blocking rending!
...components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/index.tsx
Outdated
Show resolved
Hide resolved
6b27c63
to
fb12e3e
Compare
fb12e3e
to
abd8814
Compare
Checklist
<link to issue>
"mint.json
.Relates to #15512