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

Group streaming experimental apis #33878

Merged
merged 3 commits into from Feb 2, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/next/client/index.tsx
Expand Up @@ -33,8 +33,11 @@ import measureWebVitals from './performance-relayer'
import { RouteAnnouncer } from './route-announcer'
import { createRouter, makePublicRouterInstance } from './router'
import { getProperError } from '../lib/is-error'
import { flushBufferedVitalsMetrics, trackWebVitalMetric } from './vitals'
import { RefreshContext } from './rsc/refresh'
import {
flushBufferedVitalsMetrics,
trackWebVitalMetric,
} from './streaming/vitals'
import { RefreshContext } from './streaming/refresh'

/// <reference types="react-dom/experimental" />

Expand Down
1 change: 0 additions & 1 deletion packages/next/client/rsc/index.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/next/client/streaming/index.ts
@@ -0,0 +1,2 @@
export { useRefreshRoot as unstable_useRefreshRoot } from './refresh'
export { useWebVitalsReport as unstable_useWebVitalsReport } from './vitals'
@@ -1,5 +1,5 @@
import { useEffect, useRef } from 'react'
import { NextWebVitalsMetric } from '../pages/_app'
import { NextWebVitalsMetric } from '../../pages/_app'

type ReportWebVitalsCallback = (webVitals: NextWebVitalsMetric) => any
export const webVitalsCallbacks = new Set<ReportWebVitalsCallback>()
Expand Down
6 changes: 2 additions & 4 deletions packages/next/package.json
Expand Up @@ -44,10 +44,8 @@
"jest.d.ts",
"amp.js",
"amp.d.ts",
"vitals.js",
"vitals.d.ts",
"rsc.js",
"rsc.d.ts",
"streaming.js",
"streaming.d.ts",
"index.d.ts",
"types/index.d.ts",
"types/global.d.ts",
Expand Down
1 change: 0 additions & 1 deletion packages/next/rsc.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/rsc.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/next/streaming.d.ts
@@ -0,0 +1 @@
export * from './dist/client/streaming'
1 change: 1 addition & 0 deletions packages/next/streaming.js
@@ -0,0 +1 @@
module.exports = require('./dist/client/streaming')
1 change: 0 additions & 1 deletion packages/next/vitals.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/next/vitals.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/integration/relay-analytics-disabled/pages/index.js
@@ -1,4 +1,4 @@
import { getBufferedVitalsMetrics } from 'next/dist/client/vitals'
import { getBufferedVitalsMetrics } from 'next/dist/client/streaming/vitals'

if (typeof navigator !== 'undefined') {
window.__BEACONS = window.__BEACONS || []
Expand Down
4 changes: 2 additions & 2 deletions test/integration/relay-analytics/pages/index.js
@@ -1,6 +1,6 @@
/* global localStorage */
import { unstable_useWebVitalsReport } from 'next/vitals'
import { getBufferedVitalsMetrics } from 'next/dist/client/vitals'
import { unstable_useWebVitalsReport } from 'next/streaming'
import { getBufferedVitalsMetrics } from 'next/dist/client/streaming/vitals'

if (typeof navigator !== 'undefined') {
window.__BEACONS = window.__BEACONS || []
Expand Down