@salesforce/pwa-kit-react-sdk 3.9.0-nightly-20241209080219 → 4.0.0-extensibility-preview.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/CHANGELOG.md +6 -6
- package/package.json +14 -9
- package/ssr/browser/main.d.ts +22 -0
- package/ssr/browser/main.d.ts.map +1 -0
- package/ssr/browser/main.js +67 -44
- package/ssr/browser/main.test.js +6 -4
- package/ssr/server/react-rendering.d.ts +9 -0
- package/ssr/server/react-rendering.d.ts.map +1 -0
- package/ssr/server/react-rendering.js +20 -8
- package/ssr/universal/compatibility.d.ts +3 -0
- package/ssr/universal/compatibility.d.ts.map +1 -0
- package/ssr/universal/components/_app/index.d.ts +20 -0
- package/ssr/universal/components/_app/index.d.ts.map +1 -0
- package/ssr/universal/components/_app/index.test.js +1 -1
- package/ssr/universal/components/_app-config/index.d.ts +60 -0
- package/ssr/universal/components/_app-config/index.d.ts.map +1 -0
- package/ssr/universal/components/_document/index.d.ts +55 -0
- package/ssr/universal/components/_document/index.d.ts.map +1 -0
- package/ssr/universal/components/_document/index.test.js +1 -1
- package/ssr/universal/components/_error/index.d.ts +32 -0
- package/ssr/universal/components/_error/index.d.ts.map +1 -0
- package/ssr/universal/components/_error/index.test.js +1 -1
- package/ssr/universal/components/app-error-boundary/index.d.ts +38 -0
- package/ssr/universal/components/app-error-boundary/index.d.ts.map +1 -0
- package/ssr/universal/components/app-error-boundary/index.test.js +3 -3
- package/ssr/universal/components/fetch-strategy/index.d.ts +13 -0
- package/ssr/universal/components/fetch-strategy/index.d.ts.map +1 -0
- package/ssr/universal/components/refresh/index.d.ts +17 -0
- package/ssr/universal/components/refresh/index.d.ts.map +1 -0
- package/ssr/universal/components/refresh/index.test.js +5 -5
- package/ssr/universal/components/route-component/index.d.ts +6 -0
- package/ssr/universal/components/route-component/index.d.ts.map +1 -0
- package/ssr/universal/components/route-component/index.js +11 -3
- package/ssr/universal/components/route-component/index.test.js +11 -11
- package/ssr/universal/components/routes/index.d.ts +3 -0
- package/ssr/universal/components/routes/index.d.ts.map +1 -0
- package/ssr/universal/components/routes/index.js +15 -0
- package/ssr/universal/components/switch/index.d.ts +22 -0
- package/ssr/universal/components/switch/index.d.ts.map +1 -0
- package/ssr/universal/components/switch/index.js +2 -2
- package/ssr/universal/components/throw-404/index.d.ts +17 -0
- package/ssr/universal/components/throw-404/index.d.ts.map +1 -0
- package/ssr/universal/components/throw-404/index.test.js +1 -1
- package/ssr/universal/components/with-correlation-id/index.d.ts +12 -0
- package/ssr/universal/components/with-correlation-id/index.d.ts.map +1 -0
- package/ssr/universal/components/with-legacy-get-props/index.d.ts +81 -0
- package/ssr/universal/components/with-legacy-get-props/index.d.ts.map +1 -0
- package/ssr/universal/components/with-legacy-get-props/index.js +1 -1
- package/ssr/universal/components/with-legacy-get-props/index.test.js +1 -1
- package/ssr/universal/components/with-react-query/index.d.ts +5 -0
- package/ssr/universal/components/with-react-query/index.d.ts.map +1 -0
- package/ssr/universal/components/with-react-query/index.test.js +3 -3
- package/ssr/universal/contexts/index.d.ts +26 -0
- package/ssr/universal/contexts/index.d.ts.map +1 -0
- package/ssr/universal/contexts/index.test.js +4 -4
- package/ssr/universal/errors.d.ts +13 -0
- package/ssr/universal/errors.d.ts.map +1 -0
- package/ssr/universal/events.d.ts +11 -0
- package/ssr/universal/events.d.ts.map +1 -0
- package/ssr/universal/hooks/index.d.ts +17 -0
- package/ssr/universal/hooks/index.d.ts.map +1 -0
- package/ssr/universal/hooks/index.js +3 -35
- package/ssr/universal/routes.d.ts +3 -0
- package/ssr/universal/routes.d.ts.map +1 -0
- package/ssr/universal/utils.client.test.js +30 -0
- package/ssr/universal/utils.d.ts +41 -0
- package/ssr/universal/utils.d.ts.map +1 -0
- package/ssr/universal/utils.js +43 -6
- package/utils/assets.d.ts +2 -0
- package/utils/assets.d.ts.map +1 -0
- package/utils/logger-instance.d.ts +3 -0
- package/utils/logger-instance.d.ts.map +1 -0
- package/utils/performance.d.ts +60 -0
- package/utils/performance.d.ts.map +1 -0
- package/utils/url.d.ts +2 -0
- package/utils/url.d.ts.map +1 -0
- package/utils/url.js +1 -3
- package/utils/uuidv4.client.d.ts +7 -0
- package/utils/uuidv4.client.d.ts.map +1 -0
- package/utils/warnings.d.ts +3 -0
- package/utils/warnings.d.ts.map +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export namespace PAGEEVENTS {
|
|
2
|
+
const PAGELOAD: string;
|
|
3
|
+
const ERROR: string;
|
|
4
|
+
}
|
|
5
|
+
export const pages: Pages;
|
|
6
|
+
declare class Pages {
|
|
7
|
+
pageLoad(templateName: any, start: any, end: any): void;
|
|
8
|
+
error(name: any, content: any): void;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/ssr/universal/events.js"],"names":[],"mappings":";;;;AAiCA,0BAAgC;AApBhC;IACI,wDAOC;IACD,qCAMC;CACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function useCorrelationId(): object;
|
|
2
|
+
export function useServerContext(): ServerContext;
|
|
3
|
+
/**
|
|
4
|
+
* Server context
|
|
5
|
+
*/
|
|
6
|
+
export type ServerContext = {
|
|
7
|
+
/**
|
|
8
|
+
* - Request object
|
|
9
|
+
*/
|
|
10
|
+
req: Object;
|
|
11
|
+
/**
|
|
12
|
+
* - Response object
|
|
13
|
+
*/
|
|
14
|
+
res: Object;
|
|
15
|
+
};
|
|
16
|
+
import { ServerContext } from "../contexts";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ssr/universal/hooks/index.js"],"names":[],"mappings":"AAgBO,oCAFM,MAAM,CAQlB;AAiBM,oCANM,aAAa,CAUzB;;;;;;;;SAhBa,MAAM;;;;SACN,MAAM"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useServerContext = exports.
|
|
6
|
+
exports.useServerContext = exports.useCorrelationId = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _contexts = require("../contexts");
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
/*
|
|
12
|
-
* Copyright (c)
|
|
12
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
13
13
|
* All rights reserved.
|
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
15
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
@@ -49,36 +49,4 @@ const useServerContext = () => {
|
|
|
49
49
|
const serverContext = (0, _react.useContext)(_contexts.ServerContext);
|
|
50
50
|
return serverContext;
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Returns the application's origin.
|
|
55
|
-
*
|
|
56
|
-
* By default, it will return the ORIGIN under which we are serving the page.
|
|
57
|
-
*
|
|
58
|
-
* If `fromXForwardedHeader` is true, it will use the value of `x-forwarded-proto` and `x-forwarded-host` headers in req
|
|
59
|
-
* to build origin. (it is false by default)
|
|
60
|
-
*
|
|
61
|
-
* NOTE: this is a React hook, so it has to be used in a React rendering pipeline.
|
|
62
|
-
* @returns {string} origin string
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
exports.useServerContext = useServerContext;
|
|
66
|
-
const useOrigin = ({
|
|
67
|
-
fromXForwardedHeader = false
|
|
68
|
-
}) => {
|
|
69
|
-
const {
|
|
70
|
-
res
|
|
71
|
-
} = useServerContext();
|
|
72
|
-
if (typeof window !== 'undefined') {
|
|
73
|
-
return window.location.origin;
|
|
74
|
-
}
|
|
75
|
-
const {
|
|
76
|
-
APP_ORIGIN
|
|
77
|
-
} = process.env;
|
|
78
|
-
const xForwardedOrigin = res.locals.xForwardedOrigin;
|
|
79
|
-
if (fromXForwardedHeader && xForwardedOrigin) {
|
|
80
|
-
return xForwardedOrigin;
|
|
81
|
-
}
|
|
82
|
-
return APP_ORIGIN;
|
|
83
|
-
};
|
|
84
|
-
exports.useOrigin = useOrigin;
|
|
52
|
+
exports.useServerContext = useServerContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/ssr/universal/routes.js"],"names":[],"mappings":";AAOA,4BAAiB"}
|
|
@@ -43,4 +43,34 @@ describe('getAssetUrl (client-side)', () => {
|
|
|
43
43
|
test('should return origin + path', () => {
|
|
44
44
|
expect(utils.getAssetUrl('/path')).toBe('test.com/path');
|
|
45
45
|
});
|
|
46
|
+
});
|
|
47
|
+
describe('getStaticAssetUrl (client-side)', () => {
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
global.Progressive = {
|
|
50
|
+
buildOrigin: 'test.com'
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
afterEach(() => {
|
|
54
|
+
delete global.Progressive;
|
|
55
|
+
});
|
|
56
|
+
test('should return build origin when path is undefined', () => {
|
|
57
|
+
expect(utils.getStaticAssetUrl()).toBe('test.com/static');
|
|
58
|
+
});
|
|
59
|
+
test('should return origin + path', () => {
|
|
60
|
+
expect(utils.getStaticAssetUrl('/path')).toBe('test.com/static/path');
|
|
61
|
+
expect(utils.getStaticAssetUrl('path')).toBe('test.com/static/path');
|
|
62
|
+
});
|
|
63
|
+
test('should return build origin with extension prefix when no path is defined, but an extension package name is', () => {
|
|
64
|
+
expect(utils.getStaticAssetUrl('', {
|
|
65
|
+
appExtensionPackageName: '@salesforce/sample-extension'
|
|
66
|
+
})).toBe('test.com/static/__extensions/@salesforce/sample-extension');
|
|
67
|
+
});
|
|
68
|
+
test('should return origin + extension prefix + path', () => {
|
|
69
|
+
expect(utils.getStaticAssetUrl('/path', {
|
|
70
|
+
appExtensionPackageName: '@salesforce/sample-extension'
|
|
71
|
+
})).toBe('test.com/static/__extensions/@salesforce/sample-extension/path');
|
|
72
|
+
expect(utils.getStaticAssetUrl('path', {
|
|
73
|
+
appExtensionPackageName: '@salesforce/sample-extension'
|
|
74
|
+
})).toBe('test.com/static/__extensions/@salesforce/sample-extension/path');
|
|
75
|
+
});
|
|
46
76
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type GetAssetUrlOptions = {
|
|
2
|
+
appExtensionPackageName?: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Get the URL that should be used to load an asset from the bundle.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} path - relative path from the build directory to the asset
|
|
8
|
+
* @function
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export declare const getAssetUrl: (path: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the URL that should be used to load a static asset from the bundle.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} path - Relative path from the build directory to the asset.
|
|
16
|
+
* @param {Object} opts - Options for generating the asset URL.
|
|
17
|
+
* @param {string} [opts.appExtensionPackageName] - Optional package name for an application extension.
|
|
18
|
+
* @function
|
|
19
|
+
* @returns {string} The full URL to the static asset.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getStaticAssetUrl: (path: string, opts: GetAssetUrlOptions) => string;
|
|
22
|
+
/**
|
|
23
|
+
* @typedef {Object} ProxyConfig
|
|
24
|
+
* @property {String} protocol - http or https
|
|
25
|
+
* @property {String} host - the hostname
|
|
26
|
+
* @property {String} path - the path element that follows "mobify/proxy"
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Return the set of proxies configured for the app.
|
|
30
|
+
*
|
|
31
|
+
* The result is an array of objects, each of which has 'protocol'
|
|
32
|
+
* (either 'http' or 'https'), 'host' (the hostname) and 'path' (the
|
|
33
|
+
* path element that follows "/mobify/proxy/", defaulting to 'base' for
|
|
34
|
+
* the first proxy, and 'base2' for the next).
|
|
35
|
+
*
|
|
36
|
+
* @function
|
|
37
|
+
* @returns {Array<ProxyConfig>}
|
|
38
|
+
*/
|
|
39
|
+
export declare const getProxyConfigs: () => any;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/ssr/universal/utils.ts"],"names":[],"mappings":"AAuBA,KAAK,kBAAkB,GAAG;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAA;CACnC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,WAQvC,CAAA;AAID;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,SAAU,MAAM,QAAQ,kBAAkB,WAiBvE,CAAA;AAED;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,WAS3B,CAAA"}
|
package/ssr/universal/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getProxyConfigs = exports.getAssetUrl = void 0;
|
|
6
|
+
exports.getStaticAssetUrl = exports.getProxyConfigs = exports.getAssetUrl = void 0;
|
|
7
7
|
var _ssrShared = require("@salesforce/pwa-kit-runtime/utils/ssr-shared");
|
|
8
8
|
var _ssrNamespacePaths = require("@salesforce/pwa-kit-runtime/utils/ssr-namespace-paths");
|
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -17,9 +17,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
17
17
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
18
18
|
*/ /**
|
|
19
19
|
* @module progressive-web-sdk/ssr/universal/utils
|
|
20
|
-
*/
|
|
20
|
+
*/ /* eslint-disable @typescript-eslint/ban-ts-comment */ // @ts-ignore
|
|
21
|
+
// @ts-ignore
|
|
21
22
|
const onClient = typeof window !== 'undefined';
|
|
22
|
-
|
|
23
|
+
const EXTENIONS_NAMESPACE = '__extensions';
|
|
24
|
+
const STATIC_FOLDER = 'static';
|
|
23
25
|
/**
|
|
24
26
|
* Get the URL that should be used to load an asset from the bundle.
|
|
25
27
|
*
|
|
@@ -29,10 +31,41 @@ const onClient = typeof window !== 'undefined';
|
|
|
29
31
|
*/
|
|
30
32
|
const getAssetUrl = path => {
|
|
31
33
|
/* istanbul ignore next */
|
|
32
|
-
const publicPath = onClient ?
|
|
34
|
+
const publicPath = onClient ?
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
`${window.Progressive.buildOrigin}` : `${_ssrNamespacePaths.bundleBasePath}/${process.env.BUNDLE_ID || 'development'}/`;
|
|
33
37
|
return path ? `${publicPath}${path}` : publicPath;
|
|
34
38
|
};
|
|
35
39
|
|
|
40
|
+
// TODO: Once we establish that we have a new @salesforce/pwa-kit-extensibility package, we can move this utility to
|
|
41
|
+
// it as to not have direct references to extensibilty in the sdk. This will also reduce duplicate code.
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL that should be used to load a static asset from the bundle.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} path - Relative path from the build directory to the asset.
|
|
46
|
+
* @param {Object} opts - Options for generating the asset URL.
|
|
47
|
+
* @param {string} [opts.appExtensionPackageName] - Optional package name for an application extension.
|
|
48
|
+
* @function
|
|
49
|
+
* @returns {string} The full URL to the static asset.
|
|
50
|
+
*/
|
|
51
|
+
exports.getAssetUrl = getAssetUrl;
|
|
52
|
+
const getStaticAssetUrl = (path, opts) => {
|
|
53
|
+
const {
|
|
54
|
+
appExtensionPackageName = ''
|
|
55
|
+
} = opts || {};
|
|
56
|
+
|
|
57
|
+
/* istanbul ignore next */
|
|
58
|
+
const publicPath = onClient ?
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
`${window.Progressive.buildOrigin}` : `${_ssrNamespacePaths.bundleBasePath}/${process.env.BUNDLE_ID || 'development'}/`;
|
|
61
|
+
|
|
62
|
+
// Ensure all defined path arguments start with `/`.
|
|
63
|
+
if (path && !path.startsWith('/')) {
|
|
64
|
+
path = `/${path}`;
|
|
65
|
+
}
|
|
66
|
+
return `${publicPath}/${STATIC_FOLDER}${appExtensionPackageName ? `/${EXTENIONS_NAMESPACE}/${appExtensionPackageName}` : ''}${path ? path : ''}`;
|
|
67
|
+
};
|
|
68
|
+
|
|
36
69
|
/**
|
|
37
70
|
* @typedef {Object} ProxyConfig
|
|
38
71
|
* @property {String} protocol - http or https
|
|
@@ -51,9 +84,13 @@ const getAssetUrl = path => {
|
|
|
51
84
|
* @function
|
|
52
85
|
* @returns {Array<ProxyConfig>}
|
|
53
86
|
*/
|
|
54
|
-
exports.
|
|
87
|
+
exports.getStaticAssetUrl = getStaticAssetUrl;
|
|
55
88
|
const getProxyConfigs = () => {
|
|
56
|
-
const configs = onClient ?
|
|
89
|
+
const configs = onClient ?
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
(window.Progressive.ssrOptions || {}).proxyConfigs || [] :
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
_ssrShared.proxyConfigs;
|
|
57
94
|
|
|
58
95
|
// Clone to avoid accidental mutation of important configuration variables.
|
|
59
96
|
return configs.map(config => _objectSpread({}, config));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/utils/assets.js"],"names":[],"mappings":"AAgCO,4EAdI,MAAM,QAmGhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-instance.d.ts","sourceRoot":"","sources":["../../src/utils/logger-instance.js"],"names":[],"mappings":";AAQA,wGAA8E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export namespace PERFORMANCE_MARKS {
|
|
2
|
+
const total: string;
|
|
3
|
+
const renderToString: string;
|
|
4
|
+
const routeMatching: string;
|
|
5
|
+
const loadComponent: string;
|
|
6
|
+
const fetchStrategies: string;
|
|
7
|
+
const reactQueryPrerender: string;
|
|
8
|
+
const reactQueryUseQuery: string;
|
|
9
|
+
const getProps: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* This is an SDK internal class that is responsible for measuring server side performance.
|
|
13
|
+
*
|
|
14
|
+
* This class manages two types of performance marks: start and end.
|
|
15
|
+
*
|
|
16
|
+
* By default, this timer is disabled. Only certain environment variables and feature flags turns it on.
|
|
17
|
+
*
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
export default class PerformanceTimer {
|
|
21
|
+
constructor(options?: {});
|
|
22
|
+
MARKER_TYPES: {
|
|
23
|
+
START: string;
|
|
24
|
+
END: string;
|
|
25
|
+
};
|
|
26
|
+
enabled: any;
|
|
27
|
+
marks: {
|
|
28
|
+
start: Map<any, any>;
|
|
29
|
+
end: Map<any, any>;
|
|
30
|
+
};
|
|
31
|
+
metrics: any[];
|
|
32
|
+
/**
|
|
33
|
+
* This is a utility function to build the Server-Timing header.
|
|
34
|
+
* The function receives an array of performance metrics and returns a string that represents the Server-Timing header.
|
|
35
|
+
*
|
|
36
|
+
* see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
|
|
37
|
+
*
|
|
38
|
+
* @function
|
|
39
|
+
* @private
|
|
40
|
+
*
|
|
41
|
+
* @return {String}
|
|
42
|
+
*/
|
|
43
|
+
private buildServerTimingHeader;
|
|
44
|
+
/**
|
|
45
|
+
* A utility function to format and log the performance metrics.
|
|
46
|
+
*
|
|
47
|
+
* @function
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
private log;
|
|
51
|
+
/**
|
|
52
|
+
* This is a utility function to create performance marks.
|
|
53
|
+
* The data will be used in console logs and the http response header `server-timing`.
|
|
54
|
+
*
|
|
55
|
+
* @function
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
private mark;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/utils/performance.js"],"names":[],"mappings":";;;;;;;;;;AAkBA;;;;;;;;GAQG;AACH;IAKI,0BAOC;IAXD;;;MAGC;IAEG,aAAuC;IACvC;;;MAGC;IACD,eAAiB;IAGrB;;;;;;;;;;OAUG;IACH,gCAQC;IAED;;;;;OAKG;IACH,YAMC;IAED;;;;;;OAMG;IACH,aA0CC;CACJ"}
|
package/utils/url.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.js"],"names":[],"mappings":"AAoBO,gCANM,MAAM,CAoBlB"}
|
package/utils/url.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getAppOrigin = void 0;
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (c)
|
|
8
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
9
9
|
* All rights reserved.
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
@@ -18,8 +18,6 @@ exports.getAppOrigin = void 0;
|
|
|
18
18
|
* initialized using the `_createApp` method (This happens in your /app/ssr.js file).
|
|
19
19
|
*
|
|
20
20
|
* @function
|
|
21
|
-
* @deprecated use `useOrigin()` instead.
|
|
22
|
-
* This function will be removed in version 4.0.0.
|
|
23
21
|
* @returns {string} Returns the ORIGIN under which we are serving the page.
|
|
24
22
|
* @example
|
|
25
23
|
* import {getAppOrigin} from '@salesforce/pwa-kit-react-sdk/utils/url'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuidv4.client.d.ts","sourceRoot":"","sources":["../../src/utils/uuidv4.client.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,8BAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../src/utils/warnings.js"],"names":[],"mappings":"AAuBO,kDAEN;AAQM,oDAEN"}
|