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

@shopify/performance

Package Overview
Dependencies
Maintainers
25
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 4.0.0 to 4.1.0

14

build/cjs/performance.js

@@ -38,2 +38,3 @@ 'use strict';

utilities.withTiming(({
responseEnd,
domContentLoadedEventStart,

@@ -49,2 +50,7 @@ loadEventStart

this.lifecycleEvent({
type: types.EventType.TimeToLastByte,
start: responseEnd - this.timeOrigin,
duration: 0
});
this.lifecycleEvent({
type: types.EventType.DomContentLoaded,

@@ -62,2 +68,10 @@ start: domContentLoadedEventStart - this.timeOrigin,

utilities.withEntriesOfType('navigation', entry => {
if (entry.responseEnd > 0) {
this.lifecycleEvent({
type: types.EventType.TimeToLastByte,
start: entry.responseEnd,
duration: 0
});
}
if (entry.domContentLoadedEventStart > 0) {

@@ -64,0 +78,0 @@ this.lifecycleEvent({

1

build/cjs/types.js

@@ -9,2 +9,3 @@ 'use strict';

EventType["TimeToFirstByte"] = "ttfb";
EventType["TimeToLastByte"] = "ttlb";
EventType["TimeToFirstPaint"] = "ttfp";

@@ -11,0 +12,0 @@ EventType["TimeToFirstContentfulPaint"] = "ttfcp";

export declare enum EventType {
TimeToFirstByte = "ttfb",
TimeToLastByte = "ttlb",
TimeToFirstPaint = "ttfp",

@@ -29,2 +30,8 @@ TimeToFirstContentfulPaint = "ttfcp",

}
export interface TimeToLastByteEvent extends BasicEvent {
type: EventType.TimeToLastByte;
metadata?: {
[key: string]: any;
};
}
export interface TimeToFirstPaintEvent extends BasicEvent {

@@ -88,6 +95,7 @@ type: EventType.TimeToFirstPaint;

}
export type LifecycleEvent = TimeToFirstByteEvent | TimeToFirstPaintEvent | TimeToFirstContentfulPaintEvent | TimeToLargestContentfulPaintEvent | DomContentLoadedEvent | FirstInputDelayEvent | LoadEvent;
export type LifecycleEvent = TimeToFirstByteEvent | TimeToLastByteEvent | TimeToFirstPaintEvent | TimeToFirstContentfulPaintEvent | TimeToLargestContentfulPaintEvent | DomContentLoadedEvent | FirstInputDelayEvent | LoadEvent;
export type Event = LifecycleEvent | LongTaskEvent | ScriptDownloadEvent | StyleDownloadEvent | GraphQLEvent | UsableEvent | CustomEvent;
export interface EventMap {
[EventType.TimeToFirstByte]: TimeToFirstByteEvent;
[EventType.TimeToLastByte]: TimeToLastByteEvent;
[EventType.TimeToFirstPaint]: TimeToFirstPaintEvent;

@@ -94,0 +102,0 @@ [EventType.TimeToFirstContentfulPaint]: TimeToFirstContentfulPaintEvent;

2

package.json
{
"name": "@shopify/performance",
"version": "4.0.0",
"version": "4.1.0",
"license": "MIT",

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

@@ -123,3 +123,3 @@ # `@shopify/performance`

##### Largest Contentful Paint (`EventType.TimeToFirstContentfulPaint`)
##### Largest Contentful Paint (`EventType.TimeToLargestContentfulPaint`)

@@ -126,0 +126,0 @@ The render time of the largest image or text block visible within the viewport, relative to when the page first started loading.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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