@tramvai/module-server 5.50.0 → 5.53.78
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/lib/modules/debugRequests.es.js +2 -4
- package/lib/modules/debugRequests.js +2 -4
- package/lib/modules/earlyHints/service.es.js +4 -1
- package/lib/modules/earlyHints/service.js +4 -1
- package/lib/server/taskManager.es.js +3 -5
- package/lib/server/taskManager.js +3 -5
- package/lib/server/webApp.es.js +3 -2
- package/lib/server/webApp.js +3 -2
- package/package.json +19 -19
|
@@ -10,10 +10,8 @@ import http from 'http';
|
|
|
10
10
|
import https from 'https';
|
|
11
11
|
|
|
12
12
|
class Interceptor {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.delay = 0;
|
|
16
|
-
}
|
|
13
|
+
intercepted = false;
|
|
14
|
+
delay = 0;
|
|
17
15
|
setIntercept(intercept) {
|
|
18
16
|
this.intercepted = intercept;
|
|
19
17
|
}
|
|
@@ -20,10 +20,8 @@ var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
|
|
20
20
|
var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
|
|
21
21
|
|
|
22
22
|
class Interceptor {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.delay = 0;
|
|
26
|
-
}
|
|
23
|
+
intercepted = false;
|
|
24
|
+
delay = 0;
|
|
27
25
|
setIntercept(intercept) {
|
|
28
26
|
this.intercepted = intercept;
|
|
29
27
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
class EarlyHintsManager {
|
|
2
|
+
sentHints = new Set();
|
|
3
|
+
response;
|
|
4
|
+
resourcesRegistry;
|
|
5
|
+
earlyHintsEnabled;
|
|
2
6
|
constructor(payload) {
|
|
3
|
-
this.sentHints = new Set();
|
|
4
7
|
this.response = payload.response;
|
|
5
8
|
this.resourcesRegistry = payload.resourcesRegistry;
|
|
6
9
|
this.earlyHintsEnabled = payload.earlyHintsEnabled;
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
class EarlyHintsManager {
|
|
6
|
+
sentHints = new Set();
|
|
7
|
+
response;
|
|
8
|
+
resourcesRegistry;
|
|
9
|
+
earlyHintsEnabled;
|
|
6
10
|
constructor(payload) {
|
|
7
|
-
this.sentHints = new Set();
|
|
8
11
|
this.response = payload.response;
|
|
9
12
|
this.resourcesRegistry = payload.resourcesRegistry;
|
|
10
13
|
this.earlyHintsEnabled = payload.earlyHintsEnabled;
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
class ServerResponseTaskManager {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.status = 'idle';
|
|
10
|
-
}
|
|
6
|
+
tasks = [];
|
|
7
|
+
processedTasks = [];
|
|
8
|
+
status = 'idle';
|
|
11
9
|
push(task) {
|
|
12
10
|
if (this.status === 'closed') {
|
|
13
11
|
return;
|
package/lib/server/webApp.es.js
CHANGED
|
@@ -122,8 +122,9 @@ const webAppInitCommand = ({ app, logger, commandLineRunner, executionContextMan
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
catch (err) {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
const storage = asyncLocalStorage.getStore();
|
|
126
|
+
if (storage && storage.tramvaiRequestDi) {
|
|
127
|
+
const responseManager = storage.tramvaiRequestDi.get(RESPONSE_MANAGER_TOKEN);
|
|
127
128
|
if (responseManager && !reply.sent) {
|
|
128
129
|
reply.headers(responseManager.getHeaders());
|
|
129
130
|
}
|
package/lib/server/webApp.js
CHANGED
|
@@ -131,8 +131,9 @@ const webAppInitCommand = ({ app, logger, commandLineRunner, executionContextMan
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
catch (err) {
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
const storage = asyncLocalStorage.getStore();
|
|
135
|
+
if (storage && storage.tramvaiRequestDi) {
|
|
136
|
+
const responseManager = storage.tramvaiRequestDi.get(tokensCommon.RESPONSE_MANAGER_TOKEN);
|
|
136
137
|
if (responseManager && !reply.sent) {
|
|
137
138
|
reply.headers(responseManager.getHeaders());
|
|
138
139
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-server",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.53.78",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -26,32 +26,32 @@
|
|
|
26
26
|
"@fastify/formbody": "^7.4.0",
|
|
27
27
|
"@fastify/static": "^6.9.0",
|
|
28
28
|
"@loadable/server": "^5.15.0",
|
|
29
|
-
"@tinkoff/errors": "0.6.
|
|
29
|
+
"@tinkoff/errors": "0.6.3",
|
|
30
30
|
"@tinkoff/monkeypatch": "5.0.2",
|
|
31
|
-
"@tinkoff/terminus": "0.4.
|
|
32
|
-
"@tinkoff/url": "0.11.
|
|
33
|
-
"@tramvai/module-cache-warmup": "5.
|
|
34
|
-
"@tramvai/module-metrics": "5.
|
|
35
|
-
"@tramvai/papi": "5.
|
|
31
|
+
"@tinkoff/terminus": "0.4.3",
|
|
32
|
+
"@tinkoff/url": "0.11.3",
|
|
33
|
+
"@tramvai/module-cache-warmup": "5.53.78",
|
|
34
|
+
"@tramvai/module-metrics": "5.53.78",
|
|
35
|
+
"@tramvai/papi": "5.53.78",
|
|
36
36
|
"@tramvai/safe-strings": "0.8.4",
|
|
37
|
-
"@tramvai/tokens-router": "5.
|
|
38
|
-
"@tramvai/tokens-server": "5.
|
|
39
|
-
"@tramvai/tokens-server-private": "5.
|
|
37
|
+
"@tramvai/tokens-router": "5.53.78",
|
|
38
|
+
"@tramvai/tokens-server": "5.53.78",
|
|
39
|
+
"@tramvai/tokens-server-private": "5.53.78",
|
|
40
40
|
"afterframe": "^1.0.2",
|
|
41
41
|
"fastify": "^4.14.1",
|
|
42
42
|
"http-proxy-middleware": "^2.0.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@tinkoff/dippy": "0.11.
|
|
45
|
+
"@tinkoff/dippy": "0.11.5",
|
|
46
46
|
"@tinkoff/utils": "^2.1.2",
|
|
47
|
-
"@tramvai/cli": "5.
|
|
48
|
-
"@tramvai/core": "5.
|
|
49
|
-
"@tramvai/module-common": "5.
|
|
50
|
-
"@tramvai/module-environment": "5.
|
|
51
|
-
"@tramvai/react": "5.
|
|
52
|
-
"@tramvai/tokens-common": "5.
|
|
53
|
-
"@tramvai/tokens-core-private": "5.
|
|
54
|
-
"@tramvai/tokens-render": "5.
|
|
47
|
+
"@tramvai/cli": "5.53.78",
|
|
48
|
+
"@tramvai/core": "5.53.78",
|
|
49
|
+
"@tramvai/module-common": "5.53.78",
|
|
50
|
+
"@tramvai/module-environment": "5.53.78",
|
|
51
|
+
"@tramvai/react": "5.53.78",
|
|
52
|
+
"@tramvai/tokens-common": "5.53.78",
|
|
53
|
+
"@tramvai/tokens-core-private": "5.53.78",
|
|
54
|
+
"@tramvai/tokens-render": "5.53.78",
|
|
55
55
|
"react": ">=16.14.0",
|
|
56
56
|
"react-dom": ">=16.14.0",
|
|
57
57
|
"tslib": "^2.4.0"
|