Skip to content

Commit b84a2ea

Browse files
committed
fix(instantsearch): remove EXPERIMENTAL_use (#6401)
Instead you can use `use` to add a middleware BREAKING CHANGE: EXPERIMENTAL_use function is replaced with use function
1 parent f1021c4 commit b84a2ea

File tree

3 files changed

+0
-34
lines changed

3 files changed

+0
-34
lines changed

packages/instantsearch.js/src/lib/InstantSearch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,6 @@ See documentation: ${createDocumentationLink({
452452
return this;
453453
}
454454

455-
// @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now
456-
public EXPERIMENTAL_use(...middleware: Middleware[]): this {
457-
warning(
458-
false,
459-
'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.'
460-
);
461-
462-
return this.use(...middleware);
463-
}
464-
465455
/**
466456
* Adds a widget to the search instance.
467457
* A widget can be added either before or after InstantSearch has started.

packages/instantsearch.js/src/lib/__tests__/InstantSearch-test.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -294,29 +294,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/instantsear
294294
`);
295295
});
296296

297-
it('warns dev with EXPERIMENTAL_use', () => {
298-
const searchClient = createSearchClient({
299-
addAlgoliaAgent: jest.fn(),
300-
});
301-
302-
const search = new InstantSearch({
303-
indexName: 'indexName',
304-
searchClient,
305-
});
306-
307-
const middleware = () => ({
308-
onStateChange: () => {},
309-
subscribe: () => {},
310-
unsubscribe: () => {},
311-
});
312-
313-
expect(() => {
314-
search.EXPERIMENTAL_use(middleware);
315-
}).toWarnDev(
316-
'[InstantSearch.js]: The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.'
317-
);
318-
});
319-
320297
it('does not warn dev with use', () => {
321298
const searchClient = createSearchClient({
322299
addAlgoliaAgent: jest.fn(),

packages/instantsearch.js/test/createInstantSearch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export const createInstantSearch = (
5959
removeWidget: jest.fn(),
6060
removeWidgets: jest.fn(),
6161
use: jest.fn(),
62-
EXPERIMENTAL_use: jest.fn(),
6362
unuse: jest.fn(),
6463
// methods from EventEmitter
6564
addListener: jest.fn(),

0 commit comments

Comments
 (0)