@tramvai/module-client-hints 2.33.2 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -33,12 +33,26 @@ Client Hints modules provides the way to solve this problem in some way. It stor
|
|
|
33
33
|
|
|
34
34
|
#### First page loading
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
:::warn
|
|
37
|
+
|
|
38
|
+
When user enters the app for the first time, information about **real** device screen size and type **not available** in server-side code.
|
|
39
|
+
|
|
40
|
+
:::
|
|
41
|
+
|
|
42
|
+
This module tries to determine type of the user device using user-agent string, and separates the devices into three groups:
|
|
43
|
+
- `mobile`
|
|
44
|
+
- `tablet`
|
|
45
|
+
- `desktop`
|
|
46
|
+
|
|
47
|
+
Then it saves this **assumptive** information about device screen to `media` store. E.g. when user loads page from the desktop, then content of the `media` store will be following:
|
|
37
48
|
|
|
38
49
|
```tsx
|
|
39
50
|
const state = {
|
|
51
|
+
// desktop - 1024px, tablet - 600px, mobile - 300px
|
|
40
52
|
width: 1024,
|
|
53
|
+
// desktop - 768px, tablet - 800px, mobile - 500px
|
|
41
54
|
height: 768,
|
|
55
|
+
// desktop - false, tablet - true, mobile - true
|
|
42
56
|
isTouch: false,
|
|
43
57
|
retina: false,
|
|
44
58
|
supposed: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-client-hints",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.34.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/server.js",
|
|
6
6
|
"module": "lib/server.es.js",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"build-for-publish": "true"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tinkoff/user-agent": "0.4.
|
|
23
|
+
"@tinkoff/user-agent": "0.4.77",
|
|
24
24
|
"@tinkoff/utils": "^2.1.2",
|
|
25
25
|
"@tramvai/safe-strings": "0.5.5",
|
|
26
|
-
"@tramvai/tokens-common": "2.
|
|
27
|
-
"@tramvai/tokens-cookie": "2.
|
|
28
|
-
"@tramvai/tokens-child-app": "2.
|
|
26
|
+
"@tramvai/tokens-common": "2.34.0",
|
|
27
|
+
"@tramvai/tokens-cookie": "2.34.0",
|
|
28
|
+
"@tramvai/tokens-child-app": "2.34.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@tramvai/core": "2.
|
|
32
|
-
"@tramvai/state": "2.
|
|
31
|
+
"@tramvai/core": "2.34.0",
|
|
32
|
+
"@tramvai/state": "2.34.0",
|
|
33
33
|
"@tinkoff/dippy": "0.8.8",
|
|
34
34
|
"react": ">=16.14.0",
|
|
35
35
|
"react-dom": ">=16.14.0",
|