File tree 6 files changed +11
-11
lines changed
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
36
36
37
37
## The Problem
38
38
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.
42
42
43
43
For some of this you should have user preferences which can be persisted in a
44
44
cookie 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 '
2
2
3
3
export const clientHint = {
4
4
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 '
2
2
3
3
export type { ClientHint }
4
4
Original file line number Diff line number Diff line change 1
- import { type ClientHint } from './utils'
1
+ import { type ClientHint } from './utils.js '
2
2
3
3
export const clientHint = {
4
4
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 '
2
2
3
3
export const clientHint = {
4
4
cookieName : 'CH-time-zone' ,
Original file line number Diff line number Diff line change 1
1
import { 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 '
6
6
import assert from 'node:assert'
7
7
8
8
test ( 'client script works' , ( ) => {
You can’t perform that action at this time.
0 commit comments