@lwrjs/lwc-ssr 0.17.2-alpha.0 → 0.17.2-alpha.2
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/build/cjs/moduleLoader.cjs +1 -3
- package/build/cjs/renderer.cjs +1 -3
- package/build/cjs/viewProvider/index.cjs +1 -3
- package/build/cjs/viewTransformer/index.cjs +1 -3
- package/build/es/moduleLoader.js +2 -4
- package/build/es/renderer.js +2 -4
- package/build/es/viewProvider/index.js +2 -4
- package/build/es/viewTransformer/index.js +2 -4
- package/package.json +8 -8
|
@@ -105,9 +105,7 @@ async function createAMDModuleLoader(config, resourceRegistry, bundleRegistry, r
|
|
|
105
105
|
ssr: true
|
|
106
106
|
});
|
|
107
107
|
if (!def2) {
|
|
108
|
-
throw
|
|
109
|
-
description: import_diagnostics.descriptions.UNRESOLVABLE.BUNDLE(bundleRootSpecifier)
|
|
110
|
-
}, import_diagnostics.LwrUnresolvableError);
|
|
108
|
+
throw new import_diagnostics.LwrUnresolvableError(import_diagnostics.descriptions.UNRESOLVABLE.BUNDLE(bundleRootSpecifier), "bundle");
|
|
111
109
|
}
|
|
112
110
|
let code = await def2.getCode();
|
|
113
111
|
if (typeof def2.src === "string" && !code.includes("//# sourceURL=")) {
|
package/build/cjs/renderer.cjs
CHANGED
|
@@ -68,9 +68,7 @@ var Renderer = class {
|
|
|
68
68
|
const timeout = new Promise((_, reject) => {
|
|
69
69
|
timerId = setTimeout(() => {
|
|
70
70
|
abortController.abort();
|
|
71
|
-
reject((0,
|
|
72
|
-
description: import_diagnostics.descriptions.UNRESOLVABLE.SSR_TIMEOUT(route.id, (0, import_utils.getRenderTimeout)())
|
|
73
|
-
}, import_diagnostics.LwrServerError));
|
|
71
|
+
reject(new import_diagnostics.LwrApplicationError(import_diagnostics.descriptions.APPLICATION.SSR_TIMEOUT(route.id, (0, import_utils.getRenderTimeout)())));
|
|
74
72
|
}, (0, import_utils.getRenderTimeout)());
|
|
75
73
|
});
|
|
76
74
|
result = await this.pendingRenders.execute(async () => {
|
|
@@ -79,9 +79,7 @@ var LwcViewProvider = class extends import_base_view_provider.default {
|
|
|
79
79
|
if (errors) {
|
|
80
80
|
const errorString = Object.values(errors).join(", ");
|
|
81
81
|
if (!debug || (0, import_shared_utils.isLocalDev)() && process.env.SSR_THROW_ERRORS === "true") {
|
|
82
|
-
throw (
|
|
83
|
-
description: import_diagnostics.descriptions.APPLICATION.SSR_ERROR(specifier, errorString)
|
|
84
|
-
}, import_diagnostics.LwrApplicationError);
|
|
82
|
+
throw new import_diagnostics.LwrApplicationError(import_diagnostics.descriptions.APPLICATION.SSR_ERROR(specifier, errorString));
|
|
85
83
|
}
|
|
86
84
|
const message = (0, import_utils.createSsrErrorMessage)(specifier, errorString, false);
|
|
87
85
|
import_diagnostics.logger.warn(message, errors[specifier]);
|
|
@@ -121,9 +121,7 @@ function getComponentsToSSR(customElements, stringBuilder) {
|
|
|
121
121
|
function handleErrors(errors, customElements, specifiers, debug, serverDebug) {
|
|
122
122
|
const allErrors = Object.values(errors).join(", ");
|
|
123
123
|
if (!debug || (0, import_shared_utils.isLocalDev)() && process.env.SSR_THROW_ERRORS === "true") {
|
|
124
|
-
throw (
|
|
125
|
-
description: import_diagnostics.descriptions.APPLICATION.SSR_ERROR(specifiers, allErrors)
|
|
126
|
-
}, import_diagnostics.LwrApplicationError);
|
|
124
|
+
throw new import_diagnostics.LwrApplicationError(import_diagnostics.descriptions.APPLICATION.SSR_ERROR(specifiers, allErrors));
|
|
127
125
|
}
|
|
128
126
|
Object.entries(errors).forEach(([specifier, err]) => {
|
|
129
127
|
const ce = customElements.find(({tagName}) => specifier === (0, import_shared_utils.kebabCaseToModuleSpecifier)(tagName));
|
package/build/es/moduleLoader.js
CHANGED
|
@@ -3,7 +3,7 @@ import crypto from 'crypto';
|
|
|
3
3
|
import { explodeSpecifier, getSpecifier } from '@lwrjs/shared-utils';
|
|
4
4
|
import { getLoaderConfig, getLoaderId, getLoaderShim } from './utils.js';
|
|
5
5
|
import { FetchController } from './fetchController.js';
|
|
6
|
-
import {
|
|
6
|
+
import { descriptions, LwrUnresolvableError } from '@lwrjs/diagnostics';
|
|
7
7
|
export const FETCH_ABORT_KEY = '__fetchAbortId__';
|
|
8
8
|
const BOOTSTRAP_SPECIFIER = '@lwrjs/ssr-bootstrap';
|
|
9
9
|
export function createModuleLoader(config, resourceRegistry, bundleRegistry, runtimeEnvironment, runtimeParams, serverData, bootstrapConfig, abortController) {
|
|
@@ -89,9 +89,7 @@ async function createAMDModuleLoader(config, resourceRegistry, bundleRegistry, r
|
|
|
89
89
|
ssr: true, // get a server bundle for SSR
|
|
90
90
|
});
|
|
91
91
|
if (!def) {
|
|
92
|
-
throw
|
|
93
|
-
description: descriptions.UNRESOLVABLE.BUNDLE(bundleRootSpecifier),
|
|
94
|
-
}, LwrUnresolvableError);
|
|
92
|
+
throw new LwrUnresolvableError(descriptions.UNRESOLVABLE.BUNDLE(bundleRootSpecifier), 'bundle');
|
|
95
93
|
}
|
|
96
94
|
let code = await def.getCode();
|
|
97
95
|
if (typeof def.src === 'string' && !code.includes('//# sourceURL=')) {
|
package/build/es/renderer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TODO: investigate perf impact W-16056356
|
|
2
2
|
import { LRUCache } from 'lru-cache';
|
|
3
|
-
import {
|
|
3
|
+
import { LwrApplicationError, descriptions, logger, stringifyError } from '@lwrjs/diagnostics';
|
|
4
4
|
import { buildEnvironmentContext, getCacheKeyFromJson, getSpecifier, isLambdaEnv, moduleSpecifierToKebabCase, getFeatureFlags, TaskPool, isLocalDev, cookieStringToObject, } from '@lwrjs/shared-utils';
|
|
5
5
|
import { ViewSpan, cacheCountStore, getTracer } from '@lwrjs/instrumentation';
|
|
6
6
|
import { getServerBootstrapServices, getRenderTimeout } from './utils.js';
|
|
@@ -72,9 +72,7 @@ export class Renderer {
|
|
|
72
72
|
const timeout = new Promise((_, reject) => {
|
|
73
73
|
timerId = setTimeout(() => {
|
|
74
74
|
abortController.abort();
|
|
75
|
-
reject(
|
|
76
|
-
description: descriptions.UNRESOLVABLE.SSR_TIMEOUT(route.id, getRenderTimeout()),
|
|
77
|
-
}, LwrServerError));
|
|
75
|
+
reject(new LwrApplicationError(descriptions.APPLICATION.SSR_TIMEOUT(route.id, getRenderTimeout())));
|
|
78
76
|
}, getRenderTimeout());
|
|
79
77
|
});
|
|
80
78
|
result = (await this.pendingRenders.execute(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseViewProvider from '@lwrjs/base-view-provider';
|
|
2
|
-
import {
|
|
2
|
+
import { descriptions, logger, LwrApplicationError } from '@lwrjs/diagnostics';
|
|
3
3
|
import { ViewSpan, getTracer } from '@lwrjs/instrumentation';
|
|
4
4
|
import { hashContent, isLocalDev, isSpecifier, moduleSpecifierToKebabCase, slugify, } from '@lwrjs/shared-utils';
|
|
5
5
|
import { createHeadMarkup, createSsrErrorMarkup, createSsrErrorMessage } from '../utils.js';
|
|
@@ -55,9 +55,7 @@ export default class LwcViewProvider extends BaseViewProvider {
|
|
|
55
55
|
// throw in local dev mode if SSR_THROW_ERRORS === true
|
|
56
56
|
if (!debug || (isLocalDev() && process.env.SSR_THROW_ERRORS === 'true')) {
|
|
57
57
|
// 500 error for the page request
|
|
58
|
-
throw
|
|
59
|
-
description: descriptions.APPLICATION.SSR_ERROR(specifier, errorString),
|
|
60
|
-
}, LwrApplicationError);
|
|
58
|
+
throw new LwrApplicationError(descriptions.APPLICATION.SSR_ERROR(specifier, errorString));
|
|
61
59
|
}
|
|
62
60
|
// error page
|
|
63
61
|
const message = createSsrErrorMessage(specifier, errorString, false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { descriptions, logger, LwrApplicationError } from '@lwrjs/diagnostics';
|
|
2
2
|
import { ViewSpan, getTracer } from '@lwrjs/instrumentation';
|
|
3
3
|
import { HYDRATE_CLIENT_VALUE, HYDRATE_DIRECTIVE, isCsrIsland, isHydrateOnLoad, isLocalDev, kebabCaseToModuleSpecifier, shortestTtl, } from '@lwrjs/shared-utils';
|
|
4
4
|
import { SSR_PROPS_ATTR, addHeadMarkup, getPropsId, createSsrErrorMessage } from '../utils.js';
|
|
@@ -120,9 +120,7 @@ function handleErrors(errors, customElements, specifiers, debug, serverDebug) {
|
|
|
120
120
|
// throw in local dev mode if SSR_THROW_ERRORS === true
|
|
121
121
|
if (!debug || (isLocalDev() && process.env.SSR_THROW_ERRORS === 'true')) {
|
|
122
122
|
// 500 error for the page request
|
|
123
|
-
throw
|
|
124
|
-
description: descriptions.APPLICATION.SSR_ERROR(specifiers, allErrors),
|
|
125
|
-
}, LwrApplicationError);
|
|
123
|
+
throw new LwrApplicationError(descriptions.APPLICATION.SSR_ERROR(specifiers, allErrors));
|
|
126
124
|
}
|
|
127
125
|
// Fallback to CSR in debug mode or if enabled
|
|
128
126
|
Object.entries(errors).forEach(([specifier, err]) => {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.17.2-alpha.
|
|
7
|
+
"version": "0.17.2-alpha.2",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -42,17 +42,17 @@
|
|
|
42
42
|
"build/**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lwrjs/config": "0.17.2-alpha.
|
|
46
|
-
"@lwrjs/diagnostics": "0.17.2-alpha.
|
|
47
|
-
"@lwrjs/instrumentation": "0.17.2-alpha.
|
|
48
|
-
"@lwrjs/loader": "0.17.2-alpha.
|
|
49
|
-
"@lwrjs/shared-utils": "0.17.2-alpha.
|
|
45
|
+
"@lwrjs/config": "0.17.2-alpha.2",
|
|
46
|
+
"@lwrjs/diagnostics": "0.17.2-alpha.2",
|
|
47
|
+
"@lwrjs/instrumentation": "0.17.2-alpha.2",
|
|
48
|
+
"@lwrjs/loader": "0.17.2-alpha.2",
|
|
49
|
+
"@lwrjs/shared-utils": "0.17.2-alpha.2",
|
|
50
50
|
"fs-extra": "^11.2.0",
|
|
51
51
|
"lru-cache": "^10.4.3",
|
|
52
52
|
"undici": "^6.19.8"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@lwrjs/types": "0.17.2-alpha.
|
|
55
|
+
"@lwrjs/types": "0.17.2-alpha.2",
|
|
56
56
|
"jest": "^26.6.3",
|
|
57
57
|
"memfs": "^4.13.0",
|
|
58
58
|
"ts-jest": "^26.5.6"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"volta": {
|
|
64
64
|
"extends": "../../../package.json"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "739b237f5d7f2c1989142cb505a56cc763f21976"
|
|
67
67
|
}
|