-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat(console): Improve UX by preventing screen flickering #133
Conversation
solid-router version 0.14.10 prevents the direct usage of useQuery in route components. Data prefetching or alternative strategies may be needed
packages/console/package.json
Outdated
"@hot-updater/plugin-core": "0.11.0" | ||
"@hot-updater/core": "0.10.1", | ||
"@hot-updater/plugin-core": "0.10.1", | ||
"@tanstack/solid-query": "^5.66.4" |
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.
move to devDeps
packages/console/src/App.tsx
Outdated
|
||
onMount(() => { | ||
setTimeout(() => { | ||
setOnSuspense(true); |
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.
why need this?
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 needed that before install @TanStack-Query, but now doesn't.
I will modify that logic soon.
db8e8a1
to
4457c44
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.
I did you said, Check plz
packages/console/src/App.tsx
Outdated
import Home from "./routes"; | ||
export const queryClient = new QueryClient(); |
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.
Since it is being provided through a provider, direct access from other places must be prevented.
export const queryClient = new QueryClient(); | |
const queryClient = new QueryClient(); |
const handleClose = () => { | ||
start(() => { | ||
setSelectedBundleId(null); | ||
queryClient.invalidateQueries({ queryKey: ["getBundles"] }); |
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.
Isn’t it okay if invalidate doesn’t happen when closing?
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.
handleClose
function is only activated with Clicking save button.
I think improving invalidation is safer.. but I don't think that has to be.
How about you? You don't think that as me?
const [data, { refetch }] = createResource(() => | ||
api.getBundles.$get().then((res) => res.json()), | ||
); | ||
const data = createQuery(() => ({ |
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.
It might be a good idea to extract it into hooks:
• useBundles() → returns all bundles
• useBundle(id) → returns a specific bundle
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.
Console already has that getBundelById(id) in EditBundleSheetContent
Component
I think getBundles is better in index.tsx
1. Splash screen displayed only on initial application entry. 2. Minimized data fetching frequency and eliminated visual flickering using @tanstack/solid-query's query key feature.
4457c44
to
d6d2b15
Compare
2025-02-21.11.39.21.mov
Closed #131