@absolutejs/absolute 0.19.0-beta.930 → 0.19.0-beta.932
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +65 -19
- package/dist/angular/index.js.map +4 -4
- package/dist/angular/server.js +65 -19
- package/dist/angular/server.js.map +4 -4
- package/dist/build.js +49 -19
- package/dist/build.js.map +14 -14
- package/dist/dev/client/handlers/angularHmrShim.ts +4 -1
- package/dist/dev/client/handlers/angularRemount.ts +2 -2
- package/dist/dev/client/handlers/angularRemountWiring.ts +1 -4
- package/dist/dev/client/vendor/lview/lViewOps.ts +8 -6
- package/dist/index.js +116 -35
- package/dist/index.js.map +19 -18
- package/dist/islands/index.js.map +2 -2
- package/dist/react/index.js +63 -17
- package/dist/react/index.js.map +4 -4
- package/dist/react/server.js +63 -17
- package/dist/react/server.js.map +3 -3
- package/dist/src/utils/defineConvention.d.ts +3 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/svelte/index.js +63 -17
- package/dist/svelte/index.js.map +4 -4
- package/dist/svelte/server.js +63 -17
- package/dist/svelte/server.js.map +3 -3
- package/dist/types/conventions.d.ts +5 -0
- package/dist/vue/index.js +63 -17
- package/dist/vue/index.js.map +4 -4
- package/dist/vue/server.js +63 -17
- package/dist/vue/server.js.map +3 -3
- package/package.json +1 -1
package/dist/angular/server.js
CHANGED
|
@@ -5087,16 +5087,22 @@ var setConventions = (map) => {
|
|
|
5087
5087
|
};
|
|
5088
5088
|
var isDev = () => true;
|
|
5089
5089
|
var buildErrorProps = (error) => {
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5090
|
+
if (error instanceof Error) {
|
|
5091
|
+
return {
|
|
5092
|
+
name: error.name,
|
|
5093
|
+
message: error.message,
|
|
5094
|
+
...isDev() && error.stack ? { stack: error.stack } : {}
|
|
5095
|
+
};
|
|
5096
|
+
}
|
|
5097
|
+
return { name: "Error", message: String(error) };
|
|
5093
5098
|
};
|
|
5094
5099
|
var renderReactError = async (conventionPath, errorProps) => {
|
|
5095
5100
|
const { createElement } = await import("react");
|
|
5096
5101
|
const { renderToReadableStream } = await import("react-dom/server");
|
|
5097
5102
|
const mod = await import(conventionPath);
|
|
5098
|
-
const
|
|
5099
|
-
|
|
5103
|
+
const ErrorComponent = mod.default;
|
|
5104
|
+
if (typeof ErrorComponent !== "function")
|
|
5105
|
+
return null;
|
|
5100
5106
|
const element = createElement(ErrorComponent, errorProps);
|
|
5101
5107
|
const stream = await renderToReadableStream(element);
|
|
5102
5108
|
return new Response(stream, {
|
|
@@ -5108,6 +5114,8 @@ var renderSvelteError = async (conventionPath, errorProps) => {
|
|
|
5108
5114
|
const { render } = await import("svelte/server");
|
|
5109
5115
|
const mod = await import(conventionPath);
|
|
5110
5116
|
const ErrorComponent = mod.default;
|
|
5117
|
+
if (!ErrorComponent)
|
|
5118
|
+
return null;
|
|
5111
5119
|
const { head, body } = render(ErrorComponent, {
|
|
5112
5120
|
props: errorProps
|
|
5113
5121
|
});
|
|
@@ -5130,6 +5138,8 @@ var renderVueError = async (conventionPath, errorProps) => {
|
|
|
5130
5138
|
const { renderToString } = await import("vue/server-renderer");
|
|
5131
5139
|
const mod = await import(conventionPath);
|
|
5132
5140
|
const ErrorComponent = mod.default;
|
|
5141
|
+
if (!ErrorComponent)
|
|
5142
|
+
return null;
|
|
5133
5143
|
const app = createSSRApp({
|
|
5134
5144
|
render: () => h(ErrorComponent, errorProps)
|
|
5135
5145
|
});
|
|
@@ -5143,10 +5153,20 @@ var renderVueError = async (conventionPath, errorProps) => {
|
|
|
5143
5153
|
};
|
|
5144
5154
|
var renderAngularError = async (conventionPath, errorProps) => {
|
|
5145
5155
|
const mod = await import(conventionPath);
|
|
5146
|
-
const
|
|
5147
|
-
if (typeof
|
|
5156
|
+
const renderFn = mod.default;
|
|
5157
|
+
if (typeof renderFn !== "function")
|
|
5148
5158
|
return null;
|
|
5149
|
-
const html =
|
|
5159
|
+
const html = renderFn(errorProps);
|
|
5160
|
+
return new Response(html, {
|
|
5161
|
+
headers: { "Content-Type": "text/html" },
|
|
5162
|
+
status: 500
|
|
5163
|
+
});
|
|
5164
|
+
};
|
|
5165
|
+
var escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5166
|
+
var replaceErrorTokens = (template, errorProps) => template.replace(/\{\{\s*name\s*\}\}/g, escapeHtml(errorProps.name)).replace(/\{\{\s*message\s*\}\}/g, escapeHtml(errorProps.message)).replace(/\{\{\s*stack\s*\}\}/g, errorProps.stack ? escapeHtml(errorProps.stack) : "");
|
|
5167
|
+
var renderHtmlError = async (conventionPath, errorProps) => {
|
|
5168
|
+
const template = await Bun.file(conventionPath).text();
|
|
5169
|
+
const html = replaceErrorTokens(template, errorProps);
|
|
5150
5170
|
return new Response(html, {
|
|
5151
5171
|
headers: { "Content-Type": "text/html" },
|
|
5152
5172
|
status: 500
|
|
@@ -5165,11 +5185,12 @@ var renderEmberNotFound = async () => null;
|
|
|
5165
5185
|
var ERROR_RENDERERS = {
|
|
5166
5186
|
angular: renderAngularError,
|
|
5167
5187
|
ember: renderEmberError,
|
|
5188
|
+
html: renderHtmlError,
|
|
5168
5189
|
react: renderReactError,
|
|
5169
5190
|
svelte: renderSvelteError,
|
|
5170
5191
|
vue: renderVueError
|
|
5171
5192
|
};
|
|
5172
|
-
var
|
|
5193
|
+
var tryFrameworkErrorConvention = async (framework, pageName, errorProps, error) => {
|
|
5173
5194
|
let conventionPath = resolveErrorConventionPath(framework, pageName);
|
|
5174
5195
|
if (!conventionPath && error instanceof Error && error.stack) {
|
|
5175
5196
|
for (const match of error.stack.matchAll(/^\s*at\s+([A-Za-z_$][\w$]*)/gm)) {
|
|
@@ -5183,7 +5204,6 @@ var renderConventionError = async (framework, pageName, error) => {
|
|
|
5183
5204
|
}
|
|
5184
5205
|
if (!conventionPath)
|
|
5185
5206
|
return null;
|
|
5186
|
-
const errorProps = buildErrorProps(error);
|
|
5187
5207
|
const renderer = ERROR_RENDERERS[framework];
|
|
5188
5208
|
if (!renderer)
|
|
5189
5209
|
return null;
|
|
@@ -5194,12 +5214,25 @@ var renderConventionError = async (framework, pageName, error) => {
|
|
|
5194
5214
|
}
|
|
5195
5215
|
return null;
|
|
5196
5216
|
};
|
|
5217
|
+
var renderConventionError = async (framework, pageName, error) => {
|
|
5218
|
+
const errorProps = buildErrorProps(error);
|
|
5219
|
+
const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
|
|
5220
|
+
if (frameworkResponse)
|
|
5221
|
+
return frameworkResponse;
|
|
5222
|
+
if (framework !== "html") {
|
|
5223
|
+
const htmlResponse = await tryFrameworkErrorConvention("html", pageName, errorProps, error);
|
|
5224
|
+
if (htmlResponse)
|
|
5225
|
+
return htmlResponse;
|
|
5226
|
+
}
|
|
5227
|
+
return null;
|
|
5228
|
+
};
|
|
5197
5229
|
var renderReactNotFound = async (conventionPath) => {
|
|
5198
5230
|
const { createElement } = await import("react");
|
|
5199
5231
|
const { renderToReadableStream } = await import("react-dom/server");
|
|
5200
5232
|
const mod = await import(conventionPath);
|
|
5201
|
-
const
|
|
5202
|
-
|
|
5233
|
+
const NotFoundComponent = mod.default;
|
|
5234
|
+
if (typeof NotFoundComponent !== "function")
|
|
5235
|
+
return null;
|
|
5203
5236
|
const element = createElement(NotFoundComponent);
|
|
5204
5237
|
const stream = await renderToReadableStream(element);
|
|
5205
5238
|
return new Response(stream, {
|
|
@@ -5211,6 +5244,8 @@ var renderSvelteNotFound = async (conventionPath) => {
|
|
|
5211
5244
|
const { render } = await import("svelte/server");
|
|
5212
5245
|
const mod = await import(conventionPath);
|
|
5213
5246
|
const NotFoundComponent = mod.default;
|
|
5247
|
+
if (!NotFoundComponent)
|
|
5248
|
+
return null;
|
|
5214
5249
|
const { head, body } = render(NotFoundComponent);
|
|
5215
5250
|
const html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;
|
|
5216
5251
|
return new Response(html, {
|
|
@@ -5223,6 +5258,8 @@ var renderVueNotFound = async (conventionPath) => {
|
|
|
5223
5258
|
const { renderToString } = await import("vue/server-renderer");
|
|
5224
5259
|
const mod = await import(conventionPath);
|
|
5225
5260
|
const NotFoundComponent = mod.default;
|
|
5261
|
+
if (!NotFoundComponent)
|
|
5262
|
+
return null;
|
|
5226
5263
|
const app = createSSRApp({
|
|
5227
5264
|
render: () => h(NotFoundComponent)
|
|
5228
5265
|
});
|
|
@@ -5236,10 +5273,17 @@ var renderVueNotFound = async (conventionPath) => {
|
|
|
5236
5273
|
};
|
|
5237
5274
|
var renderAngularNotFound = async (conventionPath) => {
|
|
5238
5275
|
const mod = await import(conventionPath);
|
|
5239
|
-
const
|
|
5240
|
-
if (typeof
|
|
5276
|
+
const renderFn = mod.default;
|
|
5277
|
+
if (typeof renderFn !== "function")
|
|
5241
5278
|
return null;
|
|
5242
|
-
const html =
|
|
5279
|
+
const html = renderFn();
|
|
5280
|
+
return new Response(html, {
|
|
5281
|
+
headers: { "Content-Type": "text/html" },
|
|
5282
|
+
status: 404
|
|
5283
|
+
});
|
|
5284
|
+
};
|
|
5285
|
+
var renderHtmlNotFound = async (conventionPath) => {
|
|
5286
|
+
const html = await Bun.file(conventionPath).text();
|
|
5243
5287
|
return new Response(html, {
|
|
5244
5288
|
headers: { "Content-Type": "text/html" },
|
|
5245
5289
|
status: 404
|
|
@@ -5248,6 +5292,7 @@ var renderAngularNotFound = async (conventionPath) => {
|
|
|
5248
5292
|
var NOT_FOUND_RENDERERS = {
|
|
5249
5293
|
angular: renderAngularNotFound,
|
|
5250
5294
|
ember: renderEmberNotFound,
|
|
5295
|
+
html: renderHtmlNotFound,
|
|
5251
5296
|
react: renderReactNotFound,
|
|
5252
5297
|
svelte: renderSvelteNotFound,
|
|
5253
5298
|
vue: renderVueNotFound
|
|
@@ -5270,7 +5315,8 @@ var NOT_FOUND_PRIORITY = [
|
|
|
5270
5315
|
"react",
|
|
5271
5316
|
"svelte",
|
|
5272
5317
|
"vue",
|
|
5273
|
-
"angular"
|
|
5318
|
+
"angular",
|
|
5319
|
+
"html"
|
|
5274
5320
|
];
|
|
5275
5321
|
var renderFirstNotFound = async () => {
|
|
5276
5322
|
const renderNext = async (frameworks) => {
|
|
@@ -5455,7 +5501,7 @@ var lowerAngularServerIslands = async (html) => {
|
|
|
5455
5501
|
init_devRouteRegistrationCallsite();
|
|
5456
5502
|
|
|
5457
5503
|
// src/angular/ssrSanitizer.ts
|
|
5458
|
-
var
|
|
5504
|
+
var escapeHtml2 = (str) => String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
5459
5505
|
var bypassValue = (value) => ({
|
|
5460
5506
|
changingThisBreaksApplicationSecurity: value
|
|
5461
5507
|
});
|
|
@@ -5481,7 +5527,7 @@ var getSsrSanitizer = (deps) => {
|
|
|
5481
5527
|
if (isTrustedHtml) {
|
|
5482
5528
|
return strValue;
|
|
5483
5529
|
}
|
|
5484
|
-
return
|
|
5530
|
+
return escapeHtml2(strValue);
|
|
5485
5531
|
}
|
|
5486
5532
|
return strValue;
|
|
5487
5533
|
}
|
|
@@ -5820,5 +5866,5 @@ export {
|
|
|
5820
5866
|
ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
|
|
5821
5867
|
};
|
|
5822
5868
|
|
|
5823
|
-
//# debugId=
|
|
5869
|
+
//# debugId=73CF4660FF2BF51464756E2164756E21
|
|
5824
5870
|
//# sourceMappingURL=server.js.map
|