@tramvai/module-render 1.101.2 → 1.101.6

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
@@ -403,7 +403,7 @@ if (process.env.NODE_ENV === 'production') {
403
403
  return Promise.resolve(stats);
404
404
  };
405
405
  }
406
- const fetchWebpackStats = async ({ modern, }) => {
406
+ const fetchWebpackStats = async ({ modern, } = {}) => {
407
407
  return fetchStats(modern);
408
408
  };
409
409
 
package/lib/server.js CHANGED
@@ -439,7 +439,7 @@ if (process.env.NODE_ENV === 'production') {
439
439
  return Promise.resolve(stats);
440
440
  };
441
441
  }
442
- const fetchWebpackStats = async ({ modern, }) => {
442
+ const fetchWebpackStats = async ({ modern, } = {}) => {
443
443
  return fetchStats(modern);
444
444
  };
445
445
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-render",
3
- "version": "1.101.2",
3
+ "version": "1.101.6",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -24,28 +24,28 @@
24
24
  "@tinkoff/htmlpagebuilder": "0.4.22",
25
25
  "@tinkoff/layout-factory": "0.2.28",
26
26
  "@tinkoff/url": "0.7.37",
27
- "@tinkoff/user-agent": "0.3.335",
28
- "@tramvai/module-client-hints": "1.101.2",
29
- "@tramvai/module-router": "1.101.2",
30
- "@tramvai/react": "1.101.2",
27
+ "@tinkoff/user-agent": "0.3.339",
28
+ "@tramvai/module-client-hints": "1.101.6",
29
+ "@tramvai/module-router": "1.101.6",
30
+ "@tramvai/react": "1.101.6",
31
31
  "@tramvai/safe-strings": "0.4.3",
32
- "@tramvai/tokens-render": "1.101.2",
33
- "@tramvai/experiments": "1.101.2",
32
+ "@tramvai/tokens-render": "1.101.6",
33
+ "@tramvai/experiments": "1.101.6",
34
34
  "@types/loadable__server": "^5.12.6",
35
35
  "node-fetch": "^2.6.1"
36
36
  },
37
37
  "peerDependencies": {
38
- "@tinkoff/dippy": "0.7.39",
38
+ "@tinkoff/dippy": "0.7.40",
39
39
  "@tinkoff/utils": "^2.1.2",
40
40
  "@tinkoff/react-hooks": "0.0.24",
41
- "@tramvai/cli": "1.101.2",
42
- "@tramvai/core": "1.101.2",
43
- "@tramvai/module-common": "1.101.2",
44
- "@tramvai/state": "1.101.2",
45
- "@tramvai/test-helpers": "1.101.2",
46
- "@tramvai/tokens-common": "1.101.2",
47
- "@tramvai/tokens-router": "1.101.2",
48
- "@tramvai/tokens-server-private": "1.101.2",
41
+ "@tramvai/cli": "1.101.6",
42
+ "@tramvai/core": "1.101.6",
43
+ "@tramvai/module-common": "1.101.6",
44
+ "@tramvai/state": "1.101.6",
45
+ "@tramvai/test-helpers": "1.101.6",
46
+ "@tramvai/tokens-common": "1.101.6",
47
+ "@tramvai/tokens-router": "1.101.6",
48
+ "@tramvai/tokens-server-private": "1.101.6",
49
49
  "express": "^4.17.1",
50
50
  "prop-types": "^15.6.2",
51
51
  "react": ">=16.8.0",
@@ -1,114 +0,0 @@
1
- 'use strict';
2
-
3
- var tslib = require('tslib');
4
- var dependency = require('@tramvai/tools-migrate/lib/dependency');
5
-
6
- var selfPackageJSON = require('../package.json');
7
- var COMPLEX_OPTIONS = {
8
- key: "\n \u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430 \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u0438\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u0443\u0435\u043C\u044B\u0439 \u0444\u0430\u0439\u043B, \u043D\u0430 \u0444\u0430\u0439\u043B \u043E\u0442\u043A\u0443\u0434\u0430 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u0430\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u044B\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u0447\u0435\u0440\u0435\u0437 default, \u0442.\u043A. @tramvai/react \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E default\n\u0415\u0441\u043B\u0438 \u0437\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u043C \u0444\u0430\u0439\u043B\u0435 \u043D\u0435\u043B\u044C\u0437\u044F, \u0442\u043E \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u0442\u043E \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0444\u0430\u0439\u043B-\u043E\u0431\u0451\u0440\u0442\u043A\u0443, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0440\u0435\u044D\u043A\u0441\u043F\u043E\u0440\u0442\u043D\u0435\u0442 \u043D\u0443\u0436\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0447\u0435\u0440\u0435\u0437 export default,\n\u0437\u0430\u0442\u0435\u043C \u0443\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u0442\u0443 \u043E\u043F\u0446\u0438\u044E\n",
9
- };
10
- var REMOVE_OPTIONS = new Set(['ignoreBabelRename']);
11
- // eslint-disable-next-line import/no-default-export
12
- var _2AsyncUniversalToLazy = (function (_a) {
13
- var packageJSON = _a.packageJSON, transform = _a.transform;
14
- return tslib.__awaiter(void 0, void 0, void 0, function () {
15
- return tslib.__generator(this, function (_b) {
16
- switch (_b.label) {
17
- case 0: return [4 /*yield*/, transform(function (_a, _b, _c) {
18
- var source = _a.source;
19
- var j = _b.j;
20
- var printOptions = _c.printOptions;
21
- var parsed = j(source);
22
- var tramvaiReactImport;
23
- var lazyImportName = '';
24
- var legacyImportName = '';
25
- var hasLegacyImport = false;
26
- parsed.find(j.ImportDeclaration).forEach(function (imp) {
27
- switch (imp.node.source.value) {
28
- case '@tramvai/react':
29
- tramvaiReactImport = imp;
30
- imp.node.specifiers.forEach(function (specifier) {
31
- if (specifier.type === 'ImportSpecifier') {
32
- if (specifier.imported.name === 'lazy') {
33
- lazyImportName = specifier.local.name;
34
- legacyImportName = lazyImportName;
35
- }
36
- }
37
- });
38
- break;
39
- case '@tinkoff/platform-legacy/utils/decorators/asyncUniversal':
40
- case 'react-universal-component':
41
- hasLegacyImport = true;
42
- imp.node.specifiers.forEach(function (specifier) {
43
- if (specifier.type === 'ImportDefaultSpecifier') {
44
- legacyImportName = specifier.local.name;
45
- }
46
- });
47
- imp.replace();
48
- break;
49
- }
50
- });
51
- if (!legacyImportName) {
52
- return;
53
- }
54
- if (hasLegacyImport) {
55
- if (tramvaiReactImport) {
56
- if (!lazyImportName) {
57
- lazyImportName = 'lazy';
58
- tramvaiReactImport.node.specifiers.push(j.importSpecifier(j.identifier('lazy')));
59
- }
60
- }
61
- else {
62
- lazyImportName = 'lazy';
63
- parsed.addImport(j.importDeclaration([j.importSpecifier(j.identifier('lazy'))], j.stringLiteral('@tramvai/react')));
64
- }
65
- }
66
- dependency.replaceDependency({
67
- packageJSON: packageJSON.source,
68
- from: 'react-universal-component',
69
- });
70
- // eslint-disable-next-line no-param-reassign
71
- packageJSON.source.dependencies['@tramvai/react'] = selfPackageJSON.version;
72
- parsed
73
- .find(j.CallExpression, {
74
- callee: {
75
- name: legacyImportName,
76
- },
77
- })
78
- .replaceWith(function (p) {
79
- var _a = p.node.arguments, imp = _a[0], opts = _a[1];
80
- var migratedOps = opts;
81
- if (opts && opts.type === 'ObjectExpression') {
82
- var props = [];
83
- for (var _i = 0, _b = opts.properties; _i < _b.length; _i++) {
84
- var prop = _b[_i];
85
- if (prop.type === 'ObjectProperty' && prop.key.type === 'Identifier') {
86
- if (REMOVE_OPTIONS.has(prop.key.name)) {
87
- continue;
88
- }
89
- if (prop.key.name in COMPLEX_OPTIONS) {
90
- prop.comments = [
91
- j.commentBlock(COMPLEX_OPTIONS[prop.key.name]),
92
- ];
93
- }
94
- }
95
- props.push(prop);
96
- }
97
- migratedOps = j.objectExpression(props);
98
- }
99
- return j.callExpression(j.identifier(lazyImportName), [
100
- imp.type === 'CallExpression' ? j.arrowFunctionExpression([], imp) : imp,
101
- migratedOps,
102
- ].filter(Boolean));
103
- });
104
- return parsed.toSource(printOptions);
105
- })];
106
- case 1:
107
- _b.sent();
108
- return [2 /*return*/];
109
- }
110
- });
111
- });
112
- });
113
-
114
- module.exports = _2AsyncUniversalToLazy;