@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,293 @@
|
|
|
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
|
+
RouteDataError: ()=>RouteDataError,
|
|
32
|
+
createNativeRouter: ()=>createNativeRouter,
|
|
33
|
+
isRoutedApplication: ()=>isRoutedApplication,
|
|
34
|
+
loadFileSystemRoute: ()=>loadFileSystemRoute,
|
|
35
|
+
matchApplicationRouteIds: ()=>matchApplicationRouteIds,
|
|
36
|
+
matchApplicationRoutes: ()=>matchApplicationRoutes,
|
|
37
|
+
nativeRoutePath: ()=>nativeRoutePath,
|
|
38
|
+
resolveRouteData: ()=>resolveRouteData,
|
|
39
|
+
selectApplicationDataRoute: ()=>selectApplicationDataRoute,
|
|
40
|
+
splitFileSystemRoutes: ()=>splitFileSystemRoutes,
|
|
41
|
+
untilAborted: ()=>external_abort_js_namespaceObject.untilAborted
|
|
42
|
+
});
|
|
43
|
+
const external_abort_js_namespaceObject = require("./abort.js");
|
|
44
|
+
const index_js_namespaceObject = require("./data/index.js");
|
|
45
|
+
class RouteDataError extends Error {
|
|
46
|
+
constructor(routeId, outcome){
|
|
47
|
+
super(outcome.error.message);
|
|
48
|
+
this.name = outcome.error.name;
|
|
49
|
+
this.routeId = routeId;
|
|
50
|
+
this.status = 'response' in outcome ? outcome.response.status : outcome.status;
|
|
51
|
+
this.data = outcome.data;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function resolveRouteData(native, routeId, outcome, project = (value)=>value) {
|
|
55
|
+
switch(outcome.kind){
|
|
56
|
+
case 'success':
|
|
57
|
+
return project(outcome.value);
|
|
58
|
+
case 'deferred':
|
|
59
|
+
{
|
|
60
|
+
const value = (0, index_js_namespaceObject.parsePublicData)((0, index_js_namespaceObject.serializePublicData)(outcome.critical));
|
|
61
|
+
for (const [key, promise] of Object.entries(outcome.deferred))Object.defineProperty(value, key, {
|
|
62
|
+
value: promise,
|
|
63
|
+
enumerable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
67
|
+
return project(value);
|
|
68
|
+
}
|
|
69
|
+
case 'redirect':
|
|
70
|
+
throw native.redirect({
|
|
71
|
+
href: outcome.location,
|
|
72
|
+
...'response' in outcome ? {
|
|
73
|
+
headers: outcome.response.headers
|
|
74
|
+
} : {},
|
|
75
|
+
statusCode: 'response' in outcome ? outcome.response.status : outcome.status
|
|
76
|
+
});
|
|
77
|
+
case 'not-found':
|
|
78
|
+
throw native.notFound({
|
|
79
|
+
data: project(outcome.value)
|
|
80
|
+
});
|
|
81
|
+
case 'error':
|
|
82
|
+
{
|
|
83
|
+
const error = project(outcome.error);
|
|
84
|
+
if (!error || 'object' != typeof error || !('name' in error) || 'string' != typeof error.name || !('message' in error) || 'string' != typeof error.message) throw new index_js_namespaceObject.DataProtocolError('Invalid public route error');
|
|
85
|
+
throw Object.freeze(new RouteDataError(routeId, {
|
|
86
|
+
...outcome,
|
|
87
|
+
error: {
|
|
88
|
+
name: error.name,
|
|
89
|
+
message: error.message
|
|
90
|
+
},
|
|
91
|
+
data: project(outcome.data)
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function splitFileSystemRoutes(routes) {
|
|
97
|
+
const roots = routes.filter((route)=>route.isRoot);
|
|
98
|
+
if (roots.length > 1) throw new Error('A filesystem route tree requires one application root');
|
|
99
|
+
const root = roots[0];
|
|
100
|
+
const ids = new Set();
|
|
101
|
+
const visit = (route, nested)=>{
|
|
102
|
+
if (nested && route.isRoot) throw new Error('An application root cannot be a child route');
|
|
103
|
+
if (ids.has(route.id)) throw new Error(`Duplicate filesystem route id: ${route.id}`);
|
|
104
|
+
ids.add(route.id);
|
|
105
|
+
for (const child of route.children)visit(child, true);
|
|
106
|
+
};
|
|
107
|
+
for (const route of routes)visit(route, false);
|
|
108
|
+
return {
|
|
109
|
+
root,
|
|
110
|
+
children: root ? [
|
|
111
|
+
...root.children,
|
|
112
|
+
...routes.filter((route)=>route !== root)
|
|
113
|
+
] : routes
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function nativeRoutePath(route) {
|
|
117
|
+
const path = route.index ? '/' : route.path;
|
|
118
|
+
return path ? {
|
|
119
|
+
path: (0, index_js_namespaceObject.toTanstackPath)(path)
|
|
120
|
+
} : {
|
|
121
|
+
id: route.id
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
async function loadFileSystemRoute(route, loadRoute, options, { params, location, abortController }) {
|
|
125
|
+
const base = options.request?.url ?? ("u" < typeof window ? void 0 : window.location.href);
|
|
126
|
+
if (!base) throw new Error('A server route loader requires its request');
|
|
127
|
+
const owners = [
|
|
128
|
+
abortController.signal,
|
|
129
|
+
...options.request ? [
|
|
130
|
+
options.request.signal
|
|
131
|
+
] : [],
|
|
132
|
+
...options.signal ? [
|
|
133
|
+
options.signal
|
|
134
|
+
] : []
|
|
135
|
+
];
|
|
136
|
+
const signal = owners.length > 1 ? AbortSignal.any(owners) : owners[0];
|
|
137
|
+
signal.throwIfAborted();
|
|
138
|
+
const request = new Request(new URL(location.publicHref, base), {
|
|
139
|
+
headers: options.request?.headers,
|
|
140
|
+
signal
|
|
141
|
+
});
|
|
142
|
+
const outcome = await (0, external_abort_js_namespaceObject.untilAborted)(loadRoute(route, {
|
|
143
|
+
request,
|
|
144
|
+
routeId: route.id,
|
|
145
|
+
params,
|
|
146
|
+
context: options.context
|
|
147
|
+
}), signal);
|
|
148
|
+
return {
|
|
149
|
+
outcome,
|
|
150
|
+
request,
|
|
151
|
+
signal
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function matchApplicationRoutes(router, url) {
|
|
155
|
+
return router.matchRoutes(router.parseLocation({
|
|
156
|
+
href: url.pathname + url.search + url.hash,
|
|
157
|
+
pathname: url.pathname,
|
|
158
|
+
search: url.search,
|
|
159
|
+
hash: url.hash,
|
|
160
|
+
state: {
|
|
161
|
+
__TSR_index: 0
|
|
162
|
+
}
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
function applicationRouteId(router, nativeRouteId) {
|
|
166
|
+
const staticData = router.routesById[nativeRouteId]?.options.staticData;
|
|
167
|
+
const id = staticData && 'object' == typeof staticData ? Reflect.get(staticData, 'ultramodernRouteId') : void 0;
|
|
168
|
+
return 'string' == typeof id ? id : void 0;
|
|
169
|
+
}
|
|
170
|
+
function matchApplicationRouteIds(router, url) {
|
|
171
|
+
return matchApplicationRoutes(router, url).flatMap((match)=>{
|
|
172
|
+
const id = applicationRouteId(router, match.routeId);
|
|
173
|
+
return void 0 === id ? [] : [
|
|
174
|
+
id
|
|
175
|
+
];
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function selectApplicationDataRoute(router, request, requestedRouteId, operation, handlers) {
|
|
179
|
+
const match = matchApplicationRoutes(router, new URL(request.url)).find((candidate)=>applicationRouteId(router, candidate.routeId) === requestedRouteId);
|
|
180
|
+
const handler = handlers[requestedRouteId]?.[operation];
|
|
181
|
+
if (!match || 'function' != typeof handler) return;
|
|
182
|
+
return {
|
|
183
|
+
routeId: requestedRouteId,
|
|
184
|
+
params: match.params,
|
|
185
|
+
handler
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function isRoutedApplication(application) {
|
|
189
|
+
return 'routeIR' in application;
|
|
190
|
+
}
|
|
191
|
+
const viewFields = [
|
|
192
|
+
'component',
|
|
193
|
+
'pendingComponent',
|
|
194
|
+
'errorComponent',
|
|
195
|
+
'notFoundComponent'
|
|
196
|
+
];
|
|
197
|
+
function resolveRouteSources(sources) {
|
|
198
|
+
const module = {};
|
|
199
|
+
for (const field of viewFields){
|
|
200
|
+
const source = sources[field];
|
|
201
|
+
if (source) module[field] = source.default;
|
|
202
|
+
}
|
|
203
|
+
if (sources.head) module.head = sources.head.head ?? sources.head.default;
|
|
204
|
+
if (sources.search) {
|
|
205
|
+
const validateSearch = sources.search.validateSearch ?? sources.search.default;
|
|
206
|
+
if ('function' != typeof validateSearch) throw new Error('A native search module must export validateSearch or a default validator');
|
|
207
|
+
module.validateSearch = validateSearch;
|
|
208
|
+
}
|
|
209
|
+
return module;
|
|
210
|
+
}
|
|
211
|
+
function createNativeRouter(application, options, factory) {
|
|
212
|
+
const context = options.context ?? {};
|
|
213
|
+
if (Object.hasOwn(context, 'ultramodern')) throw new Error('The native router context reserves ultramodern metadata');
|
|
214
|
+
const modules = Object.fromEntries(Object.entries(application.routeModules).map(([id, sources])=>[
|
|
215
|
+
id,
|
|
216
|
+
resolveRouteSources(sources)
|
|
217
|
+
]));
|
|
218
|
+
let router;
|
|
219
|
+
const routeTree = factory.routeTree(application.routeIR, modules, {
|
|
220
|
+
...options.request ? {
|
|
221
|
+
request: options.request
|
|
222
|
+
} : {},
|
|
223
|
+
...options.signal ? {
|
|
224
|
+
signal: options.signal
|
|
225
|
+
} : {},
|
|
226
|
+
context,
|
|
227
|
+
...options.onOutcome ? {
|
|
228
|
+
onOutcome: options.onOutcome
|
|
229
|
+
} : {},
|
|
230
|
+
...options.session ? {
|
|
231
|
+
session: options.session
|
|
232
|
+
} : {},
|
|
233
|
+
getRouter: ()=>{
|
|
234
|
+
if (!router) throw new Error('The native router is not created yet');
|
|
235
|
+
return router;
|
|
236
|
+
},
|
|
237
|
+
loadRoute: options.loadRoute
|
|
238
|
+
});
|
|
239
|
+
const url = options.request ? new URL(options.request.url) : void 0;
|
|
240
|
+
router = factory.router({
|
|
241
|
+
routeTree,
|
|
242
|
+
basepath: application.basePath,
|
|
243
|
+
context: {
|
|
244
|
+
ultramodern: Object.freeze({
|
|
245
|
+
rendererIdentity: Object.freeze({
|
|
246
|
+
...options.identity
|
|
247
|
+
})
|
|
248
|
+
})
|
|
249
|
+
},
|
|
250
|
+
...options.rewrite ? {
|
|
251
|
+
rewrite: options.rewrite
|
|
252
|
+
} : {},
|
|
253
|
+
...void 0 === options.nonce ? {} : {
|
|
254
|
+
ssr: {
|
|
255
|
+
nonce: options.nonce
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
...url ? {
|
|
259
|
+
location: {
|
|
260
|
+
origin: url.origin,
|
|
261
|
+
href: url.pathname + url.search + url.hash
|
|
262
|
+
}
|
|
263
|
+
} : {}
|
|
264
|
+
});
|
|
265
|
+
return router;
|
|
266
|
+
}
|
|
267
|
+
exports.RouteDataError = __webpack_exports__.RouteDataError;
|
|
268
|
+
exports.createNativeRouter = __webpack_exports__.createNativeRouter;
|
|
269
|
+
exports.isRoutedApplication = __webpack_exports__.isRoutedApplication;
|
|
270
|
+
exports.loadFileSystemRoute = __webpack_exports__.loadFileSystemRoute;
|
|
271
|
+
exports.matchApplicationRouteIds = __webpack_exports__.matchApplicationRouteIds;
|
|
272
|
+
exports.matchApplicationRoutes = __webpack_exports__.matchApplicationRoutes;
|
|
273
|
+
exports.nativeRoutePath = __webpack_exports__.nativeRoutePath;
|
|
274
|
+
exports.resolveRouteData = __webpack_exports__.resolveRouteData;
|
|
275
|
+
exports.selectApplicationDataRoute = __webpack_exports__.selectApplicationDataRoute;
|
|
276
|
+
exports.splitFileSystemRoutes = __webpack_exports__.splitFileSystemRoutes;
|
|
277
|
+
exports.untilAborted = __webpack_exports__.untilAborted;
|
|
278
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
279
|
+
"RouteDataError",
|
|
280
|
+
"createNativeRouter",
|
|
281
|
+
"isRoutedApplication",
|
|
282
|
+
"loadFileSystemRoute",
|
|
283
|
+
"matchApplicationRouteIds",
|
|
284
|
+
"matchApplicationRoutes",
|
|
285
|
+
"nativeRoutePath",
|
|
286
|
+
"resolveRouteData",
|
|
287
|
+
"selectApplicationDataRoute",
|
|
288
|
+
"splitFileSystemRoutes",
|
|
289
|
+
"untilAborted"
|
|
290
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
291
|
+
Object.defineProperty(exports, '__esModule', {
|
|
292
|
+
value: true
|
|
293
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
RENDERER_ASSET_MANIFEST_FILE: ()=>RENDERER_ASSET_MANIFEST_FILE,
|
|
32
|
+
validateNativeClientAssetManifest: ()=>validateNativeClientAssetManifest
|
|
33
|
+
});
|
|
34
|
+
const external_document_js_namespaceObject = require("../document.js");
|
|
35
|
+
const external_identity_js_namespaceObject = require("../identity.js");
|
|
36
|
+
const RENDERER_ASSET_MANIFEST_FILE = 'renderer-assets.json';
|
|
37
|
+
function validateNativeClientAssetManifest(value, expectedIdentity) {
|
|
38
|
+
if (!value || 'object' != typeof value || Array.isArray(value)) throw new Error('Missing native client asset manifest. Rebuild the application before serving.');
|
|
39
|
+
const manifest = value;
|
|
40
|
+
if ('ultramodern-renderer-assets' !== manifest.schema || 1 !== manifest.version || 'react' === expectedIdentity.renderer || manifest.renderer !== expectedIdentity.renderer) throw new Error('Native client asset manifest conflicts with the selected renderer or schema.');
|
|
41
|
+
const entry = manifest.entries?.[expectedIdentity.entryName];
|
|
42
|
+
if (!entry?.rendererIdentity || !Array.isArray(entry.assets)) throw new Error(`Native client asset manifest is missing entry ${expectedIdentity.entryName}.`);
|
|
43
|
+
(0, external_identity_js_namespaceObject.assertRendererIdentity)(entry.rendererIdentity, expectedIdentity);
|
|
44
|
+
const assets = (0, external_document_js_namespaceObject.collectDocumentAssets)(entry.assets);
|
|
45
|
+
if (!assets.some((asset)=>"script" === asset.kind)) throw new Error(`Native client asset manifest has no application script for ${expectedIdentity.entryName}.`);
|
|
46
|
+
return assets;
|
|
47
|
+
}
|
|
48
|
+
exports.RENDERER_ASSET_MANIFEST_FILE = __webpack_exports__.RENDERER_ASSET_MANIFEST_FILE;
|
|
49
|
+
exports.validateNativeClientAssetManifest = __webpack_exports__.validateNativeClientAssetManifest;
|
|
50
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
51
|
+
"RENDERER_ASSET_MANIFEST_FILE",
|
|
52
|
+
"validateNativeClientAssetManifest"
|
|
53
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
54
|
+
Object.defineProperty(exports, '__esModule', {
|
|
55
|
+
value: true
|
|
56
|
+
});
|