@tramvai/module-server 5.50.0 → 5.53.74

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.
@@ -10,10 +10,8 @@ import http from 'http';
10
10
  import https from 'https';
11
11
 
12
12
  class Interceptor {
13
- constructor() {
14
- this.intercepted = false;
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
- constructor() {
24
- this.intercepted = false;
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;
@@ -1,9 +1,7 @@
1
1
  class ServerResponseTaskManager {
2
- constructor() {
3
- this.tasks = [];
4
- this.processedTasks = [];
5
- this.status = 'idle';
6
- }
2
+ tasks = [];
3
+ processedTasks = [];
4
+ status = 'idle';
7
5
  push(task) {
8
6
  if (this.status === 'closed') {
9
7
  return;
@@ -3,11 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  class ServerResponseTaskManager {
6
- constructor() {
7
- this.tasks = [];
8
- this.processedTasks = [];
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;
@@ -122,8 +122,9 @@ const webAppInitCommand = ({ app, logger, commandLineRunner, executionContextMan
122
122
  });
123
123
  }
124
124
  catch (err) {
125
- if (err.di) {
126
- const responseManager = err.di.get(RESPONSE_MANAGER_TOKEN);
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
  }
@@ -131,8 +131,9 @@ const webAppInitCommand = ({ app, logger, commandLineRunner, executionContextMan
131
131
  });
132
132
  }
133
133
  catch (err) {
134
- if (err.di) {
135
- const responseManager = err.di.get(tokensCommon.RESPONSE_MANAGER_TOKEN);
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.50.0",
3
+ "version": "5.53.74",
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.2",
29
+ "@tinkoff/errors": "0.6.3",
30
30
  "@tinkoff/monkeypatch": "5.0.2",
31
- "@tinkoff/terminus": "0.4.2",
32
- "@tinkoff/url": "0.11.2",
33
- "@tramvai/module-cache-warmup": "5.50.0",
34
- "@tramvai/module-metrics": "5.50.0",
35
- "@tramvai/papi": "5.50.0",
31
+ "@tinkoff/terminus": "0.4.3",
32
+ "@tinkoff/url": "0.11.3",
33
+ "@tramvai/module-cache-warmup": "5.53.74",
34
+ "@tramvai/module-metrics": "5.53.74",
35
+ "@tramvai/papi": "5.53.74",
36
36
  "@tramvai/safe-strings": "0.8.4",
37
- "@tramvai/tokens-router": "5.50.0",
38
- "@tramvai/tokens-server": "5.50.0",
39
- "@tramvai/tokens-server-private": "5.50.0",
37
+ "@tramvai/tokens-router": "5.53.74",
38
+ "@tramvai/tokens-server": "5.53.74",
39
+ "@tramvai/tokens-server-private": "5.53.74",
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.4",
45
+ "@tinkoff/dippy": "0.11.5",
46
46
  "@tinkoff/utils": "^2.1.2",
47
- "@tramvai/cli": "5.50.0",
48
- "@tramvai/core": "5.50.0",
49
- "@tramvai/module-common": "5.50.0",
50
- "@tramvai/module-environment": "5.50.0",
51
- "@tramvai/react": "5.50.0",
52
- "@tramvai/tokens-common": "5.50.0",
53
- "@tramvai/tokens-core-private": "5.50.0",
54
- "@tramvai/tokens-render": "5.50.0",
47
+ "@tramvai/cli": "5.53.74",
48
+ "@tramvai/core": "5.53.74",
49
+ "@tramvai/module-common": "5.53.74",
50
+ "@tramvai/module-environment": "5.53.74",
51
+ "@tramvai/react": "5.53.74",
52
+ "@tramvai/tokens-common": "5.53.74",
53
+ "@tramvai/tokens-core-private": "5.53.74",
54
+ "@tramvai/tokens-render": "5.53.74",
55
55
  "react": ">=16.14.0",
56
56
  "react-dom": ">=16.14.0",
57
57
  "tslib": "^2.4.0"