@lwrjs/lwc-ssr 0.15.1 → 0.15.3
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/fetchController.cjs +1 -1
- package/build/cjs/viewProvider/index.cjs +3 -1
- package/build/cjs/viewTransformer/index.cjs +3 -1
- package/build/es/fetchController.js +1 -1
- package/build/es/viewProvider/index.js +4 -2
- package/build/es/viewTransformer/index.js +4 -2
- package/package.json +8 -8
|
@@ -120,7 +120,7 @@ var FetchController = class {
|
|
|
120
120
|
finalInit.headers[ROUTE_CORE_HEADER] = "true";
|
|
121
121
|
}
|
|
122
122
|
const proxyStr = coreProxy ? JSON.stringify(coreProxy) : "none";
|
|
123
|
-
const hasCookies = this.headers && this.headers.
|
|
123
|
+
const hasCookies = this.headers && this.headers.Cookie ? "yes" : "no";
|
|
124
124
|
import_diagnostics.logger.info({
|
|
125
125
|
label: `pre ${import_instrumentation.ViewSpan.Fetch}`,
|
|
126
126
|
message: `finalUrl: ${finalUrl}, coreProxy: ${proxyStr}, hasCookies: ${hasCookies}`
|
|
@@ -79,7 +79,9 @@ 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)()) && !(0, import_shared_utils.getFeatureFlags)().SSR_WITH_CSR_FALLBACK) {
|
|
82
|
-
throw
|
|
82
|
+
throw (0, import_diagnostics.createSingleDiagnosticError)({
|
|
83
|
+
description: import_diagnostics.descriptions.APPLICATION.SSR_ERROR(specifier, errorString)
|
|
84
|
+
}, import_diagnostics.LwrApplicationError);
|
|
83
85
|
}
|
|
84
86
|
const message = (0, import_utils.createSsrErrorMessage)(specifier, errorString, false);
|
|
85
87
|
import_diagnostics.logger.warn(message, errors[specifier]);
|
|
@@ -121,7 +121,9 @@ 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)()) && !(0, import_shared_utils.getFeatureFlags)().SSR_WITH_CSR_FALLBACK) {
|
|
124
|
-
throw
|
|
124
|
+
throw (0, import_diagnostics.createSingleDiagnosticError)({
|
|
125
|
+
description: import_diagnostics.descriptions.APPLICATION.SSR_ERROR(specifiers, allErrors)
|
|
126
|
+
}, import_diagnostics.LwrApplicationError);
|
|
125
127
|
}
|
|
126
128
|
Object.entries(errors).forEach(([specifier, err]) => {
|
|
127
129
|
const ce = customElements.find(({tagName}) => specifier === (0, import_shared_utils.kebabCaseToModuleSpecifier)(tagName));
|
|
@@ -127,7 +127,7 @@ export class FetchController {
|
|
|
127
127
|
finalInit.headers[ROUTE_CORE_HEADER] = 'true';
|
|
128
128
|
}
|
|
129
129
|
const proxyStr = coreProxy ? JSON.stringify(coreProxy) : 'none';
|
|
130
|
-
const hasCookies = this.headers && this.headers.
|
|
130
|
+
const hasCookies = this.headers && this.headers.Cookie ? 'yes' : 'no';
|
|
131
131
|
logger.info({
|
|
132
132
|
label: `pre ${ViewSpan.Fetch}`,
|
|
133
133
|
message: `finalUrl: ${finalUrl}, coreProxy: ${proxyStr}, hasCookies: ${hasCookies}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseViewProvider from '@lwrjs/base-view-provider';
|
|
2
|
-
import { logger } from '@lwrjs/diagnostics';
|
|
2
|
+
import { createSingleDiagnosticError, descriptions, logger, LwrApplicationError } from '@lwrjs/diagnostics';
|
|
3
3
|
import { ViewSpan, getTracer } from '@lwrjs/instrumentation';
|
|
4
4
|
import { getFeatureFlags, hashContent, isLocalDev, isSpecifier, moduleSpecifierToKebabCase, slugify, } from '@lwrjs/shared-utils';
|
|
5
5
|
import { createHeadMarkup, createSsrErrorMarkup, createSsrErrorMessage } from '../utils.js';
|
|
@@ -55,7 +55,9 @@ export default class LwcViewProvider extends BaseViewProvider {
|
|
|
55
55
|
// throw in local dev mode if SSR_WITH_CSR_FALLBACK === false
|
|
56
56
|
if ((!debug || isLocalDev()) && !getFeatureFlags().SSR_WITH_CSR_FALLBACK) {
|
|
57
57
|
// 500 error for the page request
|
|
58
|
-
throw
|
|
58
|
+
throw createSingleDiagnosticError({
|
|
59
|
+
description: descriptions.APPLICATION.SSR_ERROR(specifier, errorString),
|
|
60
|
+
}, LwrApplicationError);
|
|
59
61
|
}
|
|
60
62
|
// error page
|
|
61
63
|
const message = createSsrErrorMessage(specifier, errorString, false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger } from '@lwrjs/diagnostics';
|
|
1
|
+
import { createSingleDiagnosticError, descriptions, logger, LwrApplicationError } from '@lwrjs/diagnostics';
|
|
2
2
|
import { ViewSpan, getTracer } from '@lwrjs/instrumentation';
|
|
3
3
|
import { HYDRATE_CLIENT_VALUE, HYDRATE_DIRECTIVE, getFeatureFlags, isCsrIsland, isHydrateOnLoad, isLocalDev, kebabCaseToModuleSpecifier, shortestTtl, } from '@lwrjs/shared-utils';
|
|
4
4
|
import { SSR_PROPS_ATTR, addHeadMarkup, getPropsId, createSsrErrorMessage } from '../utils.js';
|
|
@@ -120,7 +120,9 @@ function handleErrors(errors, customElements, specifiers, debug, serverDebug) {
|
|
|
120
120
|
// throw in local dev mode if SSR_WITH_CSR_FALLBACK === false
|
|
121
121
|
if ((!debug || isLocalDev()) && !getFeatureFlags().SSR_WITH_CSR_FALLBACK) {
|
|
122
122
|
// 500 error for the page request
|
|
123
|
-
throw
|
|
123
|
+
throw createSingleDiagnosticError({
|
|
124
|
+
description: descriptions.APPLICATION.SSR_ERROR(specifiers, allErrors),
|
|
125
|
+
}, LwrApplicationError);
|
|
124
126
|
}
|
|
125
127
|
// Fallback to CSR in debug mode or if enabled
|
|
126
128
|
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.15.
|
|
7
|
+
"version": "0.15.3",
|
|
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.15.
|
|
46
|
-
"@lwrjs/diagnostics": "0.15.
|
|
47
|
-
"@lwrjs/instrumentation": "0.15.
|
|
48
|
-
"@lwrjs/loader": "0.15.
|
|
49
|
-
"@lwrjs/shared-utils": "0.15.
|
|
45
|
+
"@lwrjs/config": "0.15.3",
|
|
46
|
+
"@lwrjs/diagnostics": "0.15.3",
|
|
47
|
+
"@lwrjs/instrumentation": "0.15.3",
|
|
48
|
+
"@lwrjs/loader": "0.15.3",
|
|
49
|
+
"@lwrjs/shared-utils": "0.15.3",
|
|
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.15.
|
|
55
|
+
"@lwrjs/types": "0.15.3",
|
|
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": "d4ee52679347b27bdc1e4f37f8e1cc9646eb5386"
|
|
67
67
|
}
|