Skip to content

Commit c4e67da

Browse files
authored
Revert "feat: add LocationSensor helper component for next AppRouter and PagesRouter" (#793)
1 parent 5b6cb86 commit c4e67da

File tree

10 files changed

+8
-94
lines changed

10 files changed

+8
-94
lines changed

.changeset/cuddly-grapes-lose.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@knocklabs/client": patch
3+
"@knocklabs/react": patch
4+
---
5+
6+
revert 4b888c4 to remove nextjs helper components and fix module resolution error

packages/client/src/clients/guide/client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export class KnockGuideClient {
341341

342342
cleanup() {
343343
this.unsubscribe();
344-
this.removeLocationChangeEventListeners();
344+
this.removeEventListeners();
345345
this.clearGroupStage();
346346
this.clearCounterInterval();
347347
}
@@ -1144,7 +1144,6 @@ export class KnockGuideClient {
11441144

11451145
// Define as an arrow func property to always bind this to the class instance.
11461146
private handleLocationChange = () => {
1147-
this.knock.log(`[Guide] .handleLocationChange`);
11481147
const win = checkForWindow();
11491148
if (!win?.location) return;
11501149

@@ -1224,7 +1223,7 @@ export class KnockGuideClient {
12241223
}
12251224
}
12261225

1227-
removeLocationChangeEventListeners() {
1226+
private removeEventListeners() {
12281227
const win = checkForWindow();
12291228
if (!win?.history) return;
12301229

packages/react/package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,9 @@
4646
"url": "https://github.com/knocklabs/javascript/issues"
4747
},
4848
"peerDependencies": {
49-
"next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
5049
"react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
5150
"react-dom": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
5251
},
53-
"peerDependenciesMeta": {
54-
"next": {
55-
"optional": true
56-
}
57-
},
5852
"dependencies": {
5953
"@knocklabs/client": "workspace:^",
6054
"@knocklabs/react-core": "workspace:^",
@@ -85,7 +79,6 @@
8579
"eslint-plugin-react-hooks": "^5.2.0",
8680
"eslint-plugin-react-refresh": "^0.4.14",
8781
"jsdom": "^27.0.0",
88-
"next": "15.3.3",
8982
"react": "^19.0.0",
9083
"react-dom": "^19.0.0",
9184
"rimraf": "^6.0.1",

packages/react/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ export {
4444
CardView,
4545
KnockGuideProvider,
4646
GuideToolbar as KnockGuideToolbar,
47-
LocationSensorNextPagesRouter as KnockGuideLocationSensorNextPagesRouter,
48-
LocationSensorNextAppRouter as KnockGuideLocationSensorNextAppRouter,
4947
Modal,
5048
ModalView,
5149
} from "./modules/guide";

packages/react/src/modules/guide/components/LocationSensor/NextAppRouter.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/react/src/modules/guide/components/LocationSensor/NextPagesRouter.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/react/src/modules/guide/components/LocationSensor/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
export { Banner, BannerView } from "./Banner";
22
export { Card, CardView } from "./Card";
33
export { GuideToolbar } from "./GuideToolbar";
4-
export {
5-
LocationSensorNextAppRouter,
6-
LocationSensorNextPagesRouter,
7-
} from "./LocationSensor";
84
export { Modal, ModalView } from "./Modal";

packages/react/src/modules/guide/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ export {
66
Modal,
77
ModalView,
88
GuideToolbar,
9-
LocationSensorNextAppRouter,
10-
LocationSensorNextPagesRouter,
119
} from "./components";
1210
export { KnockGuideProvider } from "./providers";

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,7 +4228,6 @@ __metadata:
42284228
eslint-plugin-react-refresh: "npm:^0.4.14"
42294229
jsdom: "npm:^27.0.0"
42304230
lodash.debounce: "npm:^4.0.8"
4231-
next: "npm:15.3.3"
42324231
react: "npm:^19.0.0"
42334232
react-dom: "npm:^19.0.0"
42344233
rimraf: "npm:^6.0.1"
@@ -4241,12 +4240,8 @@ __metadata:
42414240
vitest: "npm:^3.1.1"
42424241
vitest-axe: "npm:^0.1.0"
42434242
peerDependencies:
4244-
next: ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0
42454243
react: ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
42464244
react-dom: ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
4247-
peerDependenciesMeta:
4248-
next:
4249-
optional: true
42504245
languageName: unknown
42514246
linkType: soft
42524247

0 commit comments

Comments
 (0)