-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SSR HTTP Client Hints support (#99)
* feat(test): implement Client Hints for SSR * chore: remove `Accept-CH` from `app.meta.head` * chore: add initial support for width and height * chore: dont watch display on client * docs: add SSR warning about resizing window while loading * docs(ssr): added caveat for viewport headers * reorder * updates * wip * wip * chore: color scheme support via cookie * chore: update load config and theme client logic * chore: bump to pnpm 8.7.5 * chore: add browser detection and initial client impl * fix: remove viewport mismatch hydration warning when browser doesn't support client hints * chore: include Edge and refactor client logic * chore: include browser version check and tests * chore: add reload on first request support * tests: added safari tests in detect-browser.test.ts (#104) * tests: added safari tests in detect-browser.test.ts (#105) * tests: added safari tests in detect-browser.test.ts * tests: added firefox macos tests in detect browser * fix: cookie theme * chore: refactor some function names and types * chore: refactor virtual + add browser theme preference * chore: disable `useBrowserThemeOnly` in playground * docs: include `useBrowserThemeOnly` + cleanup * chore(client): create theme cookie on first request using the theme before reloading * docs: final review * docs: . * docs: . * chore: extract state name to client-hints module --------- Co-authored-by: JD Solanki <jdsolanki0001@gmail.com>
- Loading branch information
1 parent
8acd88b
commit aaf4226
Showing
26 changed files
with
1,350 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export interface ClientHintRequestFeatures { | ||
firstRequest: boolean | ||
prefersColorSchemeAvailable: boolean | ||
prefersReducedMotionAvailable: boolean | ||
viewportHeightAvailable: boolean | ||
viewportWidthAvailable: boolean | ||
} | ||
export interface ClientHintsRequest extends ClientHintRequestFeatures { | ||
prefersColorScheme?: 'dark' | 'light' | 'no-preference' | ||
prefersReducedMotion?: 'no-preference' | 'reduce' | ||
viewportHeight?: number | ||
viewportWidth?: number | ||
colorSchemeFromCookie?: string | ||
colorSchemeCookie?: string | ||
} | ||
|
||
export interface SSRClientHints { | ||
ssrClientHints: ClientHintsRequest | ||
} | ||
|
||
export const VuetifyHTTPClientHints = 'vuetify:nuxt:ssr-client-hints' |
Oops, something went wrong.