Skip to content

Commit 3840673

Browse files
committed
fix(widgets): remove analytics widget (#6398)
* fix(widgets): remove analytics widget The analytics widget has long been deprecated, and is removed with the insights middleware as alternative. You can use the `onEvent` hook to use a different service. BREAKING CHANGE: the analytics widget no longer exists * !fixup stories
1 parent 09540a4 commit 3840673

File tree

7 files changed

+1
-357
lines changed

7 files changed

+1
-357
lines changed

packages/instantsearch.js/src/types/render-state.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import type { SortByWidgetDescription } from '../connectors/sort-by/connectSortB
2323
import type { StatsWidgetDescription } from '../connectors/stats/connectStats';
2424
import type { ToggleRefinementWidgetDescription } from '../connectors/toggle-refinement/connectToggleRefinement';
2525
import type { VoiceSearchWidgetDescription } from '../connectors/voice-search/connectVoiceSearch';
26-
import type { AnalyticsWidgetDescription } from '../widgets/analytics/analytics';
2726
import type { PlacesWidgetDescription } from '../widgets/places/places';
2827

2928
type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] &
@@ -52,8 +51,7 @@ type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] &
5251
ToggleRefinementWidgetDescription['indexRenderState'] &
5352
VoiceSearchWidgetDescription['indexRenderState'];
5453

55-
type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] &
56-
PlacesWidgetDescription['indexRenderState'];
54+
type WidgetRenderStates = PlacesWidgetDescription['indexRenderState'];
5755

5856
export type IndexRenderState = Partial<
5957
ConnectorRenderStates & WidgetRenderStates

packages/instantsearch.js/src/types/widget.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export type DisposeOptions = {
5656

5757
// @MAJOR: Remove these exported types if we don't need them
5858
export type BuiltinTypes =
59-
| 'ais.analytics'
6059
| 'ais.answers'
6160
| 'ais.autocomplete'
6261
| 'ais.breadcrumb'
@@ -95,7 +94,6 @@ export type BuiltinTypes =
9594
| 'ais.voiceSearch';
9695

9796
export type BuiltinWidgetTypes =
98-
| 'ais.analytics'
9997
| 'ais.answers'
10098
| 'ais.autocomplete'
10199
| 'ais.breadcrumb'

packages/instantsearch.js/src/widgets/__tests__/index.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ function initiateAllWidgets(): Array<[WidgetNames, Widget | IndexWidget]> {
100100
items: [{ label: 'x', value: 'x' }],
101101
});
102102
}
103-
case 'analytics': {
104-
const analytics = widget as Widgets['analytics'];
105-
return analytics({
106-
pushFunction() {},
107-
});
108-
}
109103
case 'queryRuleContext': {
110104
const queryRuleContext = widget as Widgets['queryRuleContext'];
111105
return queryRuleContext({

packages/instantsearch.js/src/widgets/analytics/__tests__/analytics-test.ts

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

packages/instantsearch.js/src/widgets/analytics/analytics.ts

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

packages/instantsearch.js/src/widgets/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const EXPERIMENTAL_dynamicWidgets = deprecate(
2323
);
2424
export { dynamicWidgets };
2525

26-
export { default as analytics } from './analytics/analytics';
2726
export { default as breadcrumb } from './breadcrumb/breadcrumb';
2827
export { default as clearRefinements } from './clear-refinements/clear-refinements';
2928
export { default as configure } from './configure/configure';

0 commit comments

Comments
 (0)