Skip to content

Commit 342d1ef

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 200b95c commit 342d1ef

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
@@ -439,16 +439,6 @@ See documentation: ${createDocumentationLink({
439439
return this;
440440
}
441441

442-
// @major we shipped with EXPERIMENTAL_use, but have changed that to just `use` now
443-
public EXPERIMENTAL_use(...middleware: Middleware[]): this {
444-
warning(
445-
false,
446-
'The middleware API is now considered stable, so we recommend replacing `EXPERIMENTAL_use` with `use` before upgrading to the next major version.'
447-
);
448-
449-
return this.use(...middleware);
450-
}
451-
452442
/**
453443
* Adds a widget to the search instance.
454444
* 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)