-
-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: useLayout plugin and dynamic sizing #23
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # packages/0/src/composables/useLayout/index.ts
|
||
let observer: ResizeObserver | null = null | ||
|
||
if (IN_BROWSER && getCurrentInstance()) { |
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.
still using IN_BROWSER
? this can break Nuxt SSR, we'll need to add some "resolver" for 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.
if we just ran this onMounted would we run into weird hydration issues?
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.
We can, since we have suspense and the transition api, we need to use the app:suspense:resolve
: I use a pinia store + isReady (hydrated here), then on the hook we just update the pinia flag.
At docs app, we can use pinia + onMounted at default layout.
I guess maybe we don't need this hack if we can move the css in js to just css via some cssvar => the problem with the nav drawer (CLS) is about the useBreakpoint
=> indirect css in js (maybe we can move that code to the theme restoration script)
I'm going to play on my local trying to inline css styles and some vite-ssg build hooks + beasties
refactored layout to use as a plugin