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

Migrate package to @dropbox scope! #42

Merged
merged 2 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# `ttvc`

<p>
<img src="https://img.shields.io/npm/v/@dropbox-performance/ttvc"/>
<img src="https://img.shields.io/npm/dt/@dropbox-performance/ttvc"/>
<img src="https://img.shields.io/bundlephobia/minzip/@dropbox-performance/ttvc"/>
<img src="https://img.shields.io/bundlephobia/min/@dropbox-performance/ttvc"/>
<img src="https://img.shields.io/npm/v/@dropbox/ttvc"/>
<img src="https://img.shields.io/npm/dt/@dropbox/ttvc"/>
<img src="https://img.shields.io/bundlephobia/minzip/@dropbox/ttvc"/>
<img src="https://img.shields.io/bundlephobia/min/@dropbox/ttvc"/>
</p>

- [Overview](#overview)
Expand Down Expand Up @@ -35,19 +35,19 @@ Visually Complete measures the moment in time when users perceive that all the v
This library is available from npm. Add it to your project using the `npm` or `yarn` package managers.

```
$ npm install @dropbox-performance/ttvc
$ npm install @dropbox/ttvc
```

```
$ yarn add @dropbox-performance/ttvc
$ yarn add @dropbox/ttvc
```

## Usage

### Basic usage

```js
import {init, getTTVC} from '@dropbox-performance/ttvc';
import {init, getTTVC} from '@dropbox/ttvc';

// Call this as early in pageload as possible to setup instrumentation.
init({
Expand All @@ -66,7 +66,7 @@ const unsubscribe = getTTVC((measurement) => {
### Report metrics to a collection endpoint

```js
import {init, getTTVC} from '@dropbox-performance/ttvc';
import {init, getTTVC} from '@dropbox/ttvc';

init();

Expand All @@ -93,7 +93,7 @@ Capture a span using the [Performance Timeline](https://developer.mozilla.org/en
NOTE: Setting arbitrary start and end times with `performance.measure` relies on the [User Timing Level 3](https://w3c.github.io/user-timing/) specification. This is not yet adopted by all major browsers.

```js
import {init, getTTVC} from '@dropbox-performance/ttvc';
import {init, getTTVC} from '@dropbox/ttvc';

init();

Expand All @@ -109,15 +109,15 @@ getTTVC(({start, end, duration, detail}: Metric) => {

### Client-side navigation with React Router

@dropbox-performance/ttvc supports measuring client-side navigations!
@dropbox/ttvc supports measuring client-side navigations!

What counts as navigation may be different in each application, but as long as you signal that a navigation has begun, this library can figure out the rest.

To trigger a new navigation measurement, simply dispatch a "locationchange" event on the window object.

```js
// analytics.js
import {init, getTTVC} from '@dropbox-performance/ttvc';
import {init, getTTVC} from '@dropbox/ttvc';

init();

Expand Down Expand Up @@ -248,7 +248,7 @@ window.fetch = (...args) => {

## Browser Support

`@dropbox-performance/ttvc` relies on the following browser features.
`@dropbox/ttvc` relies on the following browser features.

- [ES6 syntax](https://262.ecma-international.org/6.0/)
- [async/await syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@dropbox-performance/ttvc",
"name": "@dropbox/ttvc",
"version": "0.1.0",
"description": "Measure Visually Complete metrics in real time",
"repository": "git@github.com:dropbox/ttvc.git",
Expand Down