@tramvai/module-server 2.90.0 → 2.92.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { declareModule, provide } from '@tramvai/core';
|
|
2
2
|
import { COMMAND_LINE_EXECUTION_END_TOKEN } from '@tramvai/tokens-core-private';
|
|
3
3
|
import { RESPONSE_MANAGER_TOKEN } from '@tramvai/tokens-common';
|
|
4
|
+
import { FASTIFY_RESPONSE } from '@tramvai/tokens-server-private';
|
|
4
5
|
|
|
5
6
|
const ServerTimingModule = declareModule({
|
|
6
7
|
name: 'ServerTiming',
|
|
@@ -12,6 +13,11 @@ const ServerTimingModule = declareModule({
|
|
|
12
13
|
var _a;
|
|
13
14
|
if (type === 'server' && status === 'customer') {
|
|
14
15
|
const responseManager = di.get(RESPONSE_MANAGER_TOKEN);
|
|
16
|
+
const reply = di.get(FASTIFY_RESPONSE);
|
|
17
|
+
// prevent unnecessary work
|
|
18
|
+
if (reply.sent) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
15
21
|
const initialHeader = (_a = responseManager.getHeader('Server-Timing')) !== null && _a !== void 0 ? _a : '';
|
|
16
22
|
const entries = [];
|
|
17
23
|
// index for custom sort
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var core = require('@tramvai/core');
|
|
6
6
|
var tokensCorePrivate = require('@tramvai/tokens-core-private');
|
|
7
7
|
var tokensCommon = require('@tramvai/tokens-common');
|
|
8
|
+
var tokensServerPrivate = require('@tramvai/tokens-server-private');
|
|
8
9
|
|
|
9
10
|
const ServerTimingModule = core.declareModule({
|
|
10
11
|
name: 'ServerTiming',
|
|
@@ -16,6 +17,11 @@ const ServerTimingModule = core.declareModule({
|
|
|
16
17
|
var _a;
|
|
17
18
|
if (type === 'server' && status === 'customer') {
|
|
18
19
|
const responseManager = di.get(tokensCommon.RESPONSE_MANAGER_TOKEN);
|
|
20
|
+
const reply = di.get(tokensServerPrivate.FASTIFY_RESPONSE);
|
|
21
|
+
// prevent unnecessary work
|
|
22
|
+
if (reply.sent) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
19
25
|
const initialHeader = (_a = responseManager.getHeader('Server-Timing')) !== null && _a !== void 0 ? _a : '';
|
|
20
26
|
const entries = [];
|
|
21
27
|
// index for custom sort
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.92.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"@tinkoff/monkeypatch": "2.0.5",
|
|
26
26
|
"@tinkoff/terminus": "0.1.8",
|
|
27
27
|
"@tinkoff/url": "0.8.6",
|
|
28
|
-
"@tramvai/module-cache-warmup": "2.
|
|
29
|
-
"@tramvai/module-metrics": "2.
|
|
30
|
-
"@tramvai/papi": "2.
|
|
31
|
-
"@tramvai/tokens-server": "2.
|
|
32
|
-
"@tramvai/tokens-server-private": "2.
|
|
28
|
+
"@tramvai/module-cache-warmup": "2.92.0",
|
|
29
|
+
"@tramvai/module-metrics": "2.92.0",
|
|
30
|
+
"@tramvai/papi": "2.92.0",
|
|
31
|
+
"@tramvai/tokens-server": "2.92.0",
|
|
32
|
+
"@tramvai/tokens-server-private": "2.92.0",
|
|
33
33
|
"fastify": "^4.14.1",
|
|
34
34
|
"@fastify/cookie": "^8.3.0",
|
|
35
35
|
"@fastify/compress": "^6.2.0",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@tinkoff/dippy": "0.8.15",
|
|
43
43
|
"@tinkoff/utils": "^2.1.2",
|
|
44
|
-
"@tramvai/cli": "2.
|
|
45
|
-
"@tramvai/core": "2.
|
|
46
|
-
"@tramvai/react": "2.
|
|
47
|
-
"@tramvai/module-common": "2.
|
|
48
|
-
"@tramvai/module-environment": "2.
|
|
49
|
-
"@tramvai/tokens-common": "2.
|
|
50
|
-
"@tramvai/tokens-core-private": "2.
|
|
51
|
-
"@tramvai/tokens-render": "2.
|
|
44
|
+
"@tramvai/cli": "2.92.0",
|
|
45
|
+
"@tramvai/core": "2.92.0",
|
|
46
|
+
"@tramvai/react": "2.92.0",
|
|
47
|
+
"@tramvai/module-common": "2.92.0",
|
|
48
|
+
"@tramvai/module-environment": "2.92.0",
|
|
49
|
+
"@tramvai/tokens-common": "2.92.0",
|
|
50
|
+
"@tramvai/tokens-core-private": "2.92.0",
|
|
51
|
+
"@tramvai/tokens-render": "2.92.0",
|
|
52
52
|
"react": ">=16.14.0",
|
|
53
53
|
"react-dom": ">=16.14.0",
|
|
54
54
|
"tslib": "^2.4.0"
|