Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(version): bump algoliasearch version to v4.11.0 #4939

Merged
merged 5 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ To run the test continuously based on what you changed (useful when developing o
yarn test --watch
```

### Type checks

Type checks ensure code is correctly typed both for code quality and TypeScript compatibility.

To ensure typing is correct in the latest version of InstantSearch.js, you can run the following command:

```sh
yarn type-check
```

Since we still support `algoliasearch@3`, you should also type check against v3.x.

```sh
yarn remove @algolia/client-search
yarn add @types/algoliasearch@3.34.10 algoliasearch@3.35.1
yarn type-check:v3
```

## Linting

Linters are static checkers for code. They help us maintain a consistent code base. They are used for JavaScript and TypeScript files.
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ npm install instantsearch.js algoliasearch
yarn add instantsearch.js algoliasearch
```

### TypeScript users

To use InstantSearch.js in a TypeScript environment, depending on your [`algoliasearch`](https://github.com/algolia/algoliasearch-client-javascript) version, you need to import different types.

>You still need to import these types even if you don't use InstantSearch.js with [`algoliasearch`](https://github.com/algolia/algoliasearch-client-javascript).

#### `algoliasearch` v4.x

This version uses types provided by both `algoliasearch` and `@algolia/client-search`.

```bash
yarn add algoliasearch@4 @algolia/client-search
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yarn add algoliasearch@4 @algolia/client-search
yarn add algoliasearch@4 && yarn add @algolia/client-search -D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why dev dependency for that one? it's a "peer" (actually usually you won't need to rely on it manually as it's a dependency of algoliasearch), but a normal dependency would be fine imo

Copy link
Member

@sarahdayan sarahdayan Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually keep all non-runtime dependencies as dev dependencies. Not a blocker in front-end anyway, people can choose how they prefer.

Feel free to ignore.

```

#### `algoliasearch` v3.x

```bash
yarn add @types/algoliasearch@3
```

>v3.x is deprecated and will soon no longer be supported.

## Documentation

The documentation is available on the [Algolia website](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/).
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"search-insights": "^2.0.5"
},
"devDependencies": {
"@algolia/client-search": "4.10.3",
"@algolia/client-search": "4.11.0",
"@babel/cli": "7.8.4",
"@babel/core": "7.9.6",
"@babel/plugin-proposal-class-properties": "7.8.3",
Expand Down Expand Up @@ -95,7 +95,7 @@
"@wdio/selenium-standalone-service": "5.16.5",
"@wdio/spec-reporter": "5.16.5",
"@wdio/static-server-service": "5.16.5",
"algoliasearch": "4.10.3",
"algoliasearch": "4.11.0",
"algoliasearch-v3": "npm:algoliasearch@3.35.1",
"babel-eslint": "10.0.3",
"babel-jest": "27.1.0",
Expand Down
12 changes: 6 additions & 6 deletions src/connectors/geo-search/__tests__/connectGeoSearch-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
}),
]);

// @ts-expect-error connector uses strings
// @ts-ignore
helper.setQueryParameter('insideBoundingBox', '10,12,14,16');

widget.init!(
Expand Down Expand Up @@ -660,7 +660,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
}),
]);

// @ts-expect-error connector uses strings
// @ts-ignore
sarahdayan marked this conversation as resolved.
Show resolved Hide resolved
helper.setQueryParameter('insideBoundingBox', '10,12,14,16');

widget.init!(
Expand Down Expand Up @@ -696,7 +696,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
expect(lastRenderArgs(render).hasMapMoveSinceLastRefine()).toBe(true);
expect(lastRenderArgs(render).isRefinedWithMap()).toBe(true);

// @ts-expect-error connector uses strings
// @ts-ignore
helper.setQueryParameter('insideBoundingBox', '12,14,16,18');

widget.render!(
Expand All @@ -721,7 +721,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
const helper = createFakeHelper();

// Simulate the configuration or external setter (like URLSync)
// @ts-expect-error connector uses strings
// @ts-ignore
helper.setQueryParameter('insideBoundingBox', '10,12,12,14');

widget.init!(
Expand Down Expand Up @@ -1342,7 +1342,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
const widget = customGeoSearch({});
const helper = createFakeHelper();

// @ts-expect-error connector uses strings
// @ts-ignore
helper.setQueryParameter('insideBoundingBox', '10,12,12,14');

const expectation = new SearchParameters({ index: '' });
Expand Down Expand Up @@ -1562,7 +1562,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
it('gives all render functions with refinement', () => {
const [widget, helper] = getInitializedWidget();
helper.setQueryParameter('aroundLatLng', '10, 12');
// @ts-expect-error connector uses strings
// @ts-ignore
helper.setQueryParameter('insideBoundingBox', '10,12,11,2');

expect(
Expand Down
1 change: 0 additions & 1 deletion src/connectors/geo-search/connectGeoSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ const connectGeoSearch: GeoSearchConnector = (renderFn, unmountFn = noop) => {
undefined
);
}

return setBoundingBoxAsString(
searchParameters,
uiState.geoSearch.boundingBox
Haroenv marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/geo-search/__tests__/geo-search-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
// Simulate the current refinement
helper.setQueryParameter(
'insideBoundingBox',
// @ts-expect-error class uses strings
// @ts-ignore
'48.84174222399724, 2.367719162523599, 48.81614630305218, 2.284205902635904'
);

Expand Down
Loading