@tramvai/module-page-render-mode 2.70.1 → 2.72.3

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/server.es.js CHANGED
@@ -1,582 +1,8 @@
1
- import { declareModule, provide, commandLineListTokens, createToken as createToken$1, Scope, DI_TOKEN } from '@tramvai/core';
2
- import { ENV_USED_TOKEN, ENV_MANAGER_TOKEN, COMPONENT_REGISTRY_TOKEN, CREATE_CACHE_TOKEN, REQUEST_MANAGER_TOKEN, LOGGER_TOKEN, RESPONSE_MANAGER_TOKEN } from '@tramvai/tokens-common';
3
- import { TRAMVAI_RENDER_MODE, LAYOUT_OPTIONS, MODERN_SATISFIES_TOKEN } from '@tramvai/tokens-render';
4
- import { ROUTER_TOKEN, PAGE_SERVICE_TOKEN } from '@tramvai/tokens-router';
5
- import { createToken } from '@tinkoff/dippy';
6
- import { jsx, Fragment } from 'react/jsx-runtime';
7
- import { useState, useEffect } from 'react';
8
- import { useDi } from '@tramvai/react';
9
- import isEmpty from '@tinkoff/utils/is/empty';
10
- import { FASTIFY_RESPONSE } from '@tramvai/tokens-server-private';
11
- import { USER_AGENT_TOKEN } from '@tramvai/module-client-hints';
12
- import { SERVER_MODULE_PAPI_PRIVATE_ROUTE } from '@tramvai/tokens-server';
13
- import { METRICS_MODULE_TOKEN } from '@tramvai/tokens-metrics';
14
- import { createPapiMethod } from '@tramvai/papi';
15
- import { SilentError } from '@tinkoff/errors';
16
- import fetch from 'node-fetch';
17
- import { format } from '@tinkoff/url';
18
-
19
- const PAGE_RENDER_FALLBACK_COMPONENT_PREFIX = createToken('pageRenderFallbackComponentName');
20
- /**
21
- * @deprecated Use token `TRAMVAI_RENDER_MODE` from `@tramvai/tokens-render`
22
- */
23
- const PAGE_RENDER_DEFAULT_MODE = createToken('pageRenderDefaultMode');
24
- const PAGE_RENDER_WRAPPER_TYPE = createToken('pageRenderWrapperType');
25
- const PAGE_RENDER_DEFAULT_FALLBACK_COMPONENT = createToken('pageRenderDefaultFallbackComponent');
26
- const STATIC_PAGES_CACHE_TOKEN = createToken('static pages cache');
27
- const STATIC_PAGES_SHOULD_USE_CACHE = createToken('static pages should use cache');
28
- const STATIC_PAGES_SHOULD_SET_TO_CACHE = createToken('static pages should set to cache');
29
- const STATIC_PAGES_BACKGROUND_FETCH_ENABLED = createToken('static pages can fetch page');
30
- const STATIC_PAGES_OPTIONS_TOKEN = createToken('static pages options');
31
- const STATIC_PAGES_COMMAND_LINE = createToken('static pages command line');
32
- const STATIC_PAGES_MODIFY_CACHE = createToken('static pages modify cache', { multi: true });
33
- const STATIC_PAGES_CACHE_5xx_RESPONSE = createToken('static pages cache 5xx response');
34
-
35
- // default internal bundle, used for File-System components
36
- const FALLBACK_GROUP = '__default';
37
- // just some unic name
38
- const FALLBACK_NAME = '__csr_fallback__';
39
- // just some unic path
40
- const FALLBACK_PATH = '/__csr_fallback__/';
41
- // env for force CSR mode
42
- const FORCE_RENDER_ENV_KEY = 'TRAMVAI_FORCE_CLIENT_SIDE_RENDERING';
43
- const FALLBACK_ROUTE = {
44
- name: FALLBACK_NAME,
45
- path: FALLBACK_PATH,
46
- config: {
47
- bundle: FALLBACK_GROUP,
48
- pageComponent: FALLBACK_NAME,
49
- },
50
- };
51
- /**
52
- * Module for force CSR mode, only add logic when `TRAMVAI_FORCE_CLIENT_SIDE_RENDERING=true` env variable is set
53
- */
54
- const ForceCSRModule = declareModule({
55
- name: 'ForceCSRModule',
56
- providers: [
57
- provide({
58
- provide: ENV_USED_TOKEN,
59
- useValue: [{ key: FORCE_RENDER_ENV_KEY, optional: true }],
60
- }),
61
- // set CSR mode globally
62
- provide({
63
- provide: TRAMVAI_RENDER_MODE,
64
- useFactory: ({ envManager }) => envManager.get(FORCE_RENDER_ENV_KEY) === 'true' ? 'client' : 'ssr',
65
- deps: {
66
- envManager: ENV_MANAGER_TOKEN,
67
- },
68
- }),
69
- // register CSR fallback component
70
- provide({
71
- provide: commandLineListTokens.listen,
72
- useFactory: ({ componentRegistry, fallback, envManager }) => {
73
- return function addCSRFallbackCompnent() {
74
- if (envManager.get(FORCE_RENDER_ENV_KEY) === 'true') {
75
- componentRegistry.add(FALLBACK_NAME, fallback, FALLBACK_GROUP);
76
- }
77
- };
78
- },
79
- deps: {
80
- componentRegistry: COMPONENT_REGISTRY_TOKEN,
81
- fallback: { token: PAGE_RENDER_DEFAULT_FALLBACK_COMPONENT, optional: true },
82
- envManager: ENV_MANAGER_TOKEN,
83
- },
84
- }),
85
- // add CSR fallback route
86
- provide({
87
- provide: commandLineListTokens.customerStart,
88
- useFactory: ({ router, envManager }) => {
89
- return function addCSRFallbackRoute() {
90
- if (envManager.get(FORCE_RENDER_ENV_KEY) === 'true') {
91
- router.registerHook('beforeResolve', async () => {
92
- router.addRoute(FALLBACK_ROUTE);
93
- });
94
- }
95
- };
96
- },
97
- deps: {
98
- router: ROUTER_TOKEN,
99
- envManager: ENV_MANAGER_TOKEN,
100
- },
101
- }),
102
- // tramvai static will not generate CSR fallback if /bundleInfo is not contains this route
103
- {
104
- provide: 'router bundleInfoAdditional',
105
- useFactory: ({ envManager }) => () => envManager.get(FORCE_RENDER_ENV_KEY) === 'true' ? FALLBACK_ROUTE : null,
106
- deps: {
107
- envManager: ENV_MANAGER_TOKEN,
108
- },
109
- },
110
- ],
111
- });
112
-
113
- const getPageRenderMode = ({ pageService, defaultRenderMode, }) => {
114
- var _a;
115
- const { pageComponent, pageRenderMode } = pageService.getConfig();
116
- const { renderMode } = (_a = pageService.getComponent(pageComponent)) !== null && _a !== void 0 ? _a : {};
117
- const mode = pageRenderMode || renderMode || defaultRenderMode;
118
- return mode;
119
- };
120
-
121
- const PageRenderWrapper = ({ children }) => {
122
- const [mounted, setMounted] = useState(false);
123
- const pageService = useDi(PAGE_SERVICE_TOKEN);
124
- const fallbackKey = useDi(PAGE_RENDER_FALLBACK_COMPONENT_PREFIX);
125
- const defaultRenderMode = useDi(PAGE_RENDER_DEFAULT_MODE);
126
- const DefaultFallbackComponent = useDi({
127
- token: PAGE_RENDER_DEFAULT_FALLBACK_COMPONENT,
128
- optional: true,
129
- });
130
- const FallbackComponent = pageService.resolveComponentFromConfig(fallbackKey) || DefaultFallbackComponent;
131
- const mode = getPageRenderMode({ pageService, defaultRenderMode });
132
- useEffect(() => {
133
- if (mode === 'client') {
134
- setMounted(true);
135
- }
136
- // eslint-disable-next-line react-hooks/exhaustive-deps
137
- }, []);
138
- if (mode === 'client' && !mounted) {
139
- if (FallbackComponent) {
140
- return jsx(FallbackComponent, {});
141
- }
142
- return null;
143
- }
144
- return jsx(Fragment, { children: children });
145
- };
146
- const pageRenderHOC = (WrapperPage) => (props) => {
147
- return (jsx(PageRenderWrapper, { children: jsx(WrapperPage, { ...props }) }));
148
- };
149
-
150
- const sharedProviders = [
151
- {
152
- provide: LAYOUT_OPTIONS,
153
- multi: true,
154
- useFactory: ({ wrapperType }) => {
155
- return {
156
- wrappers: {
157
- [wrapperType]: pageRenderHOC,
158
- },
159
- };
160
- },
161
- deps: {
162
- wrapperType: PAGE_RENDER_WRAPPER_TYPE,
163
- },
164
- },
165
- {
166
- provide: PAGE_RENDER_FALLBACK_COMPONENT_PREFIX,
167
- useValue: 'pageRenderFallback',
168
- },
169
- {
170
- provide: PAGE_RENDER_DEFAULT_MODE,
171
- useFactory: ({ tramvaiRenderMode }) => {
172
- return tramvaiRenderMode;
173
- },
174
- deps: {
175
- tramvaiRenderMode: TRAMVAI_RENDER_MODE,
176
- },
177
- },
178
- {
179
- provide: PAGE_RENDER_WRAPPER_TYPE,
180
- useValue: 'page',
181
- },
182
- ];
183
-
184
- class StopCommandLineRunnerError extends SilentError {
185
- constructor() {
186
- super('Prevent CommandLineRunner from execution');
187
- this.name = StopCommandLineRunnerError.errorName;
188
- }
189
- }
190
- StopCommandLineRunnerError.errorName = 'StopCommandLineRunnerError';
191
-
192
- const getCacheKey = ({ method, host, path, deviceType, modern, }) => {
193
- return `${method}=${host}=${path}=${deviceType}=${modern ? 'modern' : 'default'}`;
194
- };
195
-
196
- const userAgentByDeviceType = {
197
- /** Chrome on Mobile */
198
- 'mobile-modern': 'Mozilla/5.0 (Linux; Android 7.0; SM-G930V Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3071.125 Mobile Safari/537.36',
199
- /** Old Chrome on Mobile */
200
- 'mobile-default': 'Mozilla/5.0 (Linux; Android 7.0; SM-G930V Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.3071.125 Mobile Safari/537.36',
201
- /** Chrome on Mac OS */
202
- 'desktop-modern': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3987.87 Safari/537.36',
203
- /** Old Chrome on Mac OS */
204
- 'desktop-default': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.3987.87 Safari/537.36',
205
- };
206
- class BackgroundFetchService {
207
- constructor({ logger, backgroundFetchEnabled, }) {
208
- this.requests = new Set();
209
- this.log = logger('static-pages');
210
- this.backgroundFetchEnabled = backgroundFetchEnabled;
211
- }
212
- enabled() {
213
- return this.backgroundFetchEnabled();
214
- }
215
- async revalidate({ key, path, port, deviceType, modern, }) {
216
- if (this.requests.has(key)) {
217
- return;
218
- }
219
- const revalidateUrl = format({
220
- hostname: 'localhost',
221
- port,
222
- path,
223
- });
224
- this.requests.add(key);
225
- this.log.debug({
226
- event: 'background-fetch-init',
227
- key,
228
- revalidateUrl,
229
- });
230
- return fetch(revalidateUrl, {
231
- headers: {
232
- 'User-Agent': userAgentByDeviceType[`${deviceType}-${modern}`],
233
- 'X-Tramvai-Static-Page-Revalidate': 'true',
234
- },
235
- timeout: 10000,
236
- })
237
- .then(async (response) => {
238
- const body = await response.text();
239
- const headers = response.headers.raw();
240
- const { status } = response;
241
- this.log.debug({
242
- event: status >= 500 ? 'background-fetch-5xx' : 'background-fetch-success',
243
- status,
244
- key,
245
- });
246
- return {
247
- body,
248
- headers,
249
- status,
250
- };
251
- })
252
- .catch((error) => {
253
- this.log.warn({
254
- event: 'background-fetch-error',
255
- error,
256
- key,
257
- });
258
- })
259
- .finally(() => {
260
- this.requests.delete(key);
261
- });
262
- }
263
- }
264
-
265
- class StaticPagesService {
266
- constructor({ getCacheKey, requestManager, response, responseManager, environmentManager, userAgent, modern, logger, cache, modifyCache, shouldUseCache, shouldSetToCache, backgroundFetchService, options, cache5xxResponse, }) {
267
- this.key = getCacheKey();
268
- this.path = requestManager.getParsedUrl().pathname;
269
- this.port = environmentManager.get('PORT');
270
- this.deviceType = userAgent.mobileOS ? 'mobile' : 'desktop';
271
- this.modern = modern ? 'modern' : 'default';
272
- this.log = logger('static-pages');
273
- this.responseManager = responseManager;
274
- this.response = response;
275
- this.cache = cache;
276
- this.modifyCache = modifyCache;
277
- this.shouldUseCache = shouldUseCache;
278
- this.shouldSetToCache = shouldSetToCache;
279
- this.backgroundFetchService = backgroundFetchService;
280
- this.options = options;
281
- this.cache5xxResponse = cache5xxResponse;
282
- }
283
- respond(onSuccess) {
284
- if (!this.hasCache()) {
285
- return;
286
- }
287
- const { ttl } = this.options;
288
- let cacheEntry = this.getCache();
289
- if (Array.isArray(this.modifyCache)) {
290
- cacheEntry = this.modifyCache.reduce((result, modifier) => {
291
- return modifier(result);
292
- }, cacheEntry);
293
- }
294
- const { updatedAt, status, headers, body } = cacheEntry;
295
- const isOutdated = updatedAt + ttl <= Date.now();
296
- if (!isOutdated) {
297
- this.log.debug({
298
- event: 'cache-hit',
299
- key: this.key,
300
- });
301
- this.response
302
- .header('content-type', 'text/html')
303
- .header('X-Tramvai-Static-Page-From-Cache', 'true')
304
- .headers(headers)
305
- .status(status)
306
- .send(body);
307
- onSuccess();
308
- }
309
- else {
310
- this.log.debug({
311
- event: 'cache-outdated',
312
- key: this.key,
313
- });
314
- }
315
- }
316
- saveResponse() {
317
- if (!this.cache5xxResponse() && this.responseManager.getStatus() >= 500) {
318
- this.log.debug({
319
- event: 'cache-set-5xx',
320
- key: this.key,
321
- });
322
- return;
323
- }
324
- this.log.debug({
325
- event: 'cache-set',
326
- key: this.key,
327
- });
328
- this.setCache({
329
- status: this.responseManager.getStatus(),
330
- headers: this.responseManager.getHeaders(),
331
- body: this.responseManager.getBody(),
332
- });
333
- }
334
- async revalidate() {
335
- if (!this.backgroundFetchService.enabled()) {
336
- return;
337
- }
338
- await this.backgroundFetchService
339
- .revalidate({
340
- key: this.key,
341
- path: this.path,
342
- port: this.port,
343
- deviceType: this.deviceType,
344
- modern: this.modern,
345
- })
346
- .then((response) => {
347
- if (!response) {
348
- return;
349
- }
350
- if (!this.cache5xxResponse() && response.status >= 500) {
351
- return;
352
- }
353
- this.setCache(response);
354
- });
355
- }
356
- hasCache() {
357
- return this.cache.has(this.path) && this.cache.get(this.path).has(this.key);
358
- }
359
- getCache() {
360
- return this.cache.get(this.path).get(this.key);
361
- }
362
- setCache(cacheEntry) {
363
- if (!this.cache.has(this.path)) {
364
- this.cache.set(this.path, new Map());
365
- }
366
- this.cache.get(this.path).set(this.key, {
367
- ...cacheEntry,
368
- updatedAt: Date.now(),
369
- });
370
- }
371
- }
372
-
373
- const STATIC_PAGES_BACKGROUND_FETCH_SERVICE = createToken$1();
374
- const STATIC_PAGES_GET_CACHE_KEY_TOKEN = createToken$1();
375
- const STATIC_PAGES_CACHE_HIT_METRIC_TOKEN = createToken$1();
376
- const STATIC_PAGES_SERVICE = createToken$1();
377
- const staticPagesProviders = [
378
- provide({
379
- provide: STATIC_PAGES_CACHE_HIT_METRIC_TOKEN,
380
- scope: Scope.SINGLETON,
381
- useFactory: ({ metrics }) => {
382
- return metrics.counter({
383
- name: 'static_pages_cache_hit',
384
- help: 'Total static pages returned from cache',
385
- labelNames: [],
386
- });
387
- },
388
- deps: {
389
- metrics: METRICS_MODULE_TOKEN,
390
- },
391
- }),
392
- provide({
393
- provide: STATIC_PAGES_CACHE_TOKEN,
394
- scope: Scope.SINGLETON,
395
- useFactory: ({ createCache, staticPagesOptions }) => {
396
- return createCache('memory', {
397
- max: staticPagesOptions.maxSize,
398
- });
399
- },
400
- deps: {
401
- createCache: CREATE_CACHE_TOKEN,
402
- staticPagesOptions: STATIC_PAGES_OPTIONS_TOKEN,
403
- },
404
- }),
405
- provide({
406
- provide: STATIC_PAGES_OPTIONS_TOKEN,
407
- useValue: {
408
- // @TODO: свой ttl для отдельных страниц
409
- ttl: 60 * 1000,
410
- maxSize: 1000,
411
- },
412
- }),
413
- provide({
414
- provide: STATIC_PAGES_GET_CACHE_KEY_TOKEN,
415
- useFactory: ({ requestManager, userAgent, modern }) => {
416
- return () => {
417
- const deviceType = userAgent.mobileOS ? 'mobile' : 'desktop';
418
- return getCacheKey({
419
- method: requestManager.getMethod(),
420
- host: requestManager.getHost(),
421
- path: requestManager.getParsedUrl().pathname,
422
- deviceType,
423
- modern,
424
- });
425
- };
426
- },
427
- deps: {
428
- requestManager: REQUEST_MANAGER_TOKEN,
429
- userAgent: USER_AGENT_TOKEN,
430
- modern: MODERN_SATISFIES_TOKEN,
431
- },
432
- }),
433
- provide({
434
- provide: STATIC_PAGES_SHOULD_SET_TO_CACHE,
435
- useFactory: ({ requestManager }) => {
436
- return () => {
437
- return isEmpty(requestManager.getCookies());
438
- };
439
- },
440
- deps: {
441
- requestManager: REQUEST_MANAGER_TOKEN,
442
- },
443
- }),
444
- provide({
445
- provide: STATIC_PAGES_SHOULD_USE_CACHE,
446
- useFactory: ({ requestManager }) => {
447
- return () => {
448
- return !requestManager.getHeader('x-tramvai-static-page-revalidate');
449
- };
450
- },
451
- deps: {
452
- requestManager: REQUEST_MANAGER_TOKEN,
453
- },
454
- }),
455
- provide({
456
- provide: STATIC_PAGES_BACKGROUND_FETCH_ENABLED,
457
- useValue: () => {
458
- return true;
459
- },
460
- }),
461
- provide({
462
- provide: STATIC_PAGES_CACHE_5xx_RESPONSE,
463
- useValue: () => {
464
- return false;
465
- },
466
- }),
467
- provide({
468
- provide: STATIC_PAGES_BACKGROUND_FETCH_SERVICE,
469
- scope: Scope.REQUEST,
470
- useClass: BackgroundFetchService,
471
- deps: {
472
- logger: LOGGER_TOKEN,
473
- backgroundFetchEnabled: STATIC_PAGES_BACKGROUND_FETCH_ENABLED,
474
- },
475
- }),
476
- provide({
477
- provide: STATIC_PAGES_SERVICE,
478
- scope: Scope.REQUEST,
479
- useClass: StaticPagesService,
480
- deps: {
481
- getCacheKey: STATIC_PAGES_GET_CACHE_KEY_TOKEN,
482
- requestManager: REQUEST_MANAGER_TOKEN,
483
- responseManager: RESPONSE_MANAGER_TOKEN,
484
- response: FASTIFY_RESPONSE,
485
- environmentManager: ENV_MANAGER_TOKEN,
486
- userAgent: USER_AGENT_TOKEN,
487
- modern: MODERN_SATISFIES_TOKEN,
488
- logger: LOGGER_TOKEN,
489
- cache: STATIC_PAGES_CACHE_TOKEN,
490
- modifyCache: { token: STATIC_PAGES_MODIFY_CACHE, optional: true },
491
- shouldUseCache: STATIC_PAGES_SHOULD_USE_CACHE,
492
- shouldSetToCache: STATIC_PAGES_SHOULD_SET_TO_CACHE,
493
- backgroundFetchService: STATIC_PAGES_BACKGROUND_FETCH_SERVICE,
494
- options: STATIC_PAGES_OPTIONS_TOKEN,
495
- cache5xxResponse: STATIC_PAGES_CACHE_5xx_RESPONSE,
496
- },
497
- }),
498
- provide({
499
- provide: commandLineListTokens.init,
500
- multi: true,
501
- scope: Scope.SINGLETON,
502
- useFactory: ({ di, staticPagesCommandLine }) => {
503
- return function registerResponseCacheHandler() {
504
- di.register({
505
- provide: staticPagesCommandLine
506
- ? commandLineListTokens[staticPagesCommandLine]
507
- : commandLineListTokens.customerStart,
508
- useFactory: ({ staticPagesService, staticPagesCacheHitMetric, logger }) => {
509
- logger('static-pages');
510
- return function staticPagesFromCache() {
511
- if (staticPagesService.shouldUseCache()) {
512
- staticPagesService.respond(() => {
513
- // @TODO: маска урла на этом этапе?
514
- staticPagesCacheHitMetric.inc();
515
- throw new StopCommandLineRunnerError();
516
- });
517
- }
518
- };
519
- },
520
- deps: {
521
- staticPagesService: STATIC_PAGES_SERVICE,
522
- staticPagesCacheHitMetric: STATIC_PAGES_CACHE_HIT_METRIC_TOKEN,
523
- logger: LOGGER_TOKEN,
524
- },
525
- });
526
- };
527
- },
528
- deps: {
529
- di: DI_TOKEN,
530
- staticPagesCommandLine: { token: STATIC_PAGES_COMMAND_LINE, optional: true },
531
- },
532
- }),
533
- provide({
534
- provide: commandLineListTokens.clear,
535
- useFactory: ({ staticPagesService, pageService, defaultRenderMode }) => {
536
- return function cacheStaticPages() {
537
- const isStaticPage = getPageRenderMode({ pageService, defaultRenderMode }) === 'static';
538
- if (!isStaticPage) {
539
- return;
540
- }
541
- if (staticPagesService.shouldSetToCache()) {
542
- staticPagesService.saveResponse();
543
- }
544
- else {
545
- staticPagesService.revalidate();
546
- }
547
- };
548
- },
549
- deps: {
550
- staticPagesService: STATIC_PAGES_SERVICE,
551
- pageService: PAGE_SERVICE_TOKEN,
552
- defaultRenderMode: PAGE_RENDER_DEFAULT_MODE,
553
- },
554
- }),
555
- provide({
556
- provide: SERVER_MODULE_PAPI_PRIVATE_ROUTE,
557
- useFactory: ({ staticPagesCache }) => {
558
- return createPapiMethod({
559
- path: '/revalidate/',
560
- method: 'post',
561
- async handler({ body = {} }) {
562
- const { path } = body;
563
- const pathKey = `/${path}/`;
564
- if (!path) {
565
- staticPagesCache.clear();
566
- }
567
- else if (staticPagesCache.has(pathKey)) {
568
- staticPagesCache.set(pathKey, new Map());
569
- // @TODO: revalidate request with background fetch?
570
- }
571
- return 'Success';
572
- },
573
- });
574
- },
575
- deps: {
576
- staticPagesCache: STATIC_PAGES_CACHE_TOKEN,
577
- },
578
- }),
579
- ];
1
+ import { declareModule } from '@tramvai/core';
2
+ import { ForceCSRModule } from './ForceCSRModule.es.js';
3
+ import { sharedProviders } from './shared.es.js';
4
+ import { staticPagesProviders } from './staticPages.es.js';
5
+ export { PAGE_RENDER_DEFAULT_FALLBACK_COMPONENT, PAGE_RENDER_DEFAULT_MODE, PAGE_RENDER_FALLBACK_COMPONENT_PREFIX, PAGE_RENDER_WRAPPER_TYPE, STATIC_PAGES_BACKGROUND_FETCH_ENABLED, STATIC_PAGES_CACHE_5xx_RESPONSE, STATIC_PAGES_CACHE_TOKEN, STATIC_PAGES_COMMAND_LINE, STATIC_PAGES_MODIFY_CACHE, STATIC_PAGES_OPTIONS_TOKEN, STATIC_PAGES_SHOULD_SET_TO_CACHE, STATIC_PAGES_SHOULD_USE_CACHE } from './tokens.es.js';
580
6
 
581
7
  // @todo: перенести в @tramvai/module-render
582
8
  const PageRenderModeModule = declareModule({
@@ -585,4 +11,4 @@ const PageRenderModeModule = declareModule({
585
11
  providers: [...sharedProviders, ...staticPagesProviders],
586
12
  });
587
13
 
588
- export { PAGE_RENDER_DEFAULT_FALLBACK_COMPONENT, PAGE_RENDER_DEFAULT_MODE, PAGE_RENDER_FALLBACK_COMPONENT_PREFIX, PAGE_RENDER_WRAPPER_TYPE, PageRenderModeModule, STATIC_PAGES_BACKGROUND_FETCH_ENABLED, STATIC_PAGES_CACHE_5xx_RESPONSE, STATIC_PAGES_CACHE_TOKEN, STATIC_PAGES_COMMAND_LINE, STATIC_PAGES_MODIFY_CACHE, STATIC_PAGES_OPTIONS_TOKEN, STATIC_PAGES_SHOULD_SET_TO_CACHE, STATIC_PAGES_SHOULD_USE_CACHE };
14
+ export { PageRenderModeModule };