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

fix(ts): don't require every attribute to be highlighted #1234

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Nov 25, 2020

we didn't notice this earlier, since in InstantSearch.js we didn't yet update to the version of algoliasearch including the highlighting. The type in algoliasearch is better than the one in InstantSearch though, so we can find a way to switch in the future

Haroenv added a commit to algolia/instantsearch that referenced this pull request Nov 25, 2020
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0a2581e:

Sandbox Source
javascript-client-app Configuration

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

Nice

@Haroenv Haroenv merged commit 4591d0e into master Nov 25, 2020
@Haroenv Haroenv deleted the fix/ts-highlight branch November 25, 2020 21:44
Haroenv added a commit to algolia/instantsearch that referenced this pull request Nov 30, 2020
Basically we had two methods to turn a number (or string) into a precision:

1. Math.floor(min * pow) / pow
2. Number(Number(v).toFixed(precision))

these behave different for precision 0 & a number over .5, let's say 1.5 turns into 1 for method 1, and into 2 for method 2. This is a bug (not caught by most of our tests, notably the ones i had to change) and causes the range to change to a number it's not supposed to be. Pay special attention to the new `toPrecision` utility, and the places it was used.

At the same time I also converted to TypeScript, but not the components themselves, since that was too much work.

typescript for tests is expected to fail until algolia/algoliasearch-client-javascript#1229 is released (since now certain parts aren't random objects, but rather search responses)

The version for the helper is bumped for better typescript support as well.

update types

requires algolia/algoliasearch-client-javascript#1234

update client for fix in typing for tests

update assertions in changed tests

clarify why behaviour is like it is
Haroenv added a commit to algolia/instantsearch that referenced this pull request Dec 2, 2020
* fix(range): consistently convert min & max to numbers

Basically we had two methods to turn a number (or string) into a precision:

1. Math.floor(min * pow) / pow
2. Number(Number(v).toFixed(precision))

these behave different for precision 0 & a number over .5, let's say 1.5 turns into 1 for method 1, and into 2 for method 2. This is a bug (not caught by most of our tests, notably the ones i had to change) and causes the range to change to a number it's not supposed to be. Pay special attention to the new `toPrecision` utility, and the places it was used.

At the same time I also converted to TypeScript, but not the components themselves, since that was too much work.

typescript for tests is expected to fail until algolia/algoliasearch-client-javascript#1229 is released (since now certain parts aren't random objects, but rather search responses)

The version for the helper is bumped for better typescript support as well.

update types

requires algolia/algoliasearch-client-javascript#1234

update client for fix in typing for tests

update assertions in changed tests

clarify why behaviour is like it is

* address feedback

* integrate fix from the helper avoiding workaround here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants