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.25.3
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.26.0
Choose a head ref
  • 7 commits
  • 29 files changed
  • 3 contributors

Commits on Aug 4, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    585e38f View commit details
  2. feat(ts): allow custom ui state and route state in routing (#4816)

    * feat(ts): allow custom ui state and route state in routing
    
    While I couldn't find a way to make InstantSearch itself generic (this gets passed to many places, which then loses generic), using the routing middleware directly is possible like this now
    
    ```ts
    import instantsearch from 'instantsearch.js/es'
    import { history } from 'instantsearch.js/es/lib/routers';
    import { createRouterMiddleware } from 'instantsearch.js/es/middlewares';
    import { StateMapping, UiState } from 'instantsearch.js/es/types';
    
    type SwagIndexUiState = { swag: boolean };
    type SwagUiState = { [indexName: string]: SwagIndexUiState };
    
    const stateMapping: StateMapping<UiState & SwagUiState, SwagUiState> = {
      stateToRoute(uiState) {
        return Object.keys(uiState).reduce(
          (state, indexId) => ({
            ...state,
            [indexId]: { swag: uiState[indexId].swag },
          }),
          {}
        );
      },
    
      routeToState(routeState = {}) {
        return Object.keys(routeState).reduce(
          (state, indexId) => ({
            ...state,
            [indexId]: routeState[indexId],
          }),
          {}
        );
      },
    };
    
    const search = instantsearch();
    
    search.use(
      createRouterMiddleware<UiState & SwagUiState, SwagUiState>({
        router: history(),
        stateMapping,
      })
    );
    search.addWidgets([instantsearch.widgets.hits({ container })]);
    ```
    
    * actually genericificate InstantSearch
    
    * already inferred so no need
    
    * Apply suggestions from code review
    
    * address feedback
    
    * better comment
    Haroenv authored Aug 4, 2021
    Copy the full SHA
    5f8ba5d View commit details
  3. fix(ts): expand UiState mix

    an example of how it's different is:
    
    ```ts
    import { Expand, UiState } from './types';
    
    type mix = UiState & { [index: string]: { swag?: boolean } };
    type mixExpand = Expand<mix>;
    
    // @ts-expect-error
    const initialUiState: mix = {
      someIndex: {
        swag: true,
      },
    };
    
    const initialUiStateExpanded: mixExpand = {
      someIndex: {
        swag: true,
      },
    };
    ```
    Haroenv committed Aug 4, 2021
    Copy the full SHA
    fb0088a View commit details
  4. Copy the full SHA
    1de0c75 View commit details

Commits on Aug 5, 2021

  1. docs(readme): fix link format (#4827)

    fix yarn link
    taylor-brown authored Aug 5, 2021
    Copy the full SHA
    362fb0f View commit details
  2. feat(types): allow typed access to properties added to entry (#4814)

    also removes the file for "main" as it's inconsistent with index.es.ts
    Haroenv authored Aug 5, 2021
    Copy the full SHA
    9000f16 View commit details

Commits on Aug 12, 2021

  1. chore: release v4.26.0 (#4828)

    * chore: release v4.26.0
    
    * Update CHANGELOG.md
    
    Co-authored-by: Haroen Viaene <hello@haroen.me>
    instantsearch-bot and Haroenv authored Aug 12, 2021
    Copy the full SHA
    1450e85 View commit details
Loading