File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed
Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ npm install @epic-web/client-hints
3636
3737## The Problem
3838
39- Sometimes your server rendered code needs to know something about the client that
40- the browser doesn't send. For example, the server might need to know the user's
41- preferred language, or whether the user prefers light or dark mode.
39+ Sometimes your server rendered code needs to know something about the client
40+ that the browser doesn't send. For example, the server might need to know the
41+ user's preferred language, or whether the user prefers light or dark mode.
4242
4343For some of this you should have user preferences which can be persisted in a
4444cookie or a database, but you can't do this for first-time visitors. All you can
Original file line number Diff line number Diff line change 1- import { type ClientHint } from './utils'
1+ import { type ClientHint } from './utils.js '
22
33export const clientHint = {
44 cookieName : 'CH-prefers-color-scheme' ,
Original file line number Diff line number Diff line change 1- import { ClientHint , ClientHintsValue } from './utils'
1+ import { ClientHint , ClientHintsValue } from './utils.js '
22
33export type { ClientHint }
44
Original file line number Diff line number Diff line change 1- import { type ClientHint } from './utils'
1+ import { type ClientHint } from './utils.js '
22
33export const clientHint = {
44 cookieName : 'CH-reduced-motion' ,
Original file line number Diff line number Diff line change 1- import { type ClientHint } from './utils'
1+ import { type ClientHint } from './utils.js '
22
33export const clientHint = {
44 cookieName : 'CH-time-zone' ,
Original file line number Diff line number Diff line change 11import { test } from 'node:test'
2- import { getHintUtils } from '../src'
3- import { clientHint as colorSchemeHint } from '../src/color-scheme'
4- import { clientHint as timeZoneHint } from '../src/time-zone'
5- import { clientHint as reducedMotionHint } from '../src/reduced-motion'
2+ import { getHintUtils } from '../src/index.js '
3+ import { clientHint as colorSchemeHint } from '../src/color-scheme.js '
4+ import { clientHint as timeZoneHint } from '../src/time-zone.js '
5+ import { clientHint as reducedMotionHint } from '../src/reduced-motion.js '
66import assert from 'node:assert'
77
88test ( 'client script works' , ( ) => {
You can’t perform that action at this time.
0 commit comments