Skip to content

Commit

Permalink
fix(widgets): remove analytics widget (#6398)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Haroenv committed Oct 18, 2024
1 parent 09540a4 commit 3840673
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 357 deletions.
4 changes: 1 addition & 3 deletions packages/instantsearch.js/src/types/render-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import type { SortByWidgetDescription } from '../connectors/sort-by/connectSortB
import type { StatsWidgetDescription } from '../connectors/stats/connectStats';
import type { ToggleRefinementWidgetDescription } from '../connectors/toggle-refinement/connectToggleRefinement';
import type { VoiceSearchWidgetDescription } from '../connectors/voice-search/connectVoiceSearch';
import type { AnalyticsWidgetDescription } from '../widgets/analytics/analytics';
import type { PlacesWidgetDescription } from '../widgets/places/places';

type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] &
Expand Down Expand Up @@ -52,8 +51,7 @@ type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'] &
ToggleRefinementWidgetDescription['indexRenderState'] &
VoiceSearchWidgetDescription['indexRenderState'];

type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState'] &
PlacesWidgetDescription['indexRenderState'];
type WidgetRenderStates = PlacesWidgetDescription['indexRenderState'];

export type IndexRenderState = Partial<
ConnectorRenderStates & WidgetRenderStates
Expand Down
2 changes: 0 additions & 2 deletions packages/instantsearch.js/src/types/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export type DisposeOptions = {

// @MAJOR: Remove these exported types if we don't need them
export type BuiltinTypes =
| 'ais.analytics'
| 'ais.answers'
| 'ais.autocomplete'
| 'ais.breadcrumb'
Expand Down Expand Up @@ -95,7 +94,6 @@ export type BuiltinTypes =
| 'ais.voiceSearch';

export type BuiltinWidgetTypes =
| 'ais.analytics'
| 'ais.answers'
| 'ais.autocomplete'
| 'ais.breadcrumb'
Expand Down
6 changes: 0 additions & 6 deletions packages/instantsearch.js/src/widgets/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ function initiateAllWidgets(): Array<[WidgetNames, Widget | IndexWidget]> {
items: [{ label: 'x', value: 'x' }],
});
}
case 'analytics': {
const analytics = widget as Widgets['analytics'];
return analytics({
pushFunction() {},
});
}
case 'queryRuleContext': {
const queryRuleContext = widget as Widgets['queryRuleContext'];
return queryRuleContext({
Expand Down

This file was deleted.

292 changes: 0 additions & 292 deletions packages/instantsearch.js/src/widgets/analytics/analytics.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/instantsearch.js/src/widgets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const EXPERIMENTAL_dynamicWidgets = deprecate(
);
export { dynamicWidgets };

export { default as analytics } from './analytics/analytics';
export { default as breadcrumb } from './breadcrumb/breadcrumb';
export { default as clearRefinements } from './clear-refinements/clear-refinements';
export { default as configure } from './configure/configure';
Expand Down
Loading

0 comments on commit 3840673

Please sign in to comment.