Skip to content

Commit

Permalink
add computeRoute export (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaslins authored Dec 5, 2023
1 parent fb1b4c5 commit 3bda500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/web/src/generic.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { name as packageName, version } from '../package.json';
import { initQueue } from './queue';
import type { SpeedInsightsProps } from './types';
import { isBrowser, isDevelopment } from './utils';
import { isBrowser, isDevelopment, computeRoute } from './utils';

const DEV_SCRIPT_URL = `https://va.vercel-scripts.com/v1/speed-insights/script.debug.js`;
const SCRIPT_URL = `/_vercel/speed-insights/script.js`;
Expand Down Expand Up @@ -76,10 +76,11 @@ function injectSpeedInsights(
};
}

export { injectSpeedInsights };
export { injectSpeedInsights, computeRoute };
export type { SpeedInsightsProps };

// eslint-disable-next-line import/no-default-export -- Allow default export
export default {
injectSpeedInsights,
computeRoute,
};
4 changes: 3 additions & 1 deletion packages/web/src/react/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import { useEffect, useRef } from 'react';
import type { SpeedInsightsProps } from '../types';
import { injectSpeedInsights } from '../generic';
import { computeRoute, injectSpeedInsights } from '../generic';

export function SpeedInsights(
props: SpeedInsightsProps & {
Expand All @@ -25,3 +25,5 @@ export function SpeedInsights(

return null;
}

export { computeRoute };

4 comments on commit 3bda500

@vercel
Copy link

@vercel vercel bot commented on 3bda500 Dec 5, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 3bda500 Dec 5, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 3bda500 Dec 5, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 3bda500 Dec 5, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.