@modern-js/prod-server 2.0.0-beta.4 → 2.0.0-beta.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/js/modern/libs/hook-api/index.js +3 -1
  3. package/dist/js/modern/server/index.js +8 -2
  4. package/dist/js/modern/server/modern-server.js +10 -8
  5. package/dist/js/node/constants.js +11 -3
  6. package/dist/js/node/index.js +11 -5
  7. package/dist/js/node/libs/context/context.js +7 -3
  8. package/dist/js/node/libs/context/index.js +8 -3
  9. package/dist/js/node/libs/hook-api/index.js +30 -23
  10. package/dist/js/node/libs/hook-api/route.js +7 -3
  11. package/dist/js/node/libs/hook-api/template.js +8 -3
  12. package/dist/js/node/libs/loadConfig.js +26 -22
  13. package/dist/js/node/libs/metrics.js +7 -3
  14. package/dist/js/node/libs/proxy.js +27 -24
  15. package/dist/js/node/libs/render/cache/__tests__/cache.fun.test.js +76 -95
  16. package/dist/js/node/libs/render/cache/__tests__/cache.test.js +208 -239
  17. package/dist/js/node/libs/render/cache/__tests__/cacheable.js +7 -3
  18. package/dist/js/node/libs/render/cache/__tests__/error-configuration.js +7 -3
  19. package/dist/js/node/libs/render/cache/__tests__/matched-cache.js +7 -3
  20. package/dist/js/node/libs/render/cache/index.js +25 -25
  21. package/dist/js/node/libs/render/cache/page-caches/index.js +10 -6
  22. package/dist/js/node/libs/render/cache/page-caches/lru.js +7 -3
  23. package/dist/js/node/libs/render/cache/spr.js +16 -11
  24. package/dist/js/node/libs/render/cache/type.js +15 -0
  25. package/dist/js/node/libs/render/cache/util.js +24 -13
  26. package/dist/js/node/libs/render/index.js +15 -11
  27. package/dist/js/node/libs/render/measure.js +25 -22
  28. package/dist/js/node/libs/render/reader.js +19 -11
  29. package/dist/js/node/libs/render/ssr.js +14 -10
  30. package/dist/js/node/libs/render/static.js +12 -8
  31. package/dist/js/node/libs/render/type.js +7 -3
  32. package/dist/js/node/libs/route/index.js +8 -3
  33. package/dist/js/node/libs/route/matcher.js +7 -3
  34. package/dist/js/node/libs/route/route.js +7 -3
  35. package/dist/js/node/libs/serve-file.js +14 -9
  36. package/dist/js/node/server/index.js +42 -34
  37. package/dist/js/node/server/modern-server-split.js +12 -8
  38. package/dist/js/node/server/modern-server.js +52 -48
  39. package/dist/js/node/type.js +15 -0
  40. package/dist/js/node/utils.js +30 -19
  41. package/dist/js/node/worker-server.js +10 -6
  42. package/dist/js/treeshaking/libs/hook-api/index.js +4 -2
  43. package/dist/js/treeshaking/server/index.js +28 -3
  44. package/dist/js/treeshaking/server/modern-server.js +10 -8
  45. package/dist/types/libs/context/context.d.ts +1 -1
  46. package/dist/types/utils.d.ts +1 -1
  47. package/package.json +7 -7
@@ -1,38 +1,11 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- default: () => stdin_default
21
- });
22
- module.exports = __toCommonJS(stdin_exports);
23
- var import_spr = require("../spr");
24
- var import_error_configuration = require("./error-configuration");
25
- var import_cacheable = require("./cacheable");
26
- var import_matched_cache = require("./matched-cache");
27
- var __defProp2 = Object.defineProperty;
28
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
29
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
30
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
31
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
32
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
33
6
  var __spreadValues = (a, b) => {
34
7
  for (var prop in b || (b = {}))
35
- if (__hasOwnProp2.call(b, prop))
8
+ if (__hasOwnProp.call(b, prop))
36
9
  __defNormalProp(a, prop, b[prop]);
37
10
  if (__getOwnPropSymbols)
38
11
  for (var prop of __getOwnPropSymbols(b)) {
@@ -41,9 +14,6 @@ var __spreadValues = (a, b) => {
41
14
  }
42
15
  return a;
43
16
  };
44
- var __commonJS = (cb, mod) => function __require() {
45
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
46
- };
47
17
  var __async = (__this, __arguments, generator) => {
48
18
  return new Promise((resolve, reject) => {
49
19
  var fulfilled = (value) => {
@@ -64,213 +34,212 @@ var __async = (__this, __arguments, generator) => {
64
34
  step((generator = generator.apply(__this, __arguments)).next());
65
35
  });
66
36
  };
67
- var require_cache_test = __commonJS({
68
- "src/libs/render/cache/__tests__/cache.test.ts"(exports) {
69
- const createCacheConfig = (config = {}) => __spreadValues({
70
- excludes: null,
71
- includes: null,
72
- interval: 10,
73
- staleLimit: false,
74
- level: 0,
75
- fallback: false,
76
- matches: null
77
- }, config);
78
- jest.setTimeout(6e4);
79
- describe("cache", () => {
80
- it("should cache correctly", () => __async(exports, null, function* () {
81
- (0, import_spr.destroyCache)();
82
- const cache = (0, import_spr.createCache)();
83
- const context = {
84
- entry: "",
85
- pathname: "",
86
- query: {},
87
- headers: {}
88
- };
89
- const content = "hello";
90
- const cacheConfig = createCacheConfig();
91
- yield cache.set(context, content, cacheConfig, true);
92
- const cacheResult = yield cache.get(context);
93
- expect(cacheResult).not.toBe(null);
94
- expect(cacheResult == null ? void 0 : cacheResult.content).toBe("hello");
95
- }));
96
- it("should ignore cache set when cache config not exist", () => __async(exports, null, function* () {
97
- (0, import_spr.destroyCache)();
98
- (0, import_spr.destroyCache)();
99
- const cache = (0, import_spr.createCache)();
100
- const context = {
101
- entry: "",
102
- pathname: "",
103
- query: {},
104
- headers: {}
105
- };
106
- const content = "hello";
107
- const shouldCache = yield cache.set(context, content, null, true);
108
- expect(shouldCache).toBe(false);
109
- }));
110
- it("should calcual cache key error", () => __async(exports, null, function* () {
111
- (0, import_spr.destroyCache)();
112
- const cache = (0, import_spr.createCache)();
113
- const content = "hello";
114
- for (const config of import_error_configuration.errorConfiguration) {
115
- const cacheConfig = createCacheConfig(config);
116
- const tmpEntry = Math.random().toString();
117
- const context = {
118
- entry: tmpEntry,
119
- pathname: "",
120
- query: {},
121
- headers: {}
122
- };
123
- const shouldCache = yield cache.set(context, content, cacheConfig);
124
- expect(shouldCache).toBe(false);
125
- }
126
- }));
127
- it("should get nothing for diff requestKey", () => __async(exports, null, function* () {
128
- (0, import_spr.destroyCache)();
129
- const cache = (0, import_spr.createCache)();
130
- const context = {
131
- entry: "",
132
- pathname: "",
133
- query: {},
134
- headers: {}
135
- };
136
- const content = "hello";
137
- const cacheConfig = createCacheConfig({
138
- level: 1,
139
- includes: { query: ["name"] }
140
- });
141
- yield cache.set(context, content, cacheConfig, true);
142
- const context_req = {
143
- entry: "",
144
- pathname: "/home",
145
- query: {},
146
- headers: {}
147
- };
148
- const cacheResult = yield cache.get(context_req);
149
- expect(cacheResult).toBe(null);
150
- }));
151
- it("should get nothing for diff cacheHash", () => __async(exports, null, function* () {
152
- (0, import_spr.destroyCache)();
153
- const cache = (0, import_spr.createCache)();
154
- const context = {
155
- entry: "",
156
- pathname: "",
157
- query: {},
158
- headers: {}
159
- };
160
- const content = "hello";
161
- const cacheConfig = createCacheConfig({
162
- level: 1,
163
- includes: { query: ["name"] }
164
- });
165
- yield cache.set(context, content, cacheConfig, true);
166
- const context_req = {
167
- entry: "",
168
- pathname: "",
169
- query: { name: "zll" },
170
- headers: {}
171
- };
172
- const cacheResult = yield cache.get(context_req);
173
- expect(cacheResult).toBe(null);
174
- }));
175
- it("should get cache correctly", () => __async(exports, null, function* () {
176
- (0, import_spr.destroyCache)();
177
- const cache = (0, import_spr.createCache)();
178
- for (const cacheable of import_cacheable.cacheabelAry) {
179
- const context = {
180
- entry: "",
181
- pathname: cacheable.requestOpt.url,
182
- query: cacheable.requestOpt.query || {},
183
- headers: cacheable.requestOpt.headers || {}
184
- };
185
- const cacheConfig = createCacheConfig(cacheable.cacheConfig || {});
186
- yield cache.set(context, cacheable.content, cacheConfig, true);
187
- const cacheResult = yield cache.get(context);
188
- expect(cacheResult == null ? void 0 : cacheResult.content).toBe(cacheable.content);
189
- }
190
- }));
191
- it("should match cache correctly", () => __async(exports, null, function* () {
192
- (0, import_spr.destroyCache)();
193
- const cache = (0, import_spr.createCache)();
194
- for (const cacheable of import_matched_cache.matchedCacheableAry) {
195
- const [baseCacheable, matchOne, ...other] = cacheable;
196
- const { requestOpt = {}, cacheConfig, content } = baseCacheable;
197
- const context = {
198
- entry: "",
199
- pathname: requestOpt.url,
200
- query: requestOpt.query,
201
- headers: requestOpt.headers
202
- };
203
- yield cache.set(context, content, createCacheConfig(cacheConfig), true);
204
- const matchContext = {
205
- entry: "",
206
- pathname: matchOne.url,
207
- query: matchOne.query,
208
- headers: matchOne.headers
209
- };
210
- const cacheResult = yield cache.get(matchContext);
211
- expect(cacheResult == null ? void 0 : cacheResult.content).toBe(content);
212
- for (const notMatch of other) {
213
- const notMatchContext = {
214
- entry: "",
215
- pathname: notMatch.url,
216
- query: notMatch.query,
217
- headers: notMatch.headers
218
- };
219
- const nothing = yield cache.get(notMatchContext);
220
- expect(nothing).toBe(null);
221
- }
222
- }
223
- }));
224
- it("should stale cache correctly", () => __async(exports, null, function* () {
225
- (0, import_spr.destroyCache)();
226
- const cache = (0, import_spr.createCache)();
227
- const context = {
228
- entry: "",
229
- pathname: "",
230
- query: {},
231
- headers: {}
232
- };
233
- const config = createCacheConfig({ interval: 5 });
234
- const content = "hello";
235
- const shouldCache = yield cache.set(context, content, config, true);
236
- expect(shouldCache.value).toBe(true);
237
- const freshResult = yield cache.get(context);
238
- expect(freshResult == null ? void 0 : freshResult.isStale).toBe(false);
239
- yield new Promise((resolve) => {
240
- setTimeout(() => {
241
- resolve();
242
- }, 6e3);
243
- });
244
- const staleResult = yield cache.get(context);
245
- expect(staleResult == null ? void 0 : staleResult.isStale).toBe(true);
246
- }));
247
- it("should garbage cache correctly", () => __async(exports, null, function* () {
248
- (0, import_spr.destroyCache)();
249
- const cache = (0, import_spr.createCache)();
250
- const context = {
37
+ var import_spr = require("../spr");
38
+ var import_error_configuration = require("./error-configuration");
39
+ var import_cacheable = require("./cacheable");
40
+ var import_matched_cache = require("./matched-cache");
41
+ const createCacheConfig = (config = {}) => __spreadValues({
42
+ excludes: null,
43
+ includes: null,
44
+ interval: 10,
45
+ staleLimit: false,
46
+ level: 0,
47
+ fallback: false,
48
+ matches: null
49
+ }, config);
50
+ jest.setTimeout(6e4);
51
+ describe("cache", () => {
52
+ it("should cache correctly", () => __async(exports, null, function* () {
53
+ (0, import_spr.destroyCache)();
54
+ const cache = (0, import_spr.createCache)();
55
+ const context = {
56
+ entry: "",
57
+ pathname: "",
58
+ query: {},
59
+ headers: {}
60
+ };
61
+ const content = "hello";
62
+ const cacheConfig = createCacheConfig();
63
+ yield cache.set(context, content, cacheConfig, true);
64
+ const cacheResult = yield cache.get(context);
65
+ expect(cacheResult).not.toBe(null);
66
+ expect(cacheResult == null ? void 0 : cacheResult.content).toBe("hello");
67
+ }));
68
+ it("should ignore cache set when cache config not exist", () => __async(exports, null, function* () {
69
+ (0, import_spr.destroyCache)();
70
+ (0, import_spr.destroyCache)();
71
+ const cache = (0, import_spr.createCache)();
72
+ const context = {
73
+ entry: "",
74
+ pathname: "",
75
+ query: {},
76
+ headers: {}
77
+ };
78
+ const content = "hello";
79
+ const shouldCache = yield cache.set(context, content, null, true);
80
+ expect(shouldCache).toBe(false);
81
+ }));
82
+ it("should calcual cache key error", () => __async(exports, null, function* () {
83
+ (0, import_spr.destroyCache)();
84
+ const cache = (0, import_spr.createCache)();
85
+ const content = "hello";
86
+ for (const config of import_error_configuration.errorConfiguration) {
87
+ const cacheConfig = createCacheConfig(config);
88
+ const tmpEntry = Math.random().toString();
89
+ const context = {
90
+ entry: tmpEntry,
91
+ pathname: "",
92
+ query: {},
93
+ headers: {}
94
+ };
95
+ const shouldCache = yield cache.set(context, content, cacheConfig);
96
+ expect(shouldCache).toBe(false);
97
+ }
98
+ }));
99
+ it("should get nothing for diff requestKey", () => __async(exports, null, function* () {
100
+ (0, import_spr.destroyCache)();
101
+ const cache = (0, import_spr.createCache)();
102
+ const context = {
103
+ entry: "",
104
+ pathname: "",
105
+ query: {},
106
+ headers: {}
107
+ };
108
+ const content = "hello";
109
+ const cacheConfig = createCacheConfig({
110
+ level: 1,
111
+ includes: { query: ["name"] }
112
+ });
113
+ yield cache.set(context, content, cacheConfig, true);
114
+ const context_req = {
115
+ entry: "",
116
+ pathname: "/home",
117
+ query: {},
118
+ headers: {}
119
+ };
120
+ const cacheResult = yield cache.get(context_req);
121
+ expect(cacheResult).toBe(null);
122
+ }));
123
+ it("should get nothing for diff cacheHash", () => __async(exports, null, function* () {
124
+ (0, import_spr.destroyCache)();
125
+ const cache = (0, import_spr.createCache)();
126
+ const context = {
127
+ entry: "",
128
+ pathname: "",
129
+ query: {},
130
+ headers: {}
131
+ };
132
+ const content = "hello";
133
+ const cacheConfig = createCacheConfig({
134
+ level: 1,
135
+ includes: { query: ["name"] }
136
+ });
137
+ yield cache.set(context, content, cacheConfig, true);
138
+ const context_req = {
139
+ entry: "",
140
+ pathname: "",
141
+ query: { name: "zll" },
142
+ headers: {}
143
+ };
144
+ const cacheResult = yield cache.get(context_req);
145
+ expect(cacheResult).toBe(null);
146
+ }));
147
+ it("should get cache correctly", () => __async(exports, null, function* () {
148
+ (0, import_spr.destroyCache)();
149
+ const cache = (0, import_spr.createCache)();
150
+ for (const cacheable of import_cacheable.cacheabelAry) {
151
+ const context = {
152
+ entry: "",
153
+ pathname: cacheable.requestOpt.url,
154
+ query: cacheable.requestOpt.query || {},
155
+ headers: cacheable.requestOpt.headers || {}
156
+ };
157
+ const cacheConfig = createCacheConfig(cacheable.cacheConfig || {});
158
+ yield cache.set(context, cacheable.content, cacheConfig, true);
159
+ const cacheResult = yield cache.get(context);
160
+ expect(cacheResult == null ? void 0 : cacheResult.content).toBe(cacheable.content);
161
+ }
162
+ }));
163
+ it("should match cache correctly", () => __async(exports, null, function* () {
164
+ (0, import_spr.destroyCache)();
165
+ const cache = (0, import_spr.createCache)();
166
+ for (const cacheable of import_matched_cache.matchedCacheableAry) {
167
+ const [baseCacheable, matchOne, ...other] = cacheable;
168
+ const { requestOpt = {}, cacheConfig, content } = baseCacheable;
169
+ const context = {
170
+ entry: "",
171
+ pathname: requestOpt.url,
172
+ query: requestOpt.query,
173
+ headers: requestOpt.headers
174
+ };
175
+ yield cache.set(context, content, createCacheConfig(cacheConfig), true);
176
+ const matchContext = {
177
+ entry: "",
178
+ pathname: matchOne.url,
179
+ query: matchOne.query,
180
+ headers: matchOne.headers
181
+ };
182
+ const cacheResult = yield cache.get(matchContext);
183
+ expect(cacheResult == null ? void 0 : cacheResult.content).toBe(content);
184
+ for (const notMatch of other) {
185
+ const notMatchContext = {
251
186
  entry: "",
252
- pathname: "",
253
- query: {},
254
- headers: {}
187
+ pathname: notMatch.url,
188
+ query: notMatch.query,
189
+ headers: notMatch.headers
255
190
  };
256
- const config = createCacheConfig({
257
- interval: 3,
258
- staleLimit: 8
259
- });
260
- const content = "hello";
261
- const shouldCache = yield cache.set(context, content, config, true);
262
- expect(shouldCache.value).toBe(true);
263
- const freshResult = yield cache.get(context);
264
- expect(freshResult == null ? void 0 : freshResult.isGarbage).toBe(false);
265
- yield new Promise((resolve) => {
266
- setTimeout(() => {
267
- resolve();
268
- }, 1e4);
269
- });
270
- const staleResult = yield cache.get(context);
271
- expect(staleResult == null ? void 0 : staleResult.isGarbage).toBe(true);
272
- }));
191
+ const nothing = yield cache.get(notMatchContext);
192
+ expect(nothing).toBe(null);
193
+ }
194
+ }
195
+ }));
196
+ it("should stale cache correctly", () => __async(exports, null, function* () {
197
+ (0, import_spr.destroyCache)();
198
+ const cache = (0, import_spr.createCache)();
199
+ const context = {
200
+ entry: "",
201
+ pathname: "",
202
+ query: {},
203
+ headers: {}
204
+ };
205
+ const config = createCacheConfig({ interval: 5 });
206
+ const content = "hello";
207
+ const shouldCache = yield cache.set(context, content, config, true);
208
+ expect(shouldCache.value).toBe(true);
209
+ const freshResult = yield cache.get(context);
210
+ expect(freshResult == null ? void 0 : freshResult.isStale).toBe(false);
211
+ yield new Promise((resolve) => {
212
+ setTimeout(() => {
213
+ resolve();
214
+ }, 6e3);
215
+ });
216
+ const staleResult = yield cache.get(context);
217
+ expect(staleResult == null ? void 0 : staleResult.isStale).toBe(true);
218
+ }));
219
+ it("should garbage cache correctly", () => __async(exports, null, function* () {
220
+ (0, import_spr.destroyCache)();
221
+ const cache = (0, import_spr.createCache)();
222
+ const context = {
223
+ entry: "",
224
+ pathname: "",
225
+ query: {},
226
+ headers: {}
227
+ };
228
+ const config = createCacheConfig({
229
+ interval: 3,
230
+ staleLimit: 8
231
+ });
232
+ const content = "hello";
233
+ const shouldCache = yield cache.set(context, content, config, true);
234
+ expect(shouldCache.value).toBe(true);
235
+ const freshResult = yield cache.get(context);
236
+ expect(freshResult == null ? void 0 : freshResult.isGarbage).toBe(false);
237
+ yield new Promise((resolve) => {
238
+ setTimeout(() => {
239
+ resolve();
240
+ }, 1e4);
273
241
  });
274
- }
242
+ const staleResult = yield cache.get(context);
243
+ expect(staleResult == null ? void 0 : staleResult.isGarbage).toBe(true);
244
+ }));
275
245
  });
276
- var stdin_default = require_cache_test();
@@ -15,11 +15,11 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var cacheable_exports = {};
19
+ __export(cacheable_exports, {
20
20
  cacheabelAry: () => cacheabelAry
21
21
  });
22
- module.exports = __toCommonJS(stdin_exports);
22
+ module.exports = __toCommonJS(cacheable_exports);
23
23
  const cacheabelAry = [
24
24
  {
25
25
  requestOpt: { url: "/" },
@@ -64,3 +64,7 @@ const cacheabelAry = [
64
64
  content: "level3"
65
65
  }
66
66
  ];
67
+ // Annotate the CommonJS export names for ESM import in node:
68
+ 0 && (module.exports = {
69
+ cacheabelAry
70
+ });
@@ -15,11 +15,11 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var error_configuration_exports = {};
19
+ __export(error_configuration_exports, {
20
20
  errorConfiguration: () => errorConfiguration
21
21
  });
22
- module.exports = __toCommonJS(stdin_exports);
22
+ module.exports = __toCommonJS(error_configuration_exports);
23
23
  const errorConfiguration = [
24
24
  { level: 1 },
25
25
  {
@@ -54,3 +54,7 @@ const errorConfiguration = [
54
54
  }
55
55
  }
56
56
  ];
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ errorConfiguration
60
+ });
@@ -15,11 +15,11 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var matched_cache_exports = {};
19
+ __export(matched_cache_exports, {
20
20
  matchedCacheableAry: () => matchedCacheableAry
21
21
  });
22
- module.exports = __toCommonJS(stdin_exports);
22
+ module.exports = __toCommonJS(matched_cache_exports);
23
23
  const matchedCacheableAry = [
24
24
  [
25
25
  {
@@ -108,3 +108,7 @@ const matchedCacheableAry = [
108
108
  }
109
109
  ]
110
110
  ];
111
+ // Annotate the CommonJS export names for ESM import in node:
112
+ 0 && (module.exports = {
113
+ matchedCacheableAry
114
+ });
@@ -1,7 +1,21 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
5
19
  var __export = (target, all) => {
6
20
  for (var name in all)
7
21
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,31 +29,6 @@ var __copyProps = (to, from, except, desc) => {
15
29
  return to;
16
30
  };
17
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- default: () => cache_default
21
- });
22
- module.exports = __toCommonJS(stdin_exports);
23
- var import_stream = require("stream");
24
- var import_constants = require("../../../constants");
25
- var import_spr = require("./spr");
26
- var import_util = require("./util");
27
- var __defProp2 = Object.defineProperty;
28
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
29
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
30
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
31
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
32
- var __spreadValues = (a, b) => {
33
- for (var prop in b || (b = {}))
34
- if (__hasOwnProp2.call(b, prop))
35
- __defNormalProp(a, prop, b[prop]);
36
- if (__getOwnPropSymbols)
37
- for (var prop of __getOwnPropSymbols(b)) {
38
- if (__propIsEnum.call(b, prop))
39
- __defNormalProp(a, prop, b[prop]);
40
- }
41
- return a;
42
- };
43
32
  var __async = (__this, __arguments, generator) => {
44
33
  return new Promise((resolve, reject) => {
45
34
  var fulfilled = (value) => {
@@ -60,6 +49,15 @@ var __async = (__this, __arguments, generator) => {
60
49
  step((generator = generator.apply(__this, __arguments)).next());
61
50
  });
62
51
  };
52
+ var cache_exports = {};
53
+ __export(cache_exports, {
54
+ default: () => cache_default
55
+ });
56
+ module.exports = __toCommonJS(cache_exports);
57
+ var import_stream = require("stream");
58
+ var import_constants = require("../../../constants");
59
+ var import_spr = require("./spr");
60
+ var import_util = require("./util");
63
61
  var cache_default = (renderFn, ctx) => {
64
62
  const sprCache = (0, import_spr.createCache)();
65
63
  const doRender = (context) => __async(void 0, null, function* () {
@@ -132,3 +130,5 @@ var cache_default = (renderFn, ctx) => {
132
130
  });
133
131
  return doRender;
134
132
  };
133
+ // Annotate the CommonJS export names for ESM import in node:
134
+ 0 && (module.exports = {});
@@ -15,12 +15,6 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
20
- createPageCaches: () => createPageCaches
21
- });
22
- module.exports = __toCommonJS(stdin_exports);
23
- var import_lru = require("./lru");
24
18
  var __async = (__this, __arguments, generator) => {
25
19
  return new Promise((resolve, reject) => {
26
20
  var fulfilled = (value) => {
@@ -41,6 +35,12 @@ var __async = (__this, __arguments, generator) => {
41
35
  step((generator = generator.apply(__this, __arguments)).next());
42
36
  });
43
37
  };
38
+ var page_caches_exports = {};
39
+ __export(page_caches_exports, {
40
+ createPageCaches: () => createPageCaches
41
+ });
42
+ module.exports = __toCommonJS(page_caches_exports);
43
+ var import_lru = require("./lru");
44
44
  function createPageCaches(max) {
45
45
  return __async(this, null, function* () {
46
46
  const constructorOptions = { max };
@@ -49,3 +49,7 @@ function createPageCaches(max) {
49
49
  return cacheInstance;
50
50
  });
51
51
  }
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ createPageCaches
55
+ });