@bleedingdev/modern-js-renderer-core 0.0.0-bootstrap → 3.9.3-ultramodern.1
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/LICENSE +21 -0
- package/dist/cjs/abort.js +65 -0
- package/dist/cjs/adapter.js +62 -0
- package/dist/cjs/data/body.js +78 -0
- package/dist/cjs/data/client.js +409 -0
- package/dist/cjs/data/codec.js +168 -0
- package/dist/cjs/data/index.js +125 -0
- package/dist/cjs/data/private.js +77 -0
- package/dist/cjs/data/routes.js +149 -0
- package/dist/cjs/data/server.js +791 -0
- package/dist/cjs/data/static.js +110 -0
- package/dist/cjs/data/tree.js +231 -0
- package/dist/cjs/data/types.js +56 -0
- package/dist/cjs/document.js +184 -0
- package/dist/cjs/entry-client.js +142 -0
- package/dist/cjs/entry-server.js +253 -0
- package/dist/cjs/federation.js +80 -0
- package/dist/cjs/identity.js +120 -0
- package/dist/cjs/index.js +46 -0
- package/dist/cjs/localization.js +48 -0
- package/dist/cjs/router.js +293 -0
- package/dist/cjs/server/assets.js +56 -0
- package/dist/cjs/server/dispatch.js +351 -0
- package/dist/cjs/server/index.js +57 -0
- package/dist/cjs/server/types.js +18 -0
- package/dist/cjs/server/worker.js +73 -0
- package/dist/cjs/session/cache.js +172 -0
- package/dist/cjs/session/index.js +63 -0
- package/dist/cjs/session/request.js +269 -0
- package/dist/cjs/session/types.js +18 -0
- package/dist/esm/abort.mjs +27 -0
- package/dist/esm/adapter.mjs +21 -0
- package/dist/esm/data/body.mjs +40 -0
- package/dist/esm/data/client.mjs +368 -0
- package/dist/esm/data/codec.mjs +112 -0
- package/dist/esm/data/index.mjs +7 -0
- package/dist/esm/data/private.mjs +39 -0
- package/dist/esm/data/routes.mjs +108 -0
- package/dist/esm/data/server.mjs +723 -0
- package/dist/esm/data/static.mjs +51 -0
- package/dist/esm/data/tree.mjs +193 -0
- package/dist/esm/data/types.mjs +6 -0
- package/dist/esm/document.mjs +131 -0
- package/dist/esm/entry-client.mjs +104 -0
- package/dist/esm/entry-server.mjs +215 -0
- package/dist/esm/federation.mjs +36 -0
- package/dist/esm/identity.mjs +63 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/localization.mjs +10 -0
- package/dist/esm/router.mjs +225 -0
- package/dist/esm/server/assets.mjs +15 -0
- package/dist/esm/server/dispatch.mjs +307 -0
- package/dist/esm/server/index.mjs +3 -0
- package/dist/esm/server/types.mjs +0 -0
- package/dist/esm/server/worker.mjs +35 -0
- package/dist/esm/session/cache.mjs +116 -0
- package/dist/esm/session/index.mjs +3 -0
- package/dist/esm/session/request.mjs +231 -0
- package/dist/esm/session/types.mjs +0 -0
- package/dist/esm-node/abort.mjs +28 -0
- package/dist/esm-node/adapter.mjs +22 -0
- package/dist/esm-node/data/body.mjs +41 -0
- package/dist/esm-node/data/client.mjs +369 -0
- package/dist/esm-node/data/codec.mjs +113 -0
- package/dist/esm-node/data/index.mjs +8 -0
- package/dist/esm-node/data/private.mjs +40 -0
- package/dist/esm-node/data/routes.mjs +109 -0
- package/dist/esm-node/data/server.mjs +724 -0
- package/dist/esm-node/data/static.mjs +52 -0
- package/dist/esm-node/data/tree.mjs +194 -0
- package/dist/esm-node/data/types.mjs +7 -0
- package/dist/esm-node/document.mjs +132 -0
- package/dist/esm-node/entry-client.mjs +105 -0
- package/dist/esm-node/entry-server.mjs +216 -0
- package/dist/esm-node/federation.mjs +37 -0
- package/dist/esm-node/identity.mjs +64 -0
- package/dist/esm-node/index.mjs +2 -0
- package/dist/esm-node/localization.mjs +11 -0
- package/dist/esm-node/router.mjs +226 -0
- package/dist/esm-node/server/assets.mjs +16 -0
- package/dist/esm-node/server/dispatch.mjs +308 -0
- package/dist/esm-node/server/index.mjs +4 -0
- package/dist/esm-node/server/types.mjs +1 -0
- package/dist/esm-node/server/worker.mjs +36 -0
- package/dist/esm-node/session/cache.mjs +117 -0
- package/dist/esm-node/session/index.mjs +4 -0
- package/dist/esm-node/session/request.mjs +232 -0
- package/dist/esm-node/session/types.mjs +1 -0
- package/dist/types/abort.d.ts +6 -0
- package/dist/types/adapter.d.ts +195 -0
- package/dist/types/data/body.d.ts +2 -0
- package/dist/types/data/client.d.ts +17 -0
- package/dist/types/data/codec.d.ts +14 -0
- package/dist/types/data/index.d.ts +8 -0
- package/dist/types/data/private.d.ts +6 -0
- package/dist/types/data/routes.d.ts +28 -0
- package/dist/types/data/server.d.ts +59 -0
- package/dist/types/data/static.d.ts +31 -0
- package/dist/types/data/tree.d.ts +3 -0
- package/dist/types/data/types.d.ts +104 -0
- package/dist/types/document.d.ts +76 -0
- package/dist/types/entry-client.d.ts +53 -0
- package/dist/types/entry-server.d.ts +63 -0
- package/dist/types/federation.d.ts +56 -0
- package/dist/types/identity.d.ts +27 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/localization.d.ts +58 -0
- package/dist/types/router.d.ts +201 -0
- package/dist/types/server/assets.d.ts +14 -0
- package/dist/types/server/dispatch.d.ts +11 -0
- package/dist/types/server/index.d.ts +4 -0
- package/dist/types/server/types.d.ts +64 -0
- package/dist/types/server/worker.d.ts +25 -0
- package/dist/types/session/cache.d.ts +25 -0
- package/dist/types/session/index.d.ts +4 -0
- package/dist/types/session/request.d.ts +8 -0
- package/dist/types/session/types.d.ts +48 -0
- package/package.json +159 -4
- package/src/abort.ts +40 -0
- package/src/adapter.ts +255 -0
- package/src/data/body.ts +43 -0
- package/src/data/client.ts +501 -0
- package/src/data/codec.ts +247 -0
- package/src/data/index.ts +8 -0
- package/src/data/private.ts +68 -0
- package/src/data/routes.ts +201 -0
- package/src/data/server.ts +977 -0
- package/src/data/static.ts +105 -0
- package/src/data/tree.ts +244 -0
- package/src/data/types.ts +98 -0
- package/src/document.ts +338 -0
- package/src/entry-client.ts +236 -0
- package/src/entry-server.ts +393 -0
- package/src/federation.ts +111 -0
- package/src/identity.ts +128 -0
- package/src/index.ts +7 -0
- package/src/localization.ts +77 -0
- package/src/router.ts +475 -0
- package/src/server/assets.ts +60 -0
- package/src/server/dispatch.ts +523 -0
- package/src/server/index.ts +16 -0
- package/src/server/types.ts +94 -0
- package/src/server/worker.ts +94 -0
- package/src/session/cache.ts +177 -0
- package/src/session/index.ts +11 -0
- package/src/session/request.ts +324 -0
- package/src/session/types.ts +60 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
DATA_CODEC: ()=>DATA_CODEC,
|
|
32
|
+
DataProtocolError: ()=>DataProtocolError,
|
|
33
|
+
MAX_DATA_BYTES: ()=>MAX_DATA_BYTES,
|
|
34
|
+
assertPublicData: ()=>assertPublicData,
|
|
35
|
+
escapeInlineDataJSON: ()=>escapeInlineDataJSON,
|
|
36
|
+
parsePublicData: ()=>parsePublicData,
|
|
37
|
+
serializePublicData: ()=>serializePublicData
|
|
38
|
+
});
|
|
39
|
+
const external_seroval_namespaceObject = require("seroval");
|
|
40
|
+
const external_tree_js_namespaceObject = require("./tree.js");
|
|
41
|
+
const DATA_CODEC = 'seroval-json@1.6.8';
|
|
42
|
+
const MAX_DATA_BYTES = 1048576;
|
|
43
|
+
const MAX_DEPTH = 100;
|
|
44
|
+
const MAX_NODES = 20000;
|
|
45
|
+
class DataProtocolError extends Error {
|
|
46
|
+
constructor(message){
|
|
47
|
+
super(message);
|
|
48
|
+
this.name = 'DataProtocolError';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function assertPublicData(value, options = {}) {
|
|
52
|
+
const seen = new WeakSet();
|
|
53
|
+
let count = 0;
|
|
54
|
+
const visit = (current, depth)=>{
|
|
55
|
+
if (++count > MAX_NODES || depth > MAX_DEPTH) throw new DataProtocolError('Public data exceeds its size or depth limit');
|
|
56
|
+
if (null == current) return;
|
|
57
|
+
const type = typeof current;
|
|
58
|
+
if (('object' === type || 'function' === type) && options.privateReferences?.has(current)) throw new DataProtocolError('Request-private context cannot be transferred as public data');
|
|
59
|
+
if ('string' === type || 'boolean' === type || 'number' === type || 'bigint' === type) return;
|
|
60
|
+
if ('object' !== type) throw new DataProtocolError(`Unsupported public data type: ${type}`);
|
|
61
|
+
const object = current;
|
|
62
|
+
if (seen.has(object)) return;
|
|
63
|
+
seen.add(object);
|
|
64
|
+
const prototype = Object.getPrototypeOf(object);
|
|
65
|
+
if (prototype !== Object.prototype && null !== prototype && prototype !== Array.prototype && prototype !== Date.prototype && prototype !== RegExp.prototype && prototype !== Map.prototype && prototype !== Set.prototype) throw new DataProtocolError('Public data must not contain native views, request context or class instances');
|
|
66
|
+
const ownKeys = Reflect.ownKeys(object);
|
|
67
|
+
const descriptors = [];
|
|
68
|
+
let hidden;
|
|
69
|
+
for (const key of ownKeys){
|
|
70
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
71
|
+
if ('symbol' == typeof key || descriptor.get || descriptor.set) throw new DataProtocolError('Public data must not contain symbols or accessors');
|
|
72
|
+
if (!descriptor.enumerable && (prototype === Object.prototype || null === prototype)) hidden ??= key;
|
|
73
|
+
descriptors.push(descriptor);
|
|
74
|
+
}
|
|
75
|
+
if (prototype === Array.prototype && ownKeys.some((key)=>'length' !== key && ('string' != typeof key || !/^(?:0|[1-9]\d*)$/.test(key) || Number(key) >= 0xffffffff))) throw new DataProtocolError('Public data arrays must contain only length and canonical index properties');
|
|
76
|
+
if (prototype === Array.prototype) {
|
|
77
|
+
const length = Object.getOwnPropertyDescriptor(object, 'length')?.value;
|
|
78
|
+
if ('number' == typeof length) count += length - (ownKeys.length - 1);
|
|
79
|
+
if (count > MAX_NODES) throw new DataProtocolError('Public data exceeds its size or depth limit');
|
|
80
|
+
}
|
|
81
|
+
for (const descriptor of descriptors)visit(descriptor.value, depth + 1);
|
|
82
|
+
if (void 0 !== hidden) throw new DataProtocolError(`Public data must not contain non-enumerable properties (${hidden})`);
|
|
83
|
+
try {
|
|
84
|
+
if (prototype === Array.prototype && !Array.isArray(object)) throw new TypeError('Missing native array slots');
|
|
85
|
+
if (prototype === Date.prototype) Date.prototype.valueOf.call(object);
|
|
86
|
+
if (prototype === RegExp.prototype) Object.getOwnPropertyDescriptor(RegExp.prototype, 'source').get.call(object);
|
|
87
|
+
if (prototype === Map.prototype) Map.prototype.has.call(object, void 0);
|
|
88
|
+
if (prototype === Set.prototype) Set.prototype.has.call(object, void 0);
|
|
89
|
+
} catch {
|
|
90
|
+
throw new DataProtocolError('Public data requires valid native container values');
|
|
91
|
+
}
|
|
92
|
+
if ((prototype === Date.prototype || prototype === Map.prototype || prototype === Set.prototype) && ownKeys.length > 0 || prototype === RegExp.prototype && ownKeys.some((key)=>'lastIndex' !== key)) throw new DataProtocolError('Public data native containers must not override their built-in properties');
|
|
93
|
+
if (prototype === RegExp.prototype && Object.getOwnPropertyDescriptor(object, 'lastIndex')?.value !== 0) throw new DataProtocolError('Public data RegExp values must have lastIndex 0');
|
|
94
|
+
if (prototype === Map.prototype) for (const [key, entry] of Map.prototype.entries.call(object)){
|
|
95
|
+
visit(key, depth + 1);
|
|
96
|
+
visit(entry, depth + 1);
|
|
97
|
+
}
|
|
98
|
+
else if (prototype === Set.prototype) for (const entry of Set.prototype.values.call(object))visit(entry, depth + 1);
|
|
99
|
+
};
|
|
100
|
+
visit(value, 0);
|
|
101
|
+
}
|
|
102
|
+
function escapeInlineDataJSON(text) {
|
|
103
|
+
return text.replace(/[<>&\u2028\u2029]/gu, (character)=>{
|
|
104
|
+
switch(character){
|
|
105
|
+
case '<':
|
|
106
|
+
return '\\u003C';
|
|
107
|
+
case '>':
|
|
108
|
+
return '\\u003E';
|
|
109
|
+
case '&':
|
|
110
|
+
return '\\u0026';
|
|
111
|
+
case '\u2028':
|
|
112
|
+
return '\\u2028';
|
|
113
|
+
default:
|
|
114
|
+
return '\\u2029';
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function serializePublicData(value) {
|
|
119
|
+
assertPublicData(value);
|
|
120
|
+
const text = JSON.stringify({
|
|
121
|
+
codec: DATA_CODEC,
|
|
122
|
+
data: (0, external_seroval_namespaceObject.toJSON)(value, {
|
|
123
|
+
depthLimit: MAX_DEPTH
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
if (new TextEncoder().encode(escapeInlineDataJSON(text)).byteLength > MAX_DATA_BYTES) throw new DataProtocolError('Public data exceeds its byte limit');
|
|
127
|
+
try {
|
|
128
|
+
(0, external_tree_js_namespaceObject.validateSerializedData)(JSON.parse(text).data);
|
|
129
|
+
} catch {
|
|
130
|
+
throw new DataProtocolError('Public data exceeds the supported codec limits');
|
|
131
|
+
}
|
|
132
|
+
return text;
|
|
133
|
+
}
|
|
134
|
+
function parsePublicData(text) {
|
|
135
|
+
if (new TextEncoder().encode(escapeInlineDataJSON(text)).byteLength > MAX_DATA_BYTES) throw new DataProtocolError('Public data exceeds its byte limit');
|
|
136
|
+
try {
|
|
137
|
+
const envelope = JSON.parse(text);
|
|
138
|
+
if (!envelope || 'object' != typeof envelope || Array.isArray(envelope)) throw new DataProtocolError('Malformed public data envelope');
|
|
139
|
+
const record = envelope;
|
|
140
|
+
if (2 !== Object.keys(record).length || record.codec !== DATA_CODEC || !Object.hasOwn(record, 'data')) throw new DataProtocolError('Unsupported public data codec');
|
|
141
|
+
(0, external_tree_js_namespaceObject.validateSerializedData)(record.data);
|
|
142
|
+
const result = (0, external_seroval_namespaceObject.fromJSON)(record.data);
|
|
143
|
+
assertPublicData(result);
|
|
144
|
+
return result;
|
|
145
|
+
} catch (error) {
|
|
146
|
+
if (error instanceof DataProtocolError) throw error;
|
|
147
|
+
throw new DataProtocolError('Malformed public data payload');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.DATA_CODEC = __webpack_exports__.DATA_CODEC;
|
|
151
|
+
exports.DataProtocolError = __webpack_exports__.DataProtocolError;
|
|
152
|
+
exports.MAX_DATA_BYTES = __webpack_exports__.MAX_DATA_BYTES;
|
|
153
|
+
exports.assertPublicData = __webpack_exports__.assertPublicData;
|
|
154
|
+
exports.escapeInlineDataJSON = __webpack_exports__.escapeInlineDataJSON;
|
|
155
|
+
exports.parsePublicData = __webpack_exports__.parsePublicData;
|
|
156
|
+
exports.serializePublicData = __webpack_exports__.serializePublicData;
|
|
157
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
158
|
+
"DATA_CODEC",
|
|
159
|
+
"DataProtocolError",
|
|
160
|
+
"MAX_DATA_BYTES",
|
|
161
|
+
"assertPublicData",
|
|
162
|
+
"escapeInlineDataJSON",
|
|
163
|
+
"parsePublicData",
|
|
164
|
+
"serializePublicData"
|
|
165
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
166
|
+
Object.defineProperty(exports, '__esModule', {
|
|
167
|
+
value: true
|
|
168
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./client" (module) {
|
|
4
|
+
module.exports = require("./client.js");
|
|
5
|
+
},
|
|
6
|
+
"./codec" (module) {
|
|
7
|
+
module.exports = require("./codec.js");
|
|
8
|
+
},
|
|
9
|
+
"./private" (module) {
|
|
10
|
+
module.exports = require("./private.js");
|
|
11
|
+
},
|
|
12
|
+
"./routes" (module) {
|
|
13
|
+
module.exports = require("./routes.js");
|
|
14
|
+
},
|
|
15
|
+
"./server" (module) {
|
|
16
|
+
module.exports = require("./server.js");
|
|
17
|
+
},
|
|
18
|
+
"./static" (module) {
|
|
19
|
+
module.exports = require("./static.js");
|
|
20
|
+
},
|
|
21
|
+
"./types" (module) {
|
|
22
|
+
module.exports = require("./types.js");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var __webpack_module_cache__ = {};
|
|
26
|
+
function __webpack_require__(moduleId) {
|
|
27
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
28
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
29
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
30
|
+
exports: {}
|
|
31
|
+
};
|
|
32
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
33
|
+
return module.exports;
|
|
34
|
+
}
|
|
35
|
+
(()=>{
|
|
36
|
+
__webpack_require__.n = (module)=>{
|
|
37
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
38
|
+
__webpack_require__.d(getter, {
|
|
39
|
+
a: getter
|
|
40
|
+
});
|
|
41
|
+
return getter;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
(()=>{
|
|
45
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
46
|
+
var define = (defs, kind)=>{
|
|
47
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
[kind]: defs[key]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
define(getters, "get");
|
|
53
|
+
define(values, "value");
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
(()=>{
|
|
57
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
58
|
+
})();
|
|
59
|
+
(()=>{
|
|
60
|
+
__webpack_require__.r = (exports1)=>{
|
|
61
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
62
|
+
value: 'Module'
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
})();
|
|
69
|
+
var __webpack_exports__ = {};
|
|
70
|
+
(()=>{
|
|
71
|
+
__webpack_require__.r(__webpack_exports__);
|
|
72
|
+
var _client__rspack_import_0 = __webpack_require__("./client");
|
|
73
|
+
var __rspack_reexport = {};
|
|
74
|
+
for(const __rspack_import_key in _client__rspack_import_0)if ([
|
|
75
|
+
"createRequestDataPolicy",
|
|
76
|
+
"default"
|
|
77
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_client__rspack_import_0[__rspack_import_key];
|
|
78
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
79
|
+
var _codec__rspack_import_1 = __webpack_require__("./codec");
|
|
80
|
+
var __rspack_reexport = {};
|
|
81
|
+
for(const __rspack_import_key in _codec__rspack_import_1)if ([
|
|
82
|
+
"createRequestDataPolicy",
|
|
83
|
+
"default"
|
|
84
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_codec__rspack_import_1[__rspack_import_key];
|
|
85
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
86
|
+
var _private__rspack_import_2 = __webpack_require__("./private");
|
|
87
|
+
var _routes__rspack_import_3 = __webpack_require__("./routes");
|
|
88
|
+
var __rspack_reexport = {};
|
|
89
|
+
for(const __rspack_import_key in _routes__rspack_import_3)if ([
|
|
90
|
+
"createRequestDataPolicy",
|
|
91
|
+
"default"
|
|
92
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_routes__rspack_import_3[__rspack_import_key];
|
|
93
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
94
|
+
var _server__rspack_import_4 = __webpack_require__("./server");
|
|
95
|
+
var __rspack_reexport = {};
|
|
96
|
+
for(const __rspack_import_key in _server__rspack_import_4)if ([
|
|
97
|
+
"createRequestDataPolicy",
|
|
98
|
+
"default"
|
|
99
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_server__rspack_import_4[__rspack_import_key];
|
|
100
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
101
|
+
var _static__rspack_import_5 = __webpack_require__("./static");
|
|
102
|
+
var __rspack_reexport = {};
|
|
103
|
+
for(const __rspack_import_key in _static__rspack_import_5)if ([
|
|
104
|
+
"createRequestDataPolicy",
|
|
105
|
+
"default"
|
|
106
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_static__rspack_import_5[__rspack_import_key];
|
|
107
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
108
|
+
var _types__rspack_import_6 = __webpack_require__("./types");
|
|
109
|
+
var __rspack_reexport = {};
|
|
110
|
+
for(const __rspack_import_key in _types__rspack_import_6)if ([
|
|
111
|
+
"createRequestDataPolicy",
|
|
112
|
+
"default"
|
|
113
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_types__rspack_import_6[__rspack_import_key];
|
|
114
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
115
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
116
|
+
createRequestDataPolicy: ()=>_private__rspack_import_2.createRequestDataPolicy
|
|
117
|
+
});
|
|
118
|
+
})();
|
|
119
|
+
exports.createRequestDataPolicy = __webpack_exports__.createRequestDataPolicy;
|
|
120
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
121
|
+
"createRequestDataPolicy"
|
|
122
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
123
|
+
Object.defineProperty(exports, '__esModule', {
|
|
124
|
+
value: true
|
|
125
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
createRequestDataPolicy: ()=>createRequestDataPolicy
|
|
32
|
+
});
|
|
33
|
+
const external_codec_js_namespaceObject = require("./codec.js");
|
|
34
|
+
function createRequestDataPolicy(roots) {
|
|
35
|
+
const references = new WeakSet();
|
|
36
|
+
const refresh = ()=>{
|
|
37
|
+
const seen = new WeakSet();
|
|
38
|
+
let count = 0;
|
|
39
|
+
const visit = (value, depth)=>{
|
|
40
|
+
if (null === value || 'object' != typeof value && 'function' != typeof value) return;
|
|
41
|
+
if (seen.has(value)) return;
|
|
42
|
+
if (++count > 20000 || depth > 100) throw new external_codec_js_namespaceObject.DataProtocolError('Private request context exceeds its size or depth limit');
|
|
43
|
+
seen.add(value);
|
|
44
|
+
references.add(value);
|
|
45
|
+
for (const key of Reflect.ownKeys(value)){
|
|
46
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
47
|
+
if (!descriptor.get && !descriptor.set) visit(descriptor.value, depth + 1);
|
|
48
|
+
}
|
|
49
|
+
if (value instanceof Map) for (const [key, entry] of Map.prototype.entries.call(value)){
|
|
50
|
+
visit(key, depth + 1);
|
|
51
|
+
visit(entry, depth + 1);
|
|
52
|
+
}
|
|
53
|
+
else if (value instanceof Set) for (const entry of Set.prototype.values.call(value))visit(entry, depth + 1);
|
|
54
|
+
};
|
|
55
|
+
for (const root of roots)visit(root, 0);
|
|
56
|
+
};
|
|
57
|
+
refresh();
|
|
58
|
+
return {
|
|
59
|
+
assertRoot (value) {
|
|
60
|
+
refresh();
|
|
61
|
+
if (null !== value && ('object' == typeof value || 'function' == typeof value) && references.has(value)) throw new external_codec_js_namespaceObject.DataProtocolError('Request-private context cannot be transferred as public data');
|
|
62
|
+
},
|
|
63
|
+
assertValue (value) {
|
|
64
|
+
refresh();
|
|
65
|
+
(0, external_codec_js_namespaceObject.assertPublicData)(value, {
|
|
66
|
+
privateReferences: references
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
exports.createRequestDataPolicy = __webpack_exports__.createRequestDataPolicy;
|
|
72
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
73
|
+
"createRequestDataPolicy"
|
|
74
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
75
|
+
Object.defineProperty(exports, '__esModule', {
|
|
76
|
+
value: true
|
|
77
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
const moduleFields = [
|
|
31
|
+
'data',
|
|
32
|
+
'clientData',
|
|
33
|
+
'loading',
|
|
34
|
+
'error',
|
|
35
|
+
'search',
|
|
36
|
+
'head',
|
|
37
|
+
'notFound'
|
|
38
|
+
];
|
|
39
|
+
const viewFields = [
|
|
40
|
+
'file',
|
|
41
|
+
'_component',
|
|
42
|
+
'component',
|
|
43
|
+
'filename'
|
|
44
|
+
];
|
|
45
|
+
function routeRecord(value, location) {
|
|
46
|
+
if (null === value || 'object' != typeof value || Object.getPrototypeOf(value) !== Object.prototype && null !== Object.getPrototypeOf(value)) throw new TypeError(`${location} must be a plain route object`);
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
function routeField(record, key, location) {
|
|
50
|
+
const descriptor = Object.getOwnPropertyDescriptor(record, key);
|
|
51
|
+
if (descriptor && !('value' in descriptor)) throw new TypeError(`${location}.${key} must be a value, not an accessor`);
|
|
52
|
+
return descriptor?.value;
|
|
53
|
+
}
|
|
54
|
+
function optionalString(record, key, location, allowEmpty = false) {
|
|
55
|
+
const value = routeField(record, key, location);
|
|
56
|
+
if (void 0 === value) return;
|
|
57
|
+
if ('string' != typeof value || !allowEmpty && 0 === value.trim().length) throw new TypeError(`${location}.${key} must be ${allowEmpty ? 'a' : 'a non-empty'} string`);
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
function optionalBoolean(record, key, location) {
|
|
61
|
+
const value = routeField(record, key, location);
|
|
62
|
+
if (void 0 === value) return;
|
|
63
|
+
if ('boolean' != typeof value) throw new TypeError(`${location}.${key} must be a boolean`);
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
function projectFileSystemRoutes(routes) {
|
|
67
|
+
if (!Array.isArray(routes)) throw new TypeError('routes must be an array');
|
|
68
|
+
const ids = new Set();
|
|
69
|
+
const ancestors = new Set();
|
|
70
|
+
const project = (value, coordinates)=>{
|
|
71
|
+
const location = `routes[${coordinates.join('].children[')}]`;
|
|
72
|
+
if (coordinates.length > 256) throw new TypeError(`${location} exceeds the maximum route depth`);
|
|
73
|
+
const record = routeRecord(value, location);
|
|
74
|
+
if (ancestors.has(record)) throw new TypeError(`${location} contains a route cycle`);
|
|
75
|
+
let file;
|
|
76
|
+
for (const key of viewFields){
|
|
77
|
+
const reference = optionalString(record, key, location);
|
|
78
|
+
file ??= reference;
|
|
79
|
+
}
|
|
80
|
+
const id = optionalString(record, 'id', location) ?? file ?? `route-${coordinates.join('.')}`;
|
|
81
|
+
if (ids.has(id)) throw new TypeError(`${location} duplicates route id "${id}"`);
|
|
82
|
+
ids.add(id);
|
|
83
|
+
const path = optionalString(record, 'path', location, true);
|
|
84
|
+
const index = optionalBoolean(record, 'index', location);
|
|
85
|
+
const isRoot = optionalBoolean(record, 'isRoot', location);
|
|
86
|
+
const children = routeField(record, 'children', location);
|
|
87
|
+
if (void 0 !== children && !Array.isArray(children)) throw new TypeError(`${location}.children must be an array`);
|
|
88
|
+
if (true === index && (children?.length || true === isRoot)) throw new TypeError(`${location} index routes cannot have children or be root routes`);
|
|
89
|
+
const modules = {};
|
|
90
|
+
for (const key of moduleFields){
|
|
91
|
+
const reference = optionalString(record, key, location);
|
|
92
|
+
if (void 0 !== reference) modules[key] = reference;
|
|
93
|
+
}
|
|
94
|
+
ancestors.add(record);
|
|
95
|
+
const projectedChildren = (children ?? []).map((child, position)=>project(child, [
|
|
96
|
+
...coordinates,
|
|
97
|
+
position
|
|
98
|
+
]));
|
|
99
|
+
ancestors.delete(record);
|
|
100
|
+
return {
|
|
101
|
+
id,
|
|
102
|
+
...void 0 === file ? {} : {
|
|
103
|
+
file
|
|
104
|
+
},
|
|
105
|
+
...void 0 === path ? {} : {
|
|
106
|
+
path
|
|
107
|
+
},
|
|
108
|
+
...void 0 === index ? {} : {
|
|
109
|
+
index
|
|
110
|
+
},
|
|
111
|
+
...void 0 === isRoot ? {} : {
|
|
112
|
+
isRoot
|
|
113
|
+
},
|
|
114
|
+
...0 === Object.keys(modules).length ? {} : {
|
|
115
|
+
modules
|
|
116
|
+
},
|
|
117
|
+
children: projectedChildren
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
return routes.map((route, position)=>project(route, [
|
|
121
|
+
position
|
|
122
|
+
]));
|
|
123
|
+
}
|
|
124
|
+
function toTanstackPath(pathname) {
|
|
125
|
+
if ('string' != typeof pathname) throw new TypeError('route path must be a string');
|
|
126
|
+
return pathname.split('/').map((segment)=>{
|
|
127
|
+
if ('*' === segment) return '$';
|
|
128
|
+
if (segment.startsWith(':')) {
|
|
129
|
+
const optional = segment.endsWith('?');
|
|
130
|
+
const name = segment.slice(1, optional ? -1 : void 0);
|
|
131
|
+
if (!name || /[:?*]/.test(name)) throw new TypeError(`Invalid route parameter "${segment}"`);
|
|
132
|
+
return optional ? `{-$${name}}` : `$${name}`;
|
|
133
|
+
}
|
|
134
|
+
return segment;
|
|
135
|
+
}).join('/');
|
|
136
|
+
}
|
|
137
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
138
|
+
projectFileSystemRoutes: ()=>projectFileSystemRoutes,
|
|
139
|
+
toTanstackPath: ()=>toTanstackPath
|
|
140
|
+
});
|
|
141
|
+
exports.projectFileSystemRoutes = __webpack_exports__.projectFileSystemRoutes;
|
|
142
|
+
exports.toTanstackPath = __webpack_exports__.toTanstackPath;
|
|
143
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
144
|
+
"projectFileSystemRoutes",
|
|
145
|
+
"toTanstackPath"
|
|
146
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
147
|
+
Object.defineProperty(exports, '__esModule', {
|
|
148
|
+
value: true
|
|
149
|
+
});
|