8000 refactor: zero duplicate queries by greatgitsby · Pull Request #483 · commaai/new-connect · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: zero duplicate queries #483

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

Closed

Conversation

greatgitsby
Copy link
Contributor

just a wip; store current metadata in a Context

won't end up merging this, will break it up if we like it

Copy link
github-actions bot commented Apr 4, 2025

This branch is behind commaai/master. The line count diff bot is disabled.

Copy link
github-actions bot commented Apr 4, 2025

deployed preview: https://483.connect-d5y.pages.dev

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

Mobile

Desktop

@greatgitsby greatgitsby force-pushed the refactor/zero-dupe-queries branch from 4dec73a to 62876a6 Compare April 4, 2025 05:23
@sshane
Copy link
Contributor
sshane commented Apr 4, 2025

Doesn't seem to load yet

@greatgitsby
Copy link
Contributor Author

its very broken rn, give me a few

@greatgitsby
Copy link
Contributor Author
greatgitsby commented Apr 4, 2025

loads now but it's way more buggy

the edge case is when the user loads a route directly. hacking the fallback to state is not working consistently. not to mention it's disgusting

@greatgitsby
Copy link
Contributor Author

i'll play with this idea some more later, or anyone's welcome to pull this and play with it locally

@greatgitsby
Copy link
Contributor Author

man, it absolutely rips though... this is the sort of speed we can expect with no dupe queries

Comment on lines +51 to +55
export const useAppContext = () => {
const context = useContext(AppContext)
if (!context) throw new Error('Could not find an AppContext!')
return context
}
Copy link
Contributor
@sshane sshane Apr 5, 2025

Choose a reason for hiding this comment

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

What does all this get us over global signals like commaai/connect#503?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

flexible usage. you import this wherever you need it without having to pass signals down the component tree

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i left more analysis on your PR

Copy link
Contributor

Choose a reason for hiding this comment

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

We can do that with global signals AFAIK too

@greatgitsby greatgitsby closed this Apr 6, 2025
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
0