Skip to content

Commit 98b334e

Browse files
Fix linting + Add license for next.js + Remove version from nextjs package json
1 parent 9f7a9d1 commit 98b334e

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

LICENSE-3rdparty.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dev,karma-spec-reporter,MIT,Copyright 2015 Michael Lex
5757
dev,karma-webpack,MIT,Copyright JS Foundation and other contributors
5858
dev,lerna,MIT,Copyright 2015-present Lerna Contributors
5959
dev,minimatch,ISC,Copyright (c) Isaac Z. Schlueter and Contributors
60+
dev,next,MIT,Copyright (c) 2025 Vercel, Inc.
6061
dev,node-forge,BSD,Copyright (c) 2010, Digital Bazaar, Inc.
6162
dev,pako,MIT,(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
6263
dev,prettier,MIT,Copyright James Long and contributors

packages/rum-nextjs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "@datadog/browser-rum-nextjs",
3-
"version": "0.0.1",
43
"license": "Apache-2.0",
54
"main": "cjs/entries/main.js",
65
"module": "esm/entries/main.js",

packages/rum-nextjs/src/domain/appRouter/datadogRumProvider.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { computeViewNameFromParams } from '../computeViewNameFromParams'
66
import { startNextjsView } from '../startNextjsView'
77

88
/**
9+
* Tracks Next.js App Router views via `usePathname` and `useParams`.
10+
*
911
* @example
1012
* ```tsx
1113
* // app/components/datadog-rum-provider.tsx

packages/rum-nextjs/src/domain/computeViewNameFromParams.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export function computeViewNameFromParams(
1717
})
1818

1919
for (const [paramName, paramValue] of sortedParams) {
20-
if (paramValue === undefined) continue
20+
if (paramValue === undefined) {
21+
continue
22+
}
2123

2224
if (Array.isArray(paramValue)) {
2325
const joinedValue = paramValue.join('/')

packages/rum-nextjs/src/domain/error/reportNextjsError.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { RelativeTime, TimeStamp } from '@datadog/browser-core'
2-
import { clocksNow, generateUUID } from '@datadog/browser-core'
2+
import { clocksNow, generateUUID, noop } from '@datadog/browser-core'
33
import type { RumInitConfiguration, RumPublicApi } from '@datadog/browser-rum-core'
44
import { RumEventType } from '@datadog/browser-rum-core'
55
import { registerCleanupTask, replaceMockable } from '../../../../core/test'
@@ -24,7 +24,7 @@ describe('reportNextjsError', () => {
2424
const error = new Error('Test error')
2525
;(error as any).digest = 'abc123'
2626

27-
reportNextjsError(error, () => {})
27+
reportNextjsError(error, noop)
2828

2929
expect(addEventSpy).toHaveBeenCalledOnceWith(
3030
FAKE_RELATIVE_TIME,
@@ -77,7 +77,7 @@ describe('reportNextjsError', () => {
7777
const addEventSpy = jasmine.createSpy()
7878
initializeNextjsPlugin({ addEvent: addEventSpy })
7979

80-
reportNextjsError(new Error('test'), () => {})
80+
reportNextjsError(new Error('test'), noop)
8181

8282
const event = addEventSpy.calls.mostRecent().args[1]
8383
expect(event.context.router).toBe('app')
@@ -107,7 +107,7 @@ describe('reportNextjsError', () => {
107107
const addEventSpy = jasmine.createSpy()
108108
initializeNextjsPlugin({ addEvent: addEventSpy })
109109

110-
reportNextjsError(new Error('test'), () => {})
110+
reportNextjsError(new Error('test'), noop)
111111

112112
const event = addEventSpy.calls.mostRecent().args[1]
113113
expect(event.context.digest).toBeUndefined()
@@ -116,7 +116,7 @@ describe('reportNextjsError', () => {
116116
it('queues the error if RUM has not started yet', () => {
117117
const addEventSpy = jasmine.createSpy()
118118

119-
reportNextjsError(new Error('queued error'), () => {})
119+
reportNextjsError(new Error('queued error'), noop)
120120

121121
expect(addEventSpy).not.toHaveBeenCalled()
122122

packages/rum-nextjs/src/domain/pagesRouter/datadogRumProvider.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { useRouter } from 'next/router'
55
import { startNextjsView } from '../startNextjsView'
66

77
/**
8+
* Tracks Next.js Pages Router views via `router.events`.
9+
*
810
* @example
911
* ```tsx
1012
* // pages/_app.tsx

0 commit comments

Comments
 (0)