Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lib): exporting metrics by default #197

Merged
merged 1 commit into from
Nov 1, 2018

Conversation

bcabanes
Copy link
Contributor

@bcabanes bcabanes commented Nov 1, 2018

Description

This allows to require metrics easier than before by doing:

const metrics = require('pwmetrics/lib/metrics');

// {
//     TTFCP: "firstContentfulPaint",
//     TTFMP: "firstMeaningfulPaint",
//     TTFCPUIDLE: "firstCPUIdle",
//     TTI: "interactive",
//     SI: "speedIndex"
// }

Contrary to the current way:

const metrics = require('pwmetrics/lib/metrics/metrics');

// {
//     METRICS: {
//         TTFCP: "firstContentfulPaint",
//         TTFMP: "firstMeaningfulPaint",
//         TTFCPUIDLE: "firstCPUIdle",
//         TTI: "interactive",
//         SI: "speedIndex"
//     }
// }

The readme.md and gulpfile.js files have been updated too.

This allows to require metrics easier than before by doing:
```
const metrics = require('pwmetrics/lib/metrics');

// {
//     TTFCP: "firstContentfulPaint",
//     TTFMP: "firstMeaningfulPaint",
//     TTFCPUIDLE: "firstCPUIdle",
//     TTI: "interactive",
//     SI: "speedIndex"
// }
```

Contrary to the current way:
```
const metrics = require('pwmetrics/lib/metrics/metrics');

// {
//     METRICS: {
//         TTFCP: "firstContentfulPaint",
//         TTFMP: "firstMeaningfulPaint",
//         TTFCPUIDLE: "firstCPUIdle",
//         TTI: "interactive",
//         SI: "speedIndex"
//     }
// }
```

The `readme.md` and `gulpfile.js` files have been updated too.
Copy link
Collaborator

@denar90 denar90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niiiiice 💃

@denar90 denar90 merged commit 5b20626 into paulirish:master Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants