@modern-js/prod-server 2.0.0-beta.3 → 2.0.0-beta.4

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.
Files changed (130) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/js/modern/constants.js +32 -25
  3. package/dist/js/modern/index.js +11 -6
  4. package/dist/js/modern/libs/context/context.js +52 -84
  5. package/dist/js/modern/libs/context/index.js +5 -2
  6. package/dist/js/modern/libs/hook-api/index.js +42 -35
  7. package/dist/js/modern/libs/hook-api/route.js +6 -7
  8. package/dist/js/modern/libs/hook-api/template.js +20 -34
  9. package/dist/js/modern/libs/loadConfig.js +45 -24
  10. package/dist/js/modern/libs/metrics.js +3 -4
  11. package/dist/js/modern/libs/proxy.js +68 -37
  12. package/dist/js/modern/libs/render/cache/__tests__/cache.fun.test.js +112 -67
  13. package/dist/js/modern/libs/render/cache/__tests__/cache.test.js +246 -216
  14. package/dist/js/modern/libs/render/cache/__tests__/cacheable.js +43 -49
  15. package/dist/js/modern/libs/render/cache/__tests__/error-configuration.js +36 -34
  16. package/dist/js/modern/libs/render/cache/__tests__/matched-cache.js +83 -113
  17. package/dist/js/modern/libs/render/cache/index.js +88 -54
  18. package/dist/js/modern/libs/render/cache/page-caches/index.js +31 -8
  19. package/dist/js/modern/libs/render/cache/page-caches/lru.js +6 -6
  20. package/dist/js/modern/libs/render/cache/spr.js +133 -117
  21. package/dist/js/modern/libs/render/cache/type.js +0 -1
  22. package/dist/js/modern/libs/render/cache/util.js +71 -39
  23. package/dist/js/modern/libs/render/index.js +76 -56
  24. package/dist/js/modern/libs/render/measure.js +38 -27
  25. package/dist/js/modern/libs/render/reader.js +65 -62
  26. package/dist/js/modern/libs/render/ssr.js +50 -32
  27. package/dist/js/modern/libs/render/static.js +50 -33
  28. package/dist/js/modern/libs/render/type.js +9 -6
  29. package/dist/js/modern/libs/route/index.js +8 -15
  30. package/dist/js/modern/libs/route/matcher.js +20 -34
  31. package/dist/js/modern/libs/route/route.js +9 -18
  32. package/dist/js/modern/libs/serve-file.js +33 -20
  33. package/dist/js/modern/server/index.js +144 -145
  34. package/dist/js/modern/server/modern-server-split.js +46 -12
  35. package/dist/js/modern/server/modern-server.js +377 -417
  36. package/dist/js/modern/type.js +0 -1
  37. package/dist/js/modern/utils.js +62 -43
  38. package/dist/js/modern/worker-server.js +34 -14
  39. package/dist/js/node/constants.js +45 -30
  40. package/dist/js/node/index.js +31 -57
  41. package/dist/js/node/libs/context/context.js +79 -94
  42. package/dist/js/node/libs/context/index.js +23 -13
  43. package/dist/js/node/libs/hook-api/index.js +69 -48
  44. package/dist/js/node/libs/hook-api/route.js +22 -11
  45. package/dist/js/node/libs/hook-api/template.js +36 -39
  46. package/dist/js/node/libs/loadConfig.js +69 -35
  47. package/dist/js/node/libs/metrics.js +21 -9
  48. package/dist/js/node/libs/proxy.js +86 -44
  49. package/dist/js/node/libs/render/cache/__tests__/cache.fun.test.js +132 -70
  50. package/dist/js/node/libs/render/cache/__tests__/cache.test.js +268 -218
  51. package/dist/js/node/libs/render/cache/__tests__/cacheable.js +61 -55
  52. package/dist/js/node/libs/render/cache/__tests__/error-configuration.js +54 -40
  53. package/dist/js/node/libs/render/cache/__tests__/matched-cache.js +101 -119
  54. package/dist/js/node/libs/render/cache/index.js +110 -64
  55. package/dist/js/node/libs/render/cache/page-caches/index.js +50 -14
  56. package/dist/js/node/libs/render/cache/page-caches/lru.js +29 -12
  57. package/dist/js/node/libs/render/cache/spr.js +156 -129
  58. package/dist/js/node/libs/render/cache/type.js +0 -5
  59. package/dist/js/node/libs/render/cache/util.js +88 -45
  60. package/dist/js/node/libs/render/index.js +102 -67
  61. package/dist/js/node/libs/render/measure.js +55 -31
  62. package/dist/js/node/libs/render/reader.js +87 -70
  63. package/dist/js/node/libs/render/ssr.js +76 -47
  64. package/dist/js/node/libs/render/static.js +75 -40
  65. package/dist/js/node/libs/render/type.js +27 -12
  66. package/dist/js/node/libs/route/index.js +26 -26
  67. package/dist/js/node/libs/route/matcher.js +36 -41
  68. package/dist/js/node/libs/route/route.js +25 -22
  69. package/dist/js/node/libs/serve-file.js +61 -32
  70. package/dist/js/node/server/index.js +160 -160
  71. package/dist/js/node/server/modern-server-split.js +68 -22
  72. package/dist/js/node/server/modern-server.js +395 -441
  73. package/dist/js/node/type.js +0 -3
  74. package/dist/js/node/utils.js +74 -52
  75. package/dist/js/node/worker-server.js +53 -21
  76. package/dist/js/treeshaking/constants.js +26 -25
  77. package/dist/js/treeshaking/index.js +10 -10
  78. package/dist/js/treeshaking/libs/context/context.js +268 -237
  79. package/dist/js/treeshaking/libs/context/index.js +3 -3
  80. package/dist/js/treeshaking/libs/hook-api/index.js +265 -143
  81. package/dist/js/treeshaking/libs/hook-api/route.js +65 -30
  82. package/dist/js/treeshaking/libs/hook-api/template.js +121 -85
  83. package/dist/js/treeshaking/libs/loadConfig.js +80 -37
  84. package/dist/js/treeshaking/libs/metrics.js +4 -10
  85. package/dist/js/treeshaking/libs/proxy.js +240 -76
  86. package/dist/js/treeshaking/libs/render/cache/__tests__/cache.fun.test.js +288 -121
  87. package/dist/js/treeshaking/libs/render/cache/__tests__/cache.test.js +772 -455
  88. package/dist/js/treeshaking/libs/render/cache/__tests__/cacheable.js +65 -51
  89. package/dist/js/treeshaking/libs/render/cache/__tests__/error-configuration.js +45 -35
  90. package/dist/js/treeshaking/libs/render/cache/__tests__/matched-cache.js +144 -118
  91. package/dist/js/treeshaking/libs/render/cache/index.js +337 -175
  92. package/dist/js/treeshaking/libs/render/cache/page-caches/index.js +151 -27
  93. package/dist/js/treeshaking/libs/render/cache/page-caches/lru.js +80 -42
  94. package/dist/js/treeshaking/libs/render/cache/spr.js +470 -340
  95. package/dist/js/treeshaking/libs/render/cache/type.js +1 -1
  96. package/dist/js/treeshaking/libs/render/cache/util.js +271 -92
  97. package/dist/js/treeshaking/libs/render/index.js +228 -95
  98. package/dist/js/treeshaking/libs/render/measure.js +142 -57
  99. package/dist/js/treeshaking/libs/render/reader.js +325 -177
  100. package/dist/js/treeshaking/libs/render/ssr.js +220 -95
  101. package/dist/js/treeshaking/libs/render/static.js +210 -78
  102. package/dist/js/treeshaking/libs/render/type.js +7 -6
  103. package/dist/js/treeshaking/libs/route/index.js +125 -89
  104. package/dist/js/treeshaking/libs/route/matcher.js +132 -107
  105. package/dist/js/treeshaking/libs/route/route.js +40 -26
  106. package/dist/js/treeshaking/libs/serve-file.js +177 -68
  107. package/dist/js/treeshaking/server/index.js +468 -327
  108. package/dist/js/treeshaking/server/modern-server-split.js +352 -144
  109. package/dist/js/treeshaking/server/modern-server.js +1046 -909
  110. package/dist/js/treeshaking/type.js +1 -1
  111. package/dist/js/treeshaking/utils.js +138 -81
  112. package/dist/js/treeshaking/worker-server.js +176 -55
  113. package/dist/types/index.d.ts +2 -0
  114. package/dist/types/libs/context/context.d.ts +4 -1
  115. package/dist/types/libs/loadConfig.d.ts +1 -0
  116. package/dist/types/libs/render/cache/index.d.ts +2 -0
  117. package/dist/types/libs/render/cache/spr.d.ts +2 -0
  118. package/dist/types/libs/route/route.d.ts +0 -1
  119. package/dist/types/server/index.d.ts +3 -0
  120. package/dist/types/utils.d.ts +1 -1
  121. package/dist/types/worker-server.d.ts +1 -2
  122. package/package.json +7 -14
  123. package/dist/js/modern/libs/render/modern/browser-list.js +0 -7
  124. package/dist/js/modern/libs/render/modern/index.js +0 -37
  125. package/dist/js/node/libs/render/modern/browser-list.js +0 -14
  126. package/dist/js/node/libs/render/modern/index.js +0 -46
  127. package/dist/js/treeshaking/libs/render/modern/browser-list.js +0 -7
  128. package/dist/js/treeshaking/libs/render/modern/index.js +0 -39
  129. package/dist/types/libs/render/modern/browser-list.d.ts +0 -1
  130. package/dist/types/libs/render/modern/index.d.ts +0 -3
@@ -1,152 +1,360 @@
1
- import _get from "@babel/runtime/helpers/esm/get";
2
- import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
3
- import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
4
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/esm/createClass";
7
- import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
1
+ function _assertThisInitialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8
+ try {
9
+ var info = gen[key](arg);
10
+ var value = info.value;
11
+ } catch (error) {
12
+ reject(error);
13
+ return;
14
+ }
15
+ if (info.done) {
16
+ resolve(value);
17
+ } else {
18
+ Promise.resolve(value).then(_next, _throw);
19
+ }
20
+ }
21
+ function _asyncToGenerator(fn) {
22
+ return function() {
23
+ var self = this, args = arguments;
24
+ return new Promise(function(resolve, reject) {
25
+ var gen = fn.apply(self, args);
26
+ function _next(value) {
27
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
28
+ }
29
+ function _throw(err) {
30
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
31
+ }
32
+ _next(undefined);
33
+ });
34
+ };
35
+ }
36
+ function _classCallCheck(instance, Constructor) {
37
+ if (!(instance instanceof Constructor)) {
38
+ throw new TypeError("Cannot call a class as a function");
39
+ }
40
+ }
41
+ function _defineProperties(target, props) {
42
+ for(var i = 0; i < props.length; i++){
43
+ var descriptor = props[i];
44
+ descriptor.enumerable = descriptor.enumerable || false;
45
+ descriptor.configurable = true;
46
+ if ("value" in descriptor) descriptor.writable = true;
47
+ Object.defineProperty(target, descriptor.key, descriptor);
48
+ }
49
+ }
50
+ function _createClass(Constructor, protoProps, staticProps) {
51
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
52
+ if (staticProps) _defineProperties(Constructor, staticProps);
53
+ return Constructor;
54
+ }
55
+ function _get(target, property, receiver) {
56
+ if (typeof Reflect !== "undefined" && Reflect.get) {
57
+ _get = Reflect.get;
58
+ } else {
59
+ _get = function _get(target, property, receiver) {
60
+ var base = _superPropBase(target, property);
61
+ if (!base) return;
62
+ var desc = Object.getOwnPropertyDescriptor(base, property);
63
+ if (desc.get) {
64
+ return desc.get.call(receiver);
65
+ }
66
+ return desc.value;
67
+ };
68
+ }
69
+ return _get(target, property, receiver || target);
70
+ }
71
+ function _getPrototypeOf(o) {
72
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
73
+ return o.__proto__ || Object.getPrototypeOf(o);
74
+ };
75
+ return _getPrototypeOf(o);
76
+ }
77
+ function _inherits(subClass, superClass) {
78
+ if (typeof superClass !== "function" && superClass !== null) {
79
+ throw new TypeError("Super expression must either be null or a function");
80
+ }
81
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
82
+ constructor: {
83
+ value: subClass,
84
+ writable: true,
85
+ configurable: true
86
+ }
87
+ });
88
+ if (superClass) _setPrototypeOf(subClass, superClass);
89
+ }
90
+ function _possibleConstructorReturn(self, call) {
91
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
92
+ return call;
93
+ }
94
+ return _assertThisInitialized(self);
95
+ }
96
+ function _setPrototypeOf(o, p) {
97
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
98
+ o.__proto__ = p;
99
+ return o;
100
+ };
101
+ return _setPrototypeOf(o, p);
102
+ }
103
+ function _superPropBase(object, property) {
104
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
105
+ object = _getPrototypeOf(object);
106
+ if (object === null) break;
107
+ }
108
+ return object;
109
+ }
110
+ var _typeof = function(obj) {
111
+ "@swc/helpers - typeof";
112
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
113
+ };
114
+ function _isNativeReflectConstruct() {
115
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
116
+ if (Reflect.construct.sham) return false;
117
+ if (typeof Proxy === "function") return true;
118
+ try {
119
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
120
+ return true;
121
+ } catch (e) {
122
+ return false;
123
+ }
124
+ }
125
+ function _createSuper(Derived) {
126
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
127
+ return function _createSuperInternal() {
128
+ var Super = _getPrototypeOf(Derived), result;
129
+ if (hasNativeReflectConstruct) {
130
+ var NewTarget = _getPrototypeOf(this).constructor;
131
+ result = Reflect.construct(Super, arguments, NewTarget);
132
+ } else {
133
+ result = Super.apply(this, arguments);
134
+ }
135
+ return _possibleConstructorReturn(this, result);
136
+ };
137
+ }
138
+ var __generator = this && this.__generator || function(thisArg, body) {
139
+ var f, y, t, g, _ = {
140
+ label: 0,
141
+ sent: function() {
142
+ if (t[0] & 1) throw t[1];
143
+ return t[1];
144
+ },
145
+ trys: [],
146
+ ops: []
147
+ };
148
+ return g = {
149
+ next: verb(0),
150
+ "throw": verb(1),
151
+ "return": verb(2)
152
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
153
+ return this;
154
+ }), g;
155
+ function verb(n) {
156
+ return function(v) {
157
+ return step([
158
+ n,
159
+ v
160
+ ]);
161
+ };
162
+ }
163
+ function step(op) {
164
+ if (f) throw new TypeError("Generator is already executing.");
165
+ while(_)try {
166
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
167
+ if (y = 0, t) op = [
168
+ op[0] & 2,
169
+ t.value
170
+ ];
171
+ switch(op[0]){
172
+ case 0:
173
+ case 1:
174
+ t = op;
175
+ break;
176
+ case 4:
177
+ _.label++;
178
+ return {
179
+ value: op[1],
180
+ done: false
181
+ };
182
+ case 5:
183
+ _.label++;
184
+ y = op[1];
185
+ op = [
186
+ 0
187
+ ];
188
+ continue;
189
+ case 7:
190
+ op = _.ops.pop();
191
+ _.trys.pop();
192
+ continue;
193
+ default:
194
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
195
+ _ = 0;
196
+ continue;
197
+ }
198
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
199
+ _.label = op[1];
200
+ break;
201
+ }
202
+ if (op[0] === 6 && _.label < t[1]) {
203
+ _.label = t[1];
204
+ t = op;
205
+ break;
206
+ }
207
+ if (t && _.label < t[2]) {
208
+ _.label = t[2];
209
+ _.ops.push(op);
210
+ break;
211
+ }
212
+ if (t[2]) _.ops.pop();
213
+ _.trys.pop();
214
+ continue;
215
+ }
216
+ op = body.call(thisArg, _);
217
+ } catch (e) {
218
+ op = [
219
+ 6,
220
+ e
221
+ ];
222
+ y = 0;
223
+ } finally{
224
+ f = t = 0;
225
+ }
226
+ if (op[0] & 5) throw op[1];
227
+ return {
228
+ value: op[0] ? op[1] : void 0,
229
+ done: true
230
+ };
231
+ }
232
+ };
9
233
  import { ModernServer } from "./modern-server";
10
- var ModernSSRServer = /*#__PURE__*/function (_ModernServer) {
11
- _inherits(ModernSSRServer, _ModernServer);
12
- var _super = _createSuper(ModernSSRServer);
13
- function ModernSSRServer() {
14
- _classCallCheck(this, ModernSSRServer);
15
- return _super.apply(this, arguments);
16
- }
17
- _createClass(ModernSSRServer, [{
18
- key: "prepareAPIHandler",
19
- value: function prepareAPIHandler(_) {
20
- return null;
21
- }
22
- }, {
23
- key: "handleAPI",
24
- value: function () {
25
- var _handleAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(context) {
26
- return _regeneratorRuntime().wrap(function _callee$(_context) {
27
- while (1) {
28
- switch (_context.prev = _context.next) {
29
- case 0:
30
- return _context.abrupt("return", this.render404(context));
31
- case 1:
32
- case "end":
33
- return _context.stop();
234
+ var ModernSSRServer = /*#__PURE__*/ function(ModernServer) {
235
+ "use strict";
236
+ _inherits(ModernSSRServer, ModernServer);
237
+ var _super = _createSuper(ModernSSRServer);
238
+ function ModernSSRServer() {
239
+ _classCallCheck(this, ModernSSRServer);
240
+ return _super.apply(this, arguments);
241
+ }
242
+ _createClass(ModernSSRServer, [
243
+ {
244
+ key: "prepareAPIHandler",
245
+ value: function prepareAPIHandler(_) {
246
+ return null;
247
+ }
248
+ },
249
+ {
250
+ key: "handleAPI",
251
+ value: function handleAPI(context) {
252
+ var _this = this;
253
+ return _asyncToGenerator(function() {
254
+ return __generator(this, function(_state) {
255
+ return [
256
+ 2,
257
+ _this.render404(context)
258
+ ];
259
+ });
260
+ })();
34
261
  }
35
- }
36
- }, _callee, this);
37
- }));
38
- function handleAPI(_x) {
39
- return _handleAPI.apply(this, arguments);
40
- }
41
- return handleAPI;
42
- }()
43
- }]);
44
- return ModernSSRServer;
262
+ }
263
+ ]);
264
+ return ModernSSRServer;
45
265
  }(ModernServer);
46
- var ModernAPIServer = /*#__PURE__*/function (_ModernServer2) {
47
- _inherits(ModernAPIServer, _ModernServer2);
48
- var _super2 = _createSuper(ModernAPIServer);
49
- function ModernAPIServer() {
50
- _classCallCheck(this, ModernAPIServer);
51
- return _super2.apply(this, arguments);
52
- }
53
- _createClass(ModernAPIServer, [{
54
- key: "prepareWebHandler",
55
- value: function prepareWebHandler(_) {
56
- return null;
57
- }
58
- }, {
59
- key: "filterRoutes",
60
- value: function filterRoutes(routes) {
61
- return routes.filter(function (route) {
62
- return route.isApi;
63
- });
64
- }
65
- }]);
66
- return ModernAPIServer;
266
+ var ModernAPIServer = /*#__PURE__*/ function(ModernServer) {
267
+ "use strict";
268
+ _inherits(ModernAPIServer, ModernServer);
269
+ var _super = _createSuper(ModernAPIServer);
270
+ function ModernAPIServer() {
271
+ _classCallCheck(this, ModernAPIServer);
272
+ return _super.apply(this, arguments);
273
+ }
274
+ _createClass(ModernAPIServer, [
275
+ {
276
+ key: "prepareWebHandler",
277
+ value: function prepareWebHandler(_) {
278
+ return null;
279
+ }
280
+ },
281
+ {
282
+ key: "filterRoutes",
283
+ value: function filterRoutes(routes) {
284
+ return routes.filter(function(route) {
285
+ return route.isApi;
286
+ });
287
+ }
288
+ }
289
+ ]);
290
+ return ModernAPIServer;
67
291
  }(ModernServer);
68
- var ModernWebServer = /*#__PURE__*/function (_ModernServer3) {
69
- _inherits(ModernWebServer, _ModernServer3);
70
- var _super3 = _createSuper(ModernWebServer);
71
- function ModernWebServer() {
72
- _classCallCheck(this, ModernWebServer);
73
- return _super3.apply(this, arguments);
74
- }
75
- _createClass(ModernWebServer, [{
76
- key: "warmupSSRBundle",
77
- value: function () {
78
- var _warmupSSRBundle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
79
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
80
- while (1) {
81
- switch (_context2.prev = _context2.next) {
82
- case 0:
83
- return _context2.abrupt("return", null);
84
- case 1:
85
- case "end":
86
- return _context2.stop();
292
+ var ModernWebServer = /*#__PURE__*/ function(ModernServer) {
293
+ "use strict";
294
+ _inherits(ModernWebServer, ModernServer);
295
+ var _super = _createSuper(ModernWebServer);
296
+ function ModernWebServer() {
297
+ _classCallCheck(this, ModernWebServer);
298
+ return _super.apply(this, arguments);
299
+ }
300
+ _createClass(ModernWebServer, [
301
+ {
302
+ key: "warmupSSRBundle",
303
+ value: function warmupSSRBundle() {
304
+ return _asyncToGenerator(function() {
305
+ return __generator(this, function(_state) {
306
+ return [
307
+ 2,
308
+ null
309
+ ];
310
+ });
311
+ })();
87
312
  }
88
- }
89
- }, _callee2);
90
- }));
91
- function warmupSSRBundle() {
92
- return _warmupSSRBundle.apply(this, arguments);
93
- }
94
- return warmupSSRBundle;
95
- }()
96
- }, {
97
- key: "handleAPI",
98
- value: function () {
99
- var _handleAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(context) {
100
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
101
- while (1) {
102
- switch (_context3.prev = _context3.next) {
103
- case 0:
104
- return _context3.abrupt("return", this.render404(context));
105
- case 1:
106
- case "end":
107
- return _context3.stop();
313
+ },
314
+ {
315
+ key: "handleAPI",
316
+ value: function handleAPI(context) {
317
+ var _this = this;
318
+ return _asyncToGenerator(function() {
319
+ return __generator(this, function(_state) {
320
+ return [
321
+ 2,
322
+ _this.render404(context)
323
+ ];
324
+ });
325
+ })();
108
326
  }
109
- }
110
- }, _callee3, this);
111
- }));
112
- function handleAPI(_x2) {
113
- return _handleAPI2.apply(this, arguments);
114
- }
115
- return handleAPI;
116
- }()
117
- }, {
118
- key: "handleWeb",
119
- value: function () {
120
- var _handleWeb = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(context, route) {
121
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
122
- while (1) {
123
- switch (_context4.prev = _context4.next) {
124
- case 0:
125
- route.isSSR = false;
126
- return _context4.abrupt("return", _get(_getPrototypeOf(ModernWebServer.prototype), "handleWeb", this).call(this, context, route));
127
- case 2:
128
- case "end":
129
- return _context4.stop();
327
+ },
328
+ {
329
+ key: "handleWeb",
330
+ value: function handleWeb(context, route) {
331
+ var _this = this;
332
+ var _this1 = this, _superprop_get_handleWeb = function() {
333
+ return _get(_getPrototypeOf(ModernWebServer.prototype), "handleWeb", _this);
334
+ };
335
+ return _asyncToGenerator(function() {
336
+ return __generator(this, function(_state) {
337
+ route.isSSR = false;
338
+ return [
339
+ 2,
340
+ _superprop_get_handleWeb().call(_this1, context, route)
341
+ ];
342
+ });
343
+ })();
130
344
  }
131
- }
132
- }, _callee4, this);
133
- }));
134
- function handleWeb(_x3, _x4) {
135
- return _handleWeb.apply(this, arguments);
136
- }
137
- return handleWeb;
138
- }()
139
- }]);
140
- return ModernWebServer;
345
+ }
346
+ ]);
347
+ return ModernWebServer;
141
348
  }(ModernServer);
142
- export var createProdServer = function createProdServer(options) {
143
- if (options.apiOnly) {
144
- return new ModernAPIServer(options);
145
- } else if (options.ssrOnly) {
146
- return new ModernSSRServer(options);
147
- } else if (options.webOnly) {
148
- return new ModernWebServer(options);
149
- } else {
150
- return new ModernServer(options);
151
- }
152
- };
349
+ var createProdServer = function(options) {
350
+ if (options.apiOnly) {
351
+ return new ModernAPIServer(options);
352
+ } else if (options.ssrOnly) {
353
+ return new ModernSSRServer(options);
354
+ } else if (options.webOnly) {
355
+ return new ModernWebServer(options);
356
+ } else {
357
+ return new ModernServer(options);
358
+ }
359
+ };
360
+ export { createProdServer };