Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-rum-web

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-rum-web - npm Package Compare versions

Comparing version 1.13.7 to 1.14.0

dist/cjs/plugins/utils/performance-utils.d.ts

52

CHANGELOG.md

@@ -5,52 +5,20 @@ # Changelog

### [1.13.7](https://github.com/aws-observability/aws-rum-web/compare/v1.13.6...v1.13.7) (2023-04-11)
## [1.14.0](https://github.com/aws-observability/aws-rum-web/compare/v1.13.0...v1.14.0) (2023-06-29)
### Bug Fixes
### Features
* Add @aws-sdk/querystring-builder as a dependency. ([#370](https://github.com/aws-observability/aws-rum-web/issues/370)) ([9e7ffdc](https://github.com/aws-observability/aws-rum-web/commit/9e7ffdcd39d09d3dc5cef6867a59252b1f419e2a))
* Ignore resources with non-http scheme ([#419](https://github.com/aws-observability/aws-rum-web/issues/419)) ([42a2ae5](https://github.com/aws-observability/aws-rum-web/commit/42a2ae568b954190db942377df32c7fc5b89686e))
### [1.13.6]((https://github.com/aws-observability/aws-rum-web/compare/v1.13.5...v1.13.6)) (2023-03-17)
### Bug Fixes
* Hardcode web client version to v1.13.6 ([183cfb](https://github.com/aws-observability/aws-rum-web/commit/183cfb2b3433b95947adbf680c66b3ad4c7b0e23))
* Add @aws-sdk/querystring-builder as a dependency. ([#370](https://github.com/aws-observability/aws-rum-web/issues/370)) ([42662eb](https://github.com/aws-observability/aws-rum-web/commit/42662eb98695c027c3eef3ec6547527240486ac5))
* Export PageAttributes type. ([#369](https://github.com/aws-observability/aws-rum-web/issues/369)) ([4b78dc1](https://github.com/aws-observability/aws-rum-web/commit/4b78dc14799151422bee07f6263c1aaa098354f6))
* Handle missing pageId in metadata when page is resumed ([#388](https://github.com/aws-observability/aws-rum-web/issues/388)) ([f81bcf2](https://github.com/aws-observability/aws-rum-web/commit/f81bcf24e8094a65fe2b99e6bbe65196ec2ea595))
* Hardcode webclient version ([#381](https://github.com/aws-observability/aws-rum-web/issues/381)) ([bc1c15f](https://github.com/aws-observability/aws-rum-web/commit/bc1c15ff7c6cc85a3d5843ba343e194b88449921))
* Transpile [@aws-sdk](https://github.com/aws-sdk) to ES5. ([#363](https://github.com/aws-observability/aws-rum-web/issues/363)) ([f63150d](https://github.com/aws-observability/aws-rum-web/commit/f63150df6ed6a9d8a877ccfe8e160c5a8d9873ec))
* Update entry point in package.json ([#377](https://github.com/aws-observability/aws-rum-web/issues/377)) ([7877e86](https://github.com/aws-observability/aws-rum-web/commit/7877e86ae4fd2f74cac8d603a59272eec015a852))
* Update version during release workflow only ([#359](https://github.com/aws-observability/aws-rum-web/issues/359)) ([f6b7bd7](https://github.com/aws-observability/aws-rum-web/commit/f6b7bd744ec9e8413b93a2069c40b815e4ddc9ab))
### [1.13.5]((https://github.com/aws-observability/aws-rum-web/compare/v1.13.4...v1.13.5)) (2023-03-17)
### Bug Fixes
* Handle missing pageId in metadata when page is resumed ([#388](https://github.com/aws-observability/aws-rum-web/issues/388)) ([49678a6](https://github.com/aws-observability/aws-rum-web/commit/49678a6812cca9af3105a10b693e413d4b7da166))
### [1.13.4](https://github.com/aws-observability/aws-rum-web/compare/v1.13.2...v1.13.4) (2023-03-07)
### Bug Fixes
* Hardcode webclient version ([#381](https://github.com/aws-observability/aws-rum-web/issues/381)) ([#384](https://github.com/aws-observability/aws-rum-web/issues/384)) ([2576f91](https://github.com/aws-observability/aws-rum-web/commit/2576f91a263a9a1d95ccb34db48809d09d42526d))
### [1.13.3](https://github.com/aws-observability/aws-rum-web/compare/v1.13.2...v1.13.3) (2023-03-07)
### Bug Fixes
* Update entry point in package.json ([#377](https://github.com/aws-observability/aws-rum-web/issues/377)) ([#379](https://github.com/aws-observability/aws-rum-web/issues/379)) ([5d87e46](https://github.com/aws-observability/aws-rum-web/commit/5d87e46bc7452398f6288e4d1880059c77e35f92))
### [1.13.2](https://github.com/aws-observability/aws-rum-web/compare/v1.13.1...v1.13.2) (2022-02-25)
### Bug Fixes
* Transpile @aws-sdk to ES5 to gracefully close browsers at end of life ([#363](https://github.com/aws-observability/aws-rum-web/pull/363)) ([f63150d](https://github.com/aws-observability/aws-rum-web/commit/f63150df6ed6a9d8a877ccfe8e160c5a8d9873ec))
### [1.13.1](https://github.com/aws-observability/aws-rum-web/compare/v1.13.0...v1.13.1) (2022-02-24)
### Bug Fixes
* Update version during release workflow only ([#359](https://github.com/aws-observability/aws-rum-web/pull/359)) ([f6b7bd7](https://github.com/aws-observability/aws-rum-web/commit/f6b7bd744ec9e8413b93a2069c40b815e4ddc9ab))
## [1.13.0](https://github.com/aws-observability/aws-rum-web/compare/v1.12.0...v1.13.0) (2023-02-23)

@@ -57,0 +25,0 @@

@@ -18,3 +18,3 @@ "use strict";

var PageManager_1 = require("../sessions/PageManager");
var webClientVersion = '1.13.7';
var webClientVersion = '1.14.0';
/**

@@ -21,0 +21,0 @@ * A cache which stores events generated by telemetry plugins.

export { PartialConfig as AwsRumConfig, Orchestration as AwsRum, PartialCookieAttributes, PageIdFormat, PageIdFormatEnum, Telemetry, TelemetryEnum } from './orchestration/Orchestration';
export { ClientBuilder } from './dispatch/Dispatch';
export { PageAttributes } from './sessions/PageManager';
export { Plugin } from './plugins/Plugin';

@@ -4,0 +5,0 @@ export { PluginContext } from './plugins/types';

@@ -325,3 +325,3 @@ "use strict";

return [
new NavigationPlugin_1.NavigationPlugin(),
new NavigationPlugin_1.NavigationPlugin(config),
new ResourcePlugin_1.ResourcePlugin(config),

@@ -328,0 +328,0 @@ new WebVitalsPlugin_1.WebVitalsPlugin()

import { InternalPlugin } from '../InternalPlugin';
import { PartialPerformancePluginConfig } from '../utils/performance-utils';
export declare const NAVIGATION_EVENT_PLUGIN_ID = "navigation";

@@ -9,3 +10,4 @@ /**

export declare class NavigationPlugin extends InternalPlugin {
constructor();
private config;
constructor(config?: PartialPerformancePluginConfig);
enable(): void;

@@ -39,3 +41,3 @@ disable(): void;

*/
performanceNavigationEventHandlerTimingLevel2: (entryData: any) => void;
performanceNavigationEventHandlerTimingLevel2: (entryData: PerformanceNavigationTiming) => void;
/**

@@ -42,0 +44,0 @@ * loadEventEnd is populated as 0 if the web page has not loaded completely, even though LOAD has been fired.

@@ -17,2 +17,13 @@ "use strict";

})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -22,2 +33,3 @@ exports.NavigationPlugin = exports.NAVIGATION_EVENT_PLUGIN_ID = void 0;

var constant_1 = require("../utils/constant");
var performance_utils_1 = require("../utils/performance-utils");
exports.NAVIGATION_EVENT_PLUGIN_ID = 'navigation';

@@ -33,3 +45,3 @@ var NAVIGATION = 'navigation';

__extends(NavigationPlugin, _super);
function NavigationPlugin() {
function NavigationPlugin(config) {
var _this = _super.call(this, exports.NAVIGATION_EVENT_PLUGIN_ID) || this;

@@ -53,6 +65,7 @@ /**

var navigationObserver = new PerformanceObserver(function (list) {
list.getEntries().forEach(function (event) {
if (event.entryType === NAVIGATION) {
_this.performanceNavigationEventHandlerTimingLevel2(event);
}
list.getEntries()
.filter(function (e) { return e.entryType === NAVIGATION; })
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {
_this.performanceNavigationEventHandlerTimingLevel2(event);
});

@@ -193,2 +206,3 @@ });

};
_this.config = __assign(__assign({}, performance_utils_1.defaultPerformancePluginConfig), config);
return _this;

@@ -233,6 +247,11 @@ }

NavigationPlugin.prototype.onload = function () {
var _this = this;
if (this.enabled) {
if (this.hasTheWindowLoadEventFired()) {
var navData = window.performance.getEntriesByType(NAVIGATION)[0];
this.performanceNavigationEventHandlerTimingLevel2(navData);
window.performance
.getEntriesByType(NAVIGATION)
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {
return _this.performanceNavigationEventHandlerTimingLevel2(event);
});
}

@@ -239,0 +258,0 @@ else {

import { InternalPlugin } from '../InternalPlugin';
import { ResourceType } from '../../utils/common-utils';
import { PartialPerformancePluginConfig } from '../utils/performance-utils';
export declare const RESOURCE_EVENT_PLUGIN_ID = "resource";
export declare type PartialResourcePluginConfig = {
eventLimit?: number;
recordAllTypes?: ResourceType[];
sampleTypes?: ResourceType[];
};
export declare type ResourcePluginConfig = {
eventLimit: number;
recordAllTypes: ResourceType[];
sampleTypes: ResourceType[];
};
export declare const defaultConfig: {
eventLimit: number;
recordAllTypes: ResourceType[];
sampleTypes: ResourceType[];
};
/**

@@ -24,3 +9,3 @@ * This plugin records resource performance timing events generated during every page load/re-load.

private config;
constructor(config?: PartialResourcePluginConfig);
constructor(config?: PartialPerformancePluginConfig);
enable(): void;

@@ -27,0 +12,0 @@ disable(): void;

@@ -29,19 +29,10 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ResourcePlugin = exports.defaultConfig = exports.RESOURCE_EVENT_PLUGIN_ID = void 0;
exports.ResourcePlugin = exports.RESOURCE_EVENT_PLUGIN_ID = void 0;
var InternalPlugin_1 = require("../InternalPlugin");
var common_utils_1 = require("../../utils/common-utils");
var constant_1 = require("../utils/constant");
var performance_utils_1 = require("../utils/performance-utils");
exports.RESOURCE_EVENT_PLUGIN_ID = 'resource';
var RESOURCE = 'resource';
var LOAD = 'load';
exports.defaultConfig = {
eventLimit: 10,
recordAllTypes: [common_utils_1.ResourceType.DOCUMENT, common_utils_1.ResourceType.SCRIPT],
sampleTypes: [
common_utils_1.ResourceType.STYLESHEET,
common_utils_1.ResourceType.IMAGE,
common_utils_1.ResourceType.FONT,
common_utils_1.ResourceType.OTHER
]
};
/**

@@ -61,2 +52,3 @@ * This plugin records resource performance timing events generated during every page load/re-load.

.filter(function (e) { return e.entryType === RESOURCE; })
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {

@@ -80,3 +72,5 @@ // Out of n resource events, x events are recorded using Observer API

if (events !== undefined && events.length > 0) {
events.forEach(function (event) {
events
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {
var type = (0, common_utils_1.getResourceFileType)(event.name);

@@ -129,3 +123,3 @@ if (_this.config.recordAllTypes.includes(type)) {

};
_this.config = __assign(__assign({}, exports.defaultConfig), config);
_this.config = __assign(__assign({}, performance_utils_1.defaultPerformancePluginConfig), config);
return _this;

@@ -132,0 +126,0 @@ }

@@ -15,3 +15,3 @@ var __assign = (this && this.__assign) || function () {

import { PageManager } from '../sessions/PageManager';
var webClientVersion = '1.13.7';
var webClientVersion = '1.14.0';
/**

@@ -18,0 +18,0 @@ * A cache which stores events generated by telemetry plugins.

export { PartialConfig as AwsRumConfig, Orchestration as AwsRum, PartialCookieAttributes, PageIdFormat, PageIdFormatEnum, Telemetry, TelemetryEnum } from './orchestration/Orchestration';
export { ClientBuilder } from './dispatch/Dispatch';
export { PageAttributes } from './sessions/PageManager';
export { Plugin } from './plugins/Plugin';

@@ -4,0 +5,0 @@ export { PluginContext } from './plugins/types';

@@ -320,3 +320,3 @@ var __assign = (this && this.__assign) || function () {

return [
new NavigationPlugin(),
new NavigationPlugin(config),
new ResourcePlugin(config),

@@ -323,0 +323,0 @@ new WebVitalsPlugin()

import { InternalPlugin } from '../InternalPlugin';
import { PartialPerformancePluginConfig } from '../utils/performance-utils';
export declare const NAVIGATION_EVENT_PLUGIN_ID = "navigation";

@@ -9,3 +10,4 @@ /**

export declare class NavigationPlugin extends InternalPlugin {
constructor();
private config;
constructor(config?: PartialPerformancePluginConfig);
enable(): void;

@@ -39,3 +41,3 @@ disable(): void;

*/
performanceNavigationEventHandlerTimingLevel2: (entryData: any) => void;
performanceNavigationEventHandlerTimingLevel2: (entryData: PerformanceNavigationTiming) => void;
/**

@@ -42,0 +44,0 @@ * loadEventEnd is populated as 0 if the web page has not loaded completely, even though LOAD has been fired.

@@ -16,4 +16,16 @@ var __extends = (this && this.__extends) || (function () {

})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { InternalPlugin } from '../InternalPlugin';
import { PERFORMANCE_NAVIGATION_EVENT_TYPE } from '../utils/constant';
import { defaultPerformancePluginConfig } from '../utils/performance-utils';
export var NAVIGATION_EVENT_PLUGIN_ID = 'navigation';

@@ -29,3 +41,3 @@ var NAVIGATION = 'navigation';

__extends(NavigationPlugin, _super);
function NavigationPlugin() {
function NavigationPlugin(config) {
var _this = _super.call(this, NAVIGATION_EVENT_PLUGIN_ID) || this;

@@ -49,6 +61,7 @@ /**

var navigationObserver = new PerformanceObserver(function (list) {
list.getEntries().forEach(function (event) {
if (event.entryType === NAVIGATION) {
_this.performanceNavigationEventHandlerTimingLevel2(event);
}
list.getEntries()
.filter(function (e) { return e.entryType === NAVIGATION; })
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {
_this.performanceNavigationEventHandlerTimingLevel2(event);
});

@@ -189,2 +202,3 @@ });

};
_this.config = __assign(__assign({}, defaultPerformancePluginConfig), config);
return _this;

@@ -229,6 +243,11 @@ }

NavigationPlugin.prototype.onload = function () {
var _this = this;
if (this.enabled) {
if (this.hasTheWindowLoadEventFired()) {
var navData = window.performance.getEntriesByType(NAVIGATION)[0];
this.performanceNavigationEventHandlerTimingLevel2(navData);
window.performance
.getEntriesByType(NAVIGATION)
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {
return _this.performanceNavigationEventHandlerTimingLevel2(event);
});
}

@@ -235,0 +254,0 @@ else {

import { InternalPlugin } from '../InternalPlugin';
import { ResourceType } from '../../utils/common-utils';
import { PartialPerformancePluginConfig } from '../utils/performance-utils';
export declare const RESOURCE_EVENT_PLUGIN_ID = "resource";
export declare type PartialResourcePluginConfig = {
eventLimit?: number;
recordAllTypes?: ResourceType[];
sampleTypes?: ResourceType[];
};
export declare type ResourcePluginConfig = {
eventLimit: number;
recordAllTypes: ResourceType[];
sampleTypes: ResourceType[];
};
export declare const defaultConfig: {
eventLimit: number;
recordAllTypes: ResourceType[];
sampleTypes: ResourceType[];
};
/**

@@ -24,3 +9,3 @@ * This plugin records resource performance timing events generated during every page load/re-load.

private config;
constructor(config?: PartialResourcePluginConfig);
constructor(config?: PartialPerformancePluginConfig);
enable(): void;

@@ -27,0 +12,0 @@ disable(): void;

@@ -28,17 +28,8 @@ var __extends = (this && this.__extends) || (function () {

import { InternalPlugin } from '../InternalPlugin';
import { getResourceFileType, ResourceType, shuffle } from '../../utils/common-utils';
import { getResourceFileType, shuffle } from '../../utils/common-utils';
import { PERFORMANCE_RESOURCE_EVENT_TYPE } from '../utils/constant';
import { defaultPerformancePluginConfig } from '../utils/performance-utils';
export var RESOURCE_EVENT_PLUGIN_ID = 'resource';
var RESOURCE = 'resource';
var LOAD = 'load';
export var defaultConfig = {
eventLimit: 10,
recordAllTypes: [ResourceType.DOCUMENT, ResourceType.SCRIPT],
sampleTypes: [
ResourceType.STYLESHEET,
ResourceType.IMAGE,
ResourceType.FONT,
ResourceType.OTHER
]
};
/**

@@ -58,2 +49,3 @@ * This plugin records resource performance timing events generated during every page load/re-load.

.filter(function (e) { return e.entryType === RESOURCE; })
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {

@@ -77,3 +69,5 @@ // Out of n resource events, x events are recorded using Observer API

if (events !== undefined && events.length > 0) {
events.forEach(function (event) {
events
.filter(function (e) { return !_this.config.ignore(e); })
.forEach(function (event) {
var type = getResourceFileType(event.name);

@@ -126,3 +120,3 @@ if (_this.config.recordAllTypes.includes(type)) {

};
_this.config = __assign(__assign({}, defaultConfig), config);
_this.config = __assign(__assign({}, defaultPerformancePluginConfig), config);
return _this;

@@ -129,0 +123,0 @@ }

import { InternalPlugin } from '../InternalPlugin';
import { PartialPerformancePluginConfig } from '../utils/performance-utils';
export declare const NAVIGATION_EVENT_PLUGIN_ID = "navigation";

@@ -9,3 +10,4 @@ /**

export declare class NavigationPlugin extends InternalPlugin {
constructor();
private config;
constructor(config?: PartialPerformancePluginConfig);
enable(): void;

@@ -39,3 +41,3 @@ disable(): void;

*/
performanceNavigationEventHandlerTimingLevel2: (entryData: any) => void;
performanceNavigationEventHandlerTimingLevel2: (entryData: PerformanceNavigationTiming) => void;
/**

@@ -42,0 +44,0 @@ * loadEventEnd is populated as 0 if the web page has not loaded completely, even though LOAD has been fired.

import { InternalPlugin } from '../InternalPlugin';
import { ResourceType } from '../../utils/common-utils';
import { PartialPerformancePluginConfig } from '../utils/performance-utils';
export declare const RESOURCE_EVENT_PLUGIN_ID = "resource";
export declare type PartialResourcePluginConfig = {
eventLimit?: number;
recordAllTypes?: ResourceType[];
sampleTypes?: ResourceType[];
};
export declare type ResourcePluginConfig = {
eventLimit: number;
recordAllTypes: ResourceType[];
sampleTypes: ResourceType[];
};
export declare const defaultConfig: {
eventLimit: number;
recordAllTypes: ResourceType[];
sampleTypes: ResourceType[];
};
/**

@@ -24,3 +9,3 @@ * This plugin records resource performance timing events generated during every page load/re-load.

private config;
constructor(config?: PartialResourcePluginConfig);
constructor(config?: PartialPerformancePluginConfig);
enable(): void;

@@ -27,0 +12,0 @@ disable(): void;

{
"name": "aws-rum-web",
"version": "1.13.7",
"version": "1.14.0",
"sideEffects": false,

@@ -59,4 +59,3 @@ "description": "The Amazon CloudWatch RUM web client.",

"smoke:local": "cross-env URL=$URL MONITOR_ID=$MONITOR ENDPOINT=$ENDPOINT NAME=$NAME VERSION=$npm_package_version npx playwright test --config=playwright.local.config.ts --headed",
"smoke": "cross-env URL=$URL MONITOR_ID=$MONITOR ENDPOINT=$ENDPOINT NAME=$NAME VERSION=$npm_package_version npx playwright test --config=playwright.config.ts --headed",
"smoke:headless": "cross-env URL=$URL MONITOR_ID=$MONITOR ENDPOINT=$ENDPOINT NAME=$NAME VERSION=$npm_package_version npx playwright test --config=playwright.config.ts",
"smoke:headless": "cross-env URL=$URL MONITOR_ID=$MONITOR ENDPOINT=$ENDPOINT NAME=$NAME VERSION=$npm_package_version INSTALL_METHOD=$INSTALL_METHOD npx playwright test --config=playwright.config.ts",
"prepare": "husky install"

@@ -96,3 +95,3 @@ },

"jest-mock-random": "^1.1.1",
"jsdom": "^16.4.0",
"jsdom": "^21.1.1",
"json-schema-to-typescript": "^11.0.2",

@@ -104,3 +103,3 @@ "lint-staged": "^13.0.3",

"npm-run-all": "^4.1.5",
"prettier": "2.8.1",
"prettier": "2.8.4",
"standard-version": "^9.3.2",

@@ -131,3 +130,3 @@ "testcafe": "^2.0.1",

"shimmer": "^1.2.1",
"ua-parser-js": "^0.7.23",
"ua-parser-js": "^1.0.33",
"uuid": "^9.0.0",

@@ -134,0 +133,0 @@ "web-vitals": "^3.0.2"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc