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

@shopify/performance

Package Overview
Dependencies
Maintainers
13
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/performance - npm Package Compare versions

Comparing version 1.1.8 to 1.2.0

10

CHANGELOG.md

@@ -8,4 +8,12 @@ # Changelog

## [Unreleased]
## [1.2.0] - 2019-10-03
### Changed
- Updated the README to include instructions on cleaning up listeners from `performance.on` [[#1081](https://github.com/Shopify/quilt/pull/1081)
## Added
- Added a new API `mark` to the `Performance` class. This encapsulates both checking for `supportsMarks` and calling `window.performance.mark` into one call. [[#1083]](https://github.com/Shopify/quilt/pull/1083/files)
## [1.1.2] - 2019-03-27

@@ -12,0 +20,0 @@

@@ -25,2 +25,3 @@ import { Navigation } from './navigation';

constructor();
mark(stage: string, id: string): void;
on<T extends keyof EventMap>(event: T, handler: EventMap[T]): () => boolean;

@@ -27,0 +28,0 @@ event(event: Event, { replace }?: {

@@ -127,2 +127,7 @@ "use strict";

}
Performance.prototype.mark = function (stage, id) {
if (this.supportsMarks) {
window.performance.mark(id + "::" + stage);
}
};
Performance.prototype.on = function (event, handler) {

@@ -129,0 +134,0 @@ var e_1, _a;

2

package.json
{
"name": "@shopify/performance",
"version": "1.1.8",
"version": "1.2.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Primitives for collecting browser performance metrics.",

@@ -47,2 +47,10 @@ # `@shopify/performance`

The `on` method returns a clean-up function that you can invoke when you're done listening on the event:
```ts
const cleanupNavigationListener = performance.on('navigation', navigation => {});
cleanupNavigationListener();
```
You can also manage navigations using this object. Calling `performance.start()` will begin a new navigation, cancelling any that are currently inflight. `performance.event()` allows you to register custom events on the navigation. Finally, `performance.finish()` marks the navigation is complete.

@@ -49,0 +57,0 @@

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