Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: algolia/instantsearch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.24.2
Choose a base ref
...
head repository: algolia/instantsearch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.24.3
Choose a head ref
  • 6 commits
  • 85 files changed
  • 3 contributors

Commits on Jun 30, 2021

  1. refactor(ts): migrate geo components (#4800)

    * refactor(ts): migrate geo components
    
    * update snapshots
    Haroenv authored Jun 30, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d6b6634 View commit details
  2. chore(dependencies): remove prop-types (#4801)

    * refactor(ts): migrate geo components
    
    * update snapshots
    
    * chore(deps): move prop-types to devDep
    
    * chore(test): cast preact-friendly enzyme in one spot
    
    * chore(deps): remove prop-types completely
    Haroenv authored Jun 30, 2021
    Copy the full SHA
    2f5af95 View commit details

Commits on Jul 5, 2021

  1. fix(ts): make template types consistent (#4785)

    * fix(ts): make templates types consistent
    
    * fix: `Answers` type naming
    
    * fix: remove `ComponentTemplates` type utils
    
    * fix: remove unneeded comment
    
    * fix: inline `searchBoxTemplateProps` templates
    
    * fix: remove unneeded casts
    
    * fix: move internal type to widget file
    
    * rename template component type to `RefinementListComponentTemplates`
    
    * fix: make `searchableNoResults` optional
    
    * fix: remove unneeded default template
    
    * fix: type `defaultTemplates`
    
    * fix: apply changes from suggestion
    
    Co-authored-by: Haroen Viaene <hello@haroen.me>
    shortcuts and Haroenv authored Jul 5, 2021
    Copy the full SHA
    e0fbd55 View commit details
  2. fix(dynamicWidgets): read from facetOrdering.facets

    .facet was a typo
    Haroenv committed Jul 5, 2021
    Copy the full SHA
    42d6c6c View commit details
  3. Copy the full SHA
    b70be60 View commit details
  4. chore: release v4.24.3 (#4802)

    Co-authored-by: Haroen Viaene <hello@haroen.me>
    instantsearch-bot and Haroenv authored Jul 5, 2021
    Copy the full SHA
    4d1d0c4 View commit details
Showing with 866 additions and 733 deletions.
  1. +10 −0 CHANGELOG.md
  2. +0 −7 babel.config.js
  3. +4 −6 package.json
  4. +5 −3 src/components/Answers/Answers.tsx
  5. +6 −6 src/components/Breadcrumb/Breadcrumb.tsx
  6. +5 −1 src/components/ClearRefinements/ClearRefinements.tsx
  7. +3 −8 src/components/ClearRefinements/__tests__/ClearRefinements-test.tsx
  8. +0 −23 src/components/GeoSearchControls/GeoSearchButton.js
  9. +23 −0 src/components/GeoSearchControls/GeoSearchButton.tsx
  10. +0 −108 src/components/GeoSearchControls/GeoSearchControls.js
  11. +110 −0 src/components/GeoSearchControls/GeoSearchControls.tsx
  12. +10 −11 src/components/GeoSearchControls/{GeoSearchToggle.js → GeoSearchToggle.tsx}
  13. +1 −1 src/components/GeoSearchControls/__tests__/{GeoSearchButton-test.js → GeoSearchButton-test.tsx}
  14. +19 −11 src/components/GeoSearchControls/__tests__/{GeoSearchControls-test.js → GeoSearchControls-test.tsx}
  15. +1 −1 src/components/GeoSearchControls/__tests__/{GeoSearchToggle-test.js → GeoSearchToggle-test.tsx}
  16. 0 ...chControls/__tests__/__snapshots__/{GeoSearchButton-test.js.snap → GeoSearchButton-test.tsx.snap}
  17. 0 ...ntrols/__tests__/__snapshots__/{GeoSearchControls-test.js.snap → GeoSearchControls-test.tsx.snap}
  18. 0 ...chControls/__tests__/__snapshots__/{GeoSearchToggle-test.js.snap → GeoSearchToggle-test.tsx.snap}
  19. +3 −1 src/components/Hits/Hits.tsx
  20. +7 −6 src/components/Hits/__tests__/Hits-test.tsx
  21. +3 −1 src/components/InfiniteHits/InfiniteHits.tsx
  22. +3 −1 src/components/MenuSelect/MenuSelect.tsx
  23. +4 −5 src/components/MenuSelect/__tests__/MenuSelect-test.tsx
  24. +3 −1 src/components/Pagination/Pagination.tsx
  25. +27 −38 src/components/Pagination/__tests__/Pagination-test.tsx
  26. +5 −1 src/components/Panel/Panel.tsx
  27. +5 −1 src/components/QueryRuleCustomData/QueryRuleCustomData.tsx
  28. +3 −1 src/components/RangeInput/RangeInput.tsx
  29. +2 −3 src/components/RangeInput/__tests__/RangeInput-test.tsx
  30. +29 −16 src/components/RefinementList/RefinementList.tsx
  31. +2 −8 src/components/RefinementList/__tests__/RefinementList-test.tsx
  32. +3 −8 src/components/RefinementList/__tests__/RefinementListItem-test.tsx
  33. +3 −1 src/components/RelevantSort/RelevantSort.tsx
  34. +3 −1 src/components/SearchBox/SearchBox.tsx
  35. +15 −22 src/components/SearchBox/__tests__/SearchBox-test.tsx
  36. +3 −4 src/components/Selector/__tests__/Selector-test.tsx
  37. +41 −50 src/components/Slider/__tests__/Slider-test.tsx
  38. +3 −1 src/components/Stats/Stats.tsx
  39. +3 −9 src/components/Stats/__tests__/Stats-test.tsx
  40. +9 −10 src/components/Template/__tests__/Template-test.tsx
  41. +5 −1 src/components/ToggleRefinement/ToggleRefinement.tsx
  42. +3 −1 src/components/VoiceSearch/VoiceSearch.tsx
  43. +2 −2 src/connectors/dynamic-widgets/__tests__/connectDynamicWidgets-test.ts
  44. +1 −1 src/connectors/dynamic-widgets/connectDynamicWidgets.ts
  45. +1 −1 src/lib/version.ts
  46. +5 −5 src/widgets/answers/answers.tsx
  47. +5 −1 src/widgets/answers/defaultTemplates.ts
  48. +9 −3 src/widgets/breadcrumb/breadcrumb.tsx
  49. +5 −1 src/widgets/breadcrumb/defaultTemplates.ts
  50. +1 −1 src/widgets/clear-refinements/clear-refinements.tsx
  51. +5 −1 src/widgets/clear-refinements/defaultTemplates.ts
  52. +5 −1 src/widgets/geo-search/defaultTemplates.ts
  53. +7 −5 src/widgets/geo-search/geo-search.ts
  54. +4 −1 src/widgets/hierarchical-menu/defaultTemplates.ts
  55. +11 −7 src/widgets/hierarchical-menu/hierarchical-menu.tsx
  56. +10 −1 src/widgets/hits/__tests__/defaultTemplates-test.ts
  57. +5 −1 src/widgets/hits/defaultTemplates.ts
  58. +1 −1 src/widgets/hits/hits.tsx
  59. +10 −1 src/widgets/infinite-hits/__tests__/defaultTemplates-test.ts
  60. +5 −1 src/widgets/infinite-hits/defaultTemplates.ts
  61. +1 −1 src/widgets/infinite-hits/infinite-hits.tsx
  62. +5 −1 src/widgets/menu-select/defaultTemplates.ts
  63. +9 −6 src/widgets/menu-select/menu-select.tsx
  64. +5 −1 src/widgets/menu/defaultTemplates.ts
  65. +11 −7 src/widgets/menu/menu.tsx
  66. +5 −1 src/widgets/numeric-menu/defaultTemplates.ts
  67. +3 −1 src/widgets/numeric-menu/numeric-menu.tsx
  68. +10 −8 src/widgets/pagination/pagination.tsx
  69. +13 −8 src/widgets/query-rule-custom-data/query-rule-custom-data.tsx
  70. +4 −9 src/widgets/range-input/range-input.tsx
  71. +5 −1 src/widgets/rating-menu/defaultTemplates.ts
  72. +16 −6 src/widgets/rating-menu/rating-menu.tsx
  73. +78 −76 src/widgets/refinement-list/refinement-list.tsx
  74. +5 −1 src/widgets/relevant-sort/defaultTemplates.ts
  75. +11 −10 src/widgets/relevant-sort/relevant-sort.tsx
  76. +4 −2 src/widgets/search-box/defaultTemplates.ts
  77. +12 −7 src/widgets/search-box/search-box.tsx
  78. +4 −4 src/widgets/sort-by/sort-by.tsx
  79. +6 −9 src/widgets/stats/stats.tsx
  80. +5 −1 src/widgets/toggle-refinement/defaultTemplates.ts
  81. +9 −6 src/widgets/toggle-refinement/toggle-refinement.tsx
  82. +2 −2 src/widgets/voice-search/defaultTemplates.ts
  83. +28 −21 src/widgets/voice-search/voice-search.tsx
  84. +12 −0 test/utils/enzyme.ts
  85. +127 −132 yarn.lock
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [4.24.3](https://github.com/algolia/instantsearch.js/compare/v4.24.2...v4.24.3) (2021-07-05)


### Bug Fixes

* **dynamicWidgets:** read from facetOrdering.facets ([42d6c6c](https://github.com/algolia/instantsearch.js/commit/42d6c6cefc5f009a3cfc63ab3d628ed2811f1700))
* **ts:** make template types consistent ([#4785](https://github.com/algolia/instantsearch.js/issues/4785)) ([e0fbd55](https://github.com/algolia/instantsearch.js/commit/e0fbd55b6b98dd64301f113fd394dce57552d94c))



## [4.24.2](https://github.com/algolia/instantsearch.js/compare/v4.24.1...v4.24.2) (2021-06-29)


7 changes: 0 additions & 7 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -27,13 +27,6 @@ module.exports = api => {
const buildPlugins = clean([
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-react-constant-elements',
[
'babel-plugin-transform-react-remove-prop-types',
{
mode: 'remove',
removeImport: true,
},
],
'babel-plugin-transform-react-pure-class-to-function',
wrapWarningWithDevCheck,
(isCJS || isES) && [
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instantsearch.js",
"version": "4.24.2",
"version": "4.24.3",
"description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
"homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
"types": "es/index.d.ts",
@@ -54,16 +54,15 @@
"dependencies": {
"@types/google.maps": "^3.45.3",
"@types/hogan.js": "^3.0.0",
"algoliasearch-helper": "^3.4.5",
"algoliasearch-helper": "^3.5.4",
"classnames": "^2.2.5",
"events": "^1.1.0",
"hogan.js": "^3.0.2",
"preact": "^10.0.0",
"prop-types": "^15.5.10",
"qs": "^6.5.1"
},
"devDependencies": {
"@algolia/client-search": "4.9.2",
"@algolia/client-search": "4.10.3",
"@babel/cli": "7.8.4",
"@babel/core": "7.9.6",
"@babel/plugin-proposal-class-properties": "7.8.3",
@@ -94,15 +93,14 @@
"@wdio/selenium-standalone-service": "5.16.5",
"@wdio/spec-reporter": "5.16.5",
"@wdio/static-server-service": "5.16.5",
"algoliasearch": "4.9.2",
"algoliasearch": "4.10.3",
"algoliasearch-v3": "npm:algoliasearch@3.35.1",
"babel-eslint": "10.0.3",
"babel-jest": "26.6.3",
"babel-loader": "8.0.6",
"babel-plugin-inline-replace-variables": "1.3.1",
"babel-plugin-polyfill-es-shims": "0.0.7",
"babel-plugin-transform-react-pure-class-to-function": "1.0.1",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"bundlesize": "0.18.0",
"conventional-changelog-cli": "2.0.31",
"doctoc": "1.4.0",
8 changes: 5 additions & 3 deletions src/components/Answers/Answers.tsx
Original file line number Diff line number Diff line change
@@ -9,15 +9,17 @@ import {
} from '../../widgets/answers/answers';
import { ComponentCSSClasses, Hits } from '../../types';

export type AnswerComponentCSSClasses = ComponentCSSClasses<AnswersCSSClasses>;
export type AnswersComponentCSSClasses = ComponentCSSClasses<AnswersCSSClasses>;

export type AnswersComponentTemplates = Required<AnswersTemplates>;

export type AnswersProps = {
hits: Hits;
isLoading: boolean;
cssClasses: AnswerComponentCSSClasses;
cssClasses: AnswersComponentCSSClasses;
templateProps: {
[key: string]: any;
templates: AnswersTemplates;
templates: AnswersComponentTemplates;
};
};

12 changes: 6 additions & 6 deletions src/components/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -3,7 +3,10 @@
import { h } from 'preact';
import cx from 'classnames';
import Template from '../Template/Template';
import { BreadcrumbCSSClasses } from '../../widgets/breadcrumb/breadcrumb';
import {
BreadcrumbCSSClasses,
BreadcrumbTemplates,
} from '../../widgets/breadcrumb/breadcrumb';
import { ComponentCSSClasses } from '../../types';

type BreadcrumbItem = {
@@ -15,16 +18,13 @@ export type BreadcrumbComponentCSSClasses = ComponentCSSClasses<
BreadcrumbCSSClasses
>;

type BreadcrumbTemplates = {
home: string;
separator: string;
};
export type BreadcrumbComponentTemplates = Required<BreadcrumbTemplates>;

export type BreadcrumbProps = {
items: BreadcrumbItem[];
cssClasses: BreadcrumbComponentCSSClasses;
templateProps: {
templates: BreadcrumbTemplates;
templates: BreadcrumbComponentTemplates;
};
createURL(value: string | undefined): string;
refine(value: string | undefined): void;
6 changes: 5 additions & 1 deletion src/components/ClearRefinements/ClearRefinements.tsx
Original file line number Diff line number Diff line change
@@ -14,13 +14,17 @@ export type ClearRefinementsComponentCSSClasses = ComponentCSSClasses<
ClearRefinementsCSSClasses
>;

export type ClearRefinementsComponentTemplates = Required<
ClearRefinementsTemplates
>;

export type ClearRefinementsProps = {
refine: ClearRefinementsRenderState['refine'];
cssClasses: ClearRefinementsComponentCSSClasses;
hasRefinements: ClearRefinementsRenderState['hasRefinements'];
templateProps: {
[key: string]: any;
templates: ClearRefinementsTemplates;
templates: ClearRefinementsComponentTemplates;
};
};

Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@

import { h } from 'preact';
import ClearRefinements from '../ClearRefinements';
import { mount } from 'enzyme';
import { ReactElementLike } from 'prop-types';
import { mount } from '../../../../test/utils/enzyme';

describe('ClearRefinements', () => {
const defaultProps = {
@@ -23,18 +22,14 @@ describe('ClearRefinements', () => {
};

it('should render <ClearRefinements />', () => {
const wrapper = mount(
(<ClearRefinements {...defaultProps} />) as ReactElementLike
);
const wrapper = mount(<ClearRefinements {...defaultProps} />);

expect(wrapper).toMatchSnapshot();
});

it('should render <ClearRefinements /> with a specific class when no refinements', () => {
const wrapper = mount(
(
<ClearRefinements {...defaultProps} hasRefinements={false} />
) as ReactElementLike
<ClearRefinements {...defaultProps} hasRefinements={false} />
);

expect(wrapper).toMatchSnapshot();
23 changes: 0 additions & 23 deletions src/components/GeoSearchControls/GeoSearchButton.js

This file was deleted.

23 changes: 23 additions & 0 deletions src/components/GeoSearchControls/GeoSearchButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/** @jsx h */

import { h, ComponentChildren } from 'preact';

type Props = {
className: string;
onClick(event: MouseEvent): void;
children: ComponentChildren;
disabled?: boolean;
};

const GeoSearchButton = ({
className,
disabled = false,
onClick,
children,
}: Props) => (
<button className={className} onClick={onClick} disabled={disabled}>
{children}
</button>
);

export default GeoSearchButton;
108 changes: 0 additions & 108 deletions src/components/GeoSearchControls/GeoSearchControls.js

This file was deleted.

Loading