Skip to content

Commit 5e55752

Browse files
meili-bors[bot]dependabot[bot]meili-botbidoubiwa
authored
Merge #871 #872 #873
871: Bump @babel/preset-env from 7.19.4 to 7.20.2 r=bidoubiwa a=dependabot[bot] Bumps [`@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env)` from 7.19.4 to 7.20.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/babel/babel/releases"><code>`@​babel/preset-env</code>'s` releases</a>.</em></p> <blockquote> <h2>v7.20.2 (2022-11-04)</h2> <h4>:bug: Bug Fix</h4> <ul> <li><code>babel-core</code>, <code>babel-helper-create-class-features-plugin</code>, <code>babel-helper-module-transforms</code>, <code>babel-helper-plugin-utils</code>, <code>babel-helper-simple-access</code>, <code>babel-node</code>, <code>babel-plugin-transform-block-scoping</code>, <code>babel-plugin-transform-classes</code>, <code>babel-plugin-transform-react-constant-elements</code>, <code>babel-preset-env</code>, <code>babel-standalone</code>, <code>babel-types</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15124">#15124</a> fix: <code>`@babel/node</code>` repl and enable <code>no-use-before-define</code> rule (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-plugin-transform-typescript</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15121">#15121</a> fix: <code>tsSatisfiesExpression</code> check with different duplicated <code>`@babel/types</code>` versions (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-parser</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15094">#15094</a> fix: <code>parser</code> typings for plugins (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-generator</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15118">#15118</a> Improve printing of [no LineTerminator here] with comments (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> <li><code>babel-plugin-proposal-decorators</code>, <code>babel-plugin-proposal-object-rest-spread</code>, <code>babel-plugin-transform-jscript</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15113">#15113</a> fix: wrap anonymous class expression within statement (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` </ul> </li> <li><code>babel-plugin-transform-destructuring</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15104">#15104</a> fix: Destructuring exceptions <code>for ( let { } = 0 ; 0 ; ) </code> (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> </ul> <h4>Committers: 3</h4> <ul> <li>Huáng Jùnliàng (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` <li>Nicolò Ribaudo (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` <li><a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a></li>` </ul> <h2>v7.20.1 (2022-11-01)</h2> <p>Thanks <a href="https://github.com/ptomato"><code>`@​ptomato</code></a>` for your first pull request!</p> <h4>:bug: Bug Fix</h4> <ul> <li><code>babel-plugin-proposal-async-generator-functions</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15103">#15103</a> fix: Compile re-declare var in <code>init</code> and <code>body</code> of <code>for await</code> (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-plugin-proposal-class-properties</code>, <code>babel-traverse</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15106">#15106</a> Do not mark <code>in</code> and <code>instanceof</code> as constant expressions (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> <li><code>babel-helpers</code>, <code>babel-plugin-proposal-duplicate-named-capturing-groups-regex</code>, <code>babel-plugin-transform-named-capturing-groups-regex</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15092">#15092</a> Support <code>indices.groups</code> when compiling named groups in regexps (<a href="https://github.com/ptomato"><code>`@​ptomato</code></a>)</li>` </ul> </li> <li><code>babel-parser</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15102">#15102</a> fix: Parse re-declare var in class static body (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15096">#15096</a> fix: <code>a satisfies b</code> as lval (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-helpers</code>, <code>babel-plugin-proposal-duplicate-named-capturing-groups-regex</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15090">#15090</a> Handle multiple named groups in wrapRegExp replace() (<a href="https://github.com/ptomato"><code>`@​ptomato</code></a>)</li>` </ul> </li> <li><code>babel-plugin-transform-async-to-generator</code>, <code>babel-plugin-transform-parameters</code>, <code>babel-preset-env</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15081">#15081</a> Move the generator body to a gen IIFE when compiling its params (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> </ul> <h4>:house: Internal</h4> <ul> <li><code>babel-generator</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15080">#15080</a> Automatically print inner comments (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> </ul> <h4>Committers: 5</h4> <ul> <li>Babel Bot (<a href="https://github.com/babel-bot"><code>`@​babel-bot</code></a>)</li>` <li>Huáng Jùnliàng (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` <li>Nicolò Ribaudo (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` <li>Philip Chimento (<a href="https://github.com/ptomato"><code>`@​ptomato</code></a>)</li>` <li><a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a></li>` </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/babel/babel/blob/main/CHANGELOG.md"><code>`@​babel/preset-env</code>'s` changelog</a>.</em></p> <blockquote> <h2>v7.20.2 (2022-11-04)</h2> <h4>:bug: Bug Fix</h4> <ul> <li><code>babel-core</code>, <code>babel-helper-create-class-features-plugin</code>, <code>babel-helper-module-transforms</code>, <code>babel-helper-plugin-utils</code>, <code>babel-helper-simple-access</code>, <code>babel-node</code>, <code>babel-plugin-transform-block-scoping</code>, <code>babel-plugin-transform-classes</code>, <code>babel-plugin-transform-react-constant-elements</code>, <code>babel-preset-env</code>, <code>babel-standalone</code>, <code>babel-types</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15124">#15124</a> fix: <code>`@babel/node</code>` repl and enable <code>no-use-before-define</code> rule (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-plugin-transform-typescript</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15121">#15121</a> fix: <code>tsSatisfiesExpression</code> check with different duplicated <code>`@babel/types</code>` versions (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-parser</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15094">#15094</a> fix: <code>parser</code> typings for plugins (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-generator</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15118">#15118</a> Improve printing of [no LineTerminator here] with comments (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> <li><code>babel-plugin-proposal-decorators</code>, <code>babel-plugin-proposal-object-rest-spread</code>, <code>babel-plugin-transform-jscript</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15113">#15113</a> fix: wrap anonymous class expression within statement (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` </ul> </li> <li><code>babel-plugin-transform-destructuring</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15104">#15104</a> fix: Destructuring exceptions <code>for ( let { } = 0 ; 0 ; ) </code> (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> </ul> <h2>v7.20.1 (2022-11-01)</h2> <h4>:bug: Bug Fix</h4> <ul> <li><code>babel-plugin-proposal-async-generator-functions</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15103">#15103</a> fix: Compile re-declare var in <code>init</code> and <code>body</code> of <code>for await</code> (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-plugin-proposal-class-properties</code>, <code>babel-traverse</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15106">#15106</a> Do not mark <code>in</code> and <code>instanceof</code> as constant expressions (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> <li><code>babel-helpers</code>, <code>babel-plugin-proposal-duplicate-named-capturing-groups-regex</code>, <code>babel-plugin-transform-named-capturing-groups-regex</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15092">#15092</a> Support <code>indices.groups</code> when compiling named groups in regexps (<a href="https://github.com/ptomato"><code>`@​ptomato</code></a>)</li>` </ul> </li> <li><code>babel-parser</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15102">#15102</a> fix: Parse re-declare var in class static body (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15096">#15096</a> fix: <code>a satisfies b</code> as lval (<a href="https://github.com/liuxingbaoyu"><code>`@​liuxingbaoyu</code></a>)</li>` </ul> </li> <li><code>babel-helpers</code>, <code>babel-plugin-proposal-duplicate-named-capturing-groups-regex</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15090">#15090</a> Handle multiple named groups in wrapRegExp replace() (<a href="https://github.com/ptomato"><code>`@​ptomato</code></a>)</li>` </ul> </li> <li><code>babel-plugin-transform-async-to-generator</code>, <code>babel-plugin-transform-parameters</code>, <code>babel-preset-env</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15081">#15081</a> Move the generator body to a gen IIFE when compiling its params (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> </ul> <h4>:house: Internal</h4> <ul> <li><code>babel-generator</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/15080">#15080</a> Automatically print inner comments (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> </ul> <h2>v7.20.0 (2022-10-27)</h2> <h4>:rocket: New Feature</h4> <ul> <li><code>babel-compat-data</code>, <code>babel-helper-compilation-targets</code>, <code>babel-preset-env</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/14944">#14944</a> Add <code>deno</code> compilation target (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` </ul> </li> <li><code>babel-plugin-syntax-typescript</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/14923">#14923</a> Expose <code>dts</code> option in <code>`@babel/plugin-syntax-typescript</code>` (<a href="https://github.com/oceandrama"><code>`@​oceandrama</code></a>)</li>` </ul> </li> <li><code>babel-generator</code>, <code>babel-parser</code>, <code>babel-plugin-syntax-explicit-resource-management</code>, <code>babel-plugin-transform-block-scoping</code>, <code>babel-plugin-transform-destructuring</code>, <code>babel-standalone</code>, <code>babel-traverse</code>, <code>babel-types</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/14968">#14968</a> Parse <code>using</code> declaration (explicit resource management) (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` </ul> </li> <li><code>babel-generator</code>, <code>babel-parser</code>, <code>babel-plugin-syntax-import-reflection</code>, <code>babel-standalone</code>, <code>babel-types</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/14926">#14926</a> Parse import reflection (<a href="https://github.com/JLHwung"><code>`@​JLHwung</code></a>)</li>` </ul> </li> <li><code>babel-generator</code>, <code>babel-helper-skip-transparent-expression-wrappers</code>, <code>babel-parser</code>, <code>babel-plugin-transform-typescript</code>, <code>babel-traverse</code>, <code>babel-types</code> <ul> <li><a href="https://github-redirect.dependabot.com/babel/babel/pull/14211">#14211</a> [ts] Add support for <code>expr satisfies Type</code> expressions (<a href="https://github.com/nicolo-ribaudo"><code>`@​nicolo-ribaudo</code></a>)</li>` </ul> </li> </ul> <h4>:bug: Bug Fix</h4> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/babel/babel/commit/12a58cb58c07677215f5c51d60a623ca674a7a52"><code>12a58cb</code></a> v7.20.2</li> <li><a href="https://github.com/babel/babel/commit/77f3700fa2820f264c725a96d8c12ad73115687f"><code>77f3700</code></a> fix: <code>`@babel/node</code>` repl and enable <code>no-use-before-define</code> rule (<a href="https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env/issues/15124">#15124</a>)</li> <li><a href="https://github.com/babel/babel/commit/082caa1bddc52a448af64a5e4d4b003efb370df0"><code>082caa1</code></a> Move the generator body to a gen IIFE when compiling its params (<a href="https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env/issues/15081">#15081</a>)</li> <li><a href="https://github.com/babel/babel/commit/745eacc2736baceae531d409e1b34e1c0d6d0bc6"><code>745eacc</code></a> Add <code>deno</code> compilation target (<a href="https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env/issues/14944">#14944</a>)</li> <li><a href="https://github.com/babel/babel/commit/69bbe804472bee5b8e3b4fccbb8656a78fb27cfc"><code>69bbe80</code></a> Update <code>regenerator-runtime</code> (<a href="https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env/issues/15078">#15078</a>)</li> <li><a href="https://github.com/babel/babel/commit/34ae2819b88bcc57b7eb5daa224afb4f08974582"><code>34ae281</code></a> fix: preserve this for <code>super.*</code> template tags (<a href="https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env/issues/15043">#15043</a>)</li> <li>See full diff in <a href="https://github.com/babel/babel/commits/v7.20.2/packages/babel-preset-env">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=`@babel/preset-env&package-manager=npm_and_yarn&previous-version=7.19.4&new-version=7.20.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)` You can trigger a rebase of this PR by commenting ``@dependabot` rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - ``@dependabot` rebase` will rebase this PR - ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it - ``@dependabot` merge` will merge this PR after your CI passes on it - ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it - ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging - ``@dependabot` reopen` will reopen this PR if it is closed - ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> 872: Bump tslib from 2.4.0 to 2.4.1 r=bidoubiwa a=dependabot[bot] Bumps [tslib](https://github.com/Microsoft/tslib) from 2.4.0 to 2.4.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/Microsoft/tslib/releases">tslib's releases</a>.</em></p> <blockquote> <h2>tslib 2.4.1</h2> <p>This release contains <a href="https://github-redirect.dependabot.com/microsoft/tslib/pull/186">fixes for early <code>return</code>s and <code>throw</code>s invoked on generators</a>.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/microsoft/tslib/commit/8acd4b30d375be8c43144b9ee0b3c98599e7a9a1"><code>8acd4b3</code></a> Bump version to 2.4.1.</li> <li><a href="https://github.com/microsoft/tslib/commit/5f7365ee1c9aa28f7cbee0a0d7cb7ff390c9cbd3"><code>5f7365e</code></a> Remove extra line in generator.md</li> <li><a href="https://github.com/microsoft/tslib/commit/b1d38ee117504078a7c12338264c977e766edfb6"><code>b1d38ee</code></a> Fix early call to return/throw on generator (<a href="https://github-redirect.dependabot.com/Microsoft/tslib/issues/186">#186</a>)</li> <li><a href="https://github.com/microsoft/tslib/commit/4e27e9fc6e778a11224cf9331aeb3edad3044f84"><code>4e27e9f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Microsoft/tslib/issues/181">#181</a> from microsoft/users/GitHubPolicyService/201dd6b7-4ca...</li> <li><a href="https://github.com/microsoft/tslib/commit/7af3973ab365f9daa991954360bcd4453ed5efa9"><code>7af3973</code></a> Microsoft mandatory file</li> <li><a href="https://github.com/microsoft/tslib/commit/5bfaf87d1d90a2d2aeb375aa24adf25fdbc4c6da"><code>5bfaf87</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Microsoft/tslib/issues/172">#172</a> from microsoft/add-test-vite</li> <li><a href="https://github.com/microsoft/tslib/commit/f5417485cf0064a62c4da1f1584771dd366fb73c"><code>f541748</code></a> Drop node@10 from test matrix, add node@16</li> <li><a href="https://github.com/microsoft/tslib/commit/8860d619ff44510c3d97401c8c38c33d773919d9"><code>8860d61</code></a> Add a test for vite</li> <li>See full diff in <a href="https://github.com/Microsoft/tslib/compare/2.4.0...2.4.1">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tslib&package-manager=npm_and_yarn&previous-version=2.4.0&new-version=2.4.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting ``@dependabot` rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - ``@dependabot` rebase` will rebase this PR - ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it - ``@dependabot` merge` will merge this PR after your CI passes on it - ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it - ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging - ``@dependabot` reopen` will reopen this PR if it is closed - ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> 873: Changes related to the next Meilisearch release (v0.30.0) r=bidoubiwa a=meili-bot This PR gathers the changes related to the next Meilisearch release (v0.30.0) so that this package is ready when the official release is out. ⚠️ This PR should NOT be merged until: - the next release of Meilisearch (v0.30.0) is out. - the [`meilisearch-js`](https://github.com/meilisearch/meilisearch-js) dependency has been released to be compatible with Meilisearch v0.30.0. Once the release is out, the upgrade of the `meilisearch-js` dependency might be committed to this branch. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._ _Related to this issue: https://github.com/meilisearch/integration-guides/issues/221_ Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: meili-bot <[email protected]> Co-authored-by: Charlotte Vermandel <[email protected]> Co-authored-by: cvermand <[email protected]>
4 parents ea9a3db + d8c62fc + 0bcfc73 + 80d6abf commit 5e55752

File tree

21 files changed

+687
-499
lines changed

21 files changed

+687
-499
lines changed

README.md

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ const searchClient = instantMeiliSearch(
8585
`instant-meilisearch` offers some options you can set to further fit your needs.
8686

8787
- [`placeholderSearch`](#placeholder-search): Enable or disable placeholder search (default: `true`).
88-
- [`paginationTotalHits`](#pagination-total-hits): Maximum total number of hits to create a finite pagination (default: `200`).
89-
- [`finitePagination`](#finite-pagination): Used to work with the [`pagination`](#-pagination) widget (default: `false`) .
88+
- [`finitePagination`](#finite-pagination): Enable finite pagination when using the the [`pagination`](#-pagination) widget (default: `false`) .
9089
- [`primaryKey`](#primary-key): Specify the primary key of your documents (default `undefined`).
9190
- [`keepZeroFacets`](#keep-zero-facets): Show the facets value even when they have 0 matches (default `false`).
9291
- [`matchingStrategy`](#matching-strategy): Determine the search strategy on words matching (default `last`).
@@ -100,7 +99,6 @@ const searchClient = instantMeiliSearch(
10099
'https://integration-demos.meilisearch.com',
101100
'99d1e034ed32eb569f9edc27962cccf90b736e4c5a70f7f5e76b9fab54d6a185',
102101
{
103-
paginationTotalHits: 30, // default: 200.
104102
placeholderSearch: false, // default: true.
105103
primaryKey: 'id', // default: undefined
106104
// ...
@@ -117,34 +115,18 @@ When placeholder search is set to `false`, no results appears when searching on
117115
{ placeholderSearch : true } // default true
118116
```
119117

120-
### Pagination total hits
121-
122-
The total (and finite) number of hits (default: `200`) you can browse during pagination when using the [pagination widget](https://www.algolia.com/doc/api-reference/widgets/pagination/js/) or the [`infiniteHits` widget](#-infinitehits). If none of these widgets are used, `paginationTotalHits` is ignored.<br>
123-
124-
For example, using the `infiniteHits` widget, and a `paginationTotalHits` of 9. On the first search request 6 hits are shown, by clicking a second time on `load more` only 3 more hits are added. This is because `paginationTotalHits` is `9`.
125-
126-
Usage:
127-
128-
```js
129-
{ paginationTotalHits: 50 } // default: 200
130-
```
131-
132-
`hitsPerPage` has a value of `20` by default and can [be customized](#-hitsperpage).
133-
134118
### Finite Pagination
135119

136120
Finite pagination is used when you want to add a numbered pagination at the bottom of your hits (for example: `<< < 1, 2, 3 > >>`).
137-
To be able to know the amount of page numbers you have, a search is done requesting `paginationTotalHits` documents (default: `200`).
138-
With the amount of documents returned, instantsearch is able to render the correct amount of numbers in the pagination widget.
121+
122+
It requires the usage of the [`Pagination` widget](#-pagination).
139123

140124
Example:
141125

142126
```js
143127
{ finitePagination: true } // default: false
144128
```
145129

146-
⚠️ Meilisearch is not designed for pagination and this can lead to performances issues, so the usage `finitePagination` but also of the pagination widgets are not recommended.<br>
147-
More information about Meilisearch and the pagination [here](https://github.com/meilisearch/documentation/issues/561).
148130

149131
### Primary key
150132

@@ -274,7 +256,7 @@ This package only guarantees the compatibility with the [version v4 of InstantSe
274256

275257
**Supported Meilisearch versions**:
276258

277-
This package only guarantees the compatibility with the [version v0.29.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.29.0).
259+
This package only guarantees the compatibility with the [version v0.30.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.30.0).
278260

279261
**Node / NPM versions**:
280262

@@ -925,9 +907,7 @@ instantsearch.widgets.clearRefinements({
925907

926908
[Pagination references](https://www.algolia.com/doc/api-reference/widgets/pagination/js/)
927909

928-
The `pagination` widget displays a pagination system allowing the user to change the current page.
929-
930-
We do not recommend using this widget as pagination slows the search responses. Instead, the [InfiniteHits](#-infinitehits) component is recommended.
910+
The `pagination` widget displays a pagination system allowing the user to change the current page. It should be used alongside the [`finitePagination`](#finite-pagination) setting to render the correct amount of pages.
931911

932912
- ✅ container: The CSS Selector or HTMLElement to insert the widget into. _required_
933913
- ✅ showFirst: Whether to display the first-page link.
@@ -1094,4 +1074,4 @@ If you want to know more about the development workflow or want to contribute, p
10941074

10951075
<hr>
10961076

1097-
**Meilisearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.
1077+
**Meilisearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
"url": "https://github.com/meilisearch/instant-meilisearch.git"
5858
},
5959
"dependencies": {
60-
"meilisearch": "^0.28.0"
60+
"meilisearch": "^0.30.0"
6161
},
6262
"devDependencies": {
6363
"@babel/cli": "^7.19.3",
6464
"@babel/core": "^7.18.13",
65-
"@babel/preset-env": "^7.19.4",
65+
"@babel/preset-env": "^7.20.2",
6666
"@rollup/plugin-commonjs": "^17.1.0",
6767
"@rollup/plugin-node-resolve": "^11.2.0",
6868
"@types/jest": "^27.0.2",
@@ -103,7 +103,7 @@
103103
"rollup-plugin-typescript2": "^0.32.1",
104104
"shx": "^0.3.3",
105105
"ts-jest": "^27.0.7",
106-
"tslib": "^2.4.0",
106+
"tslib": "^2.4.1",
107107
"typescript": "^4.8.4"
108108
}
109109
}

playgrounds/react/src/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const searchClient = instantMeiliSearch(
2020
'https://integration-demos.meilisearch.com',
2121
'99d1e034ed32eb569f9edc27962cccf90b736e4c5a70f7f5e76b9fab54d6a185',
2222
{
23-
paginationTotalHits: 60,
2423
primaryKey: 'id',
2524
}
2625
)

src/adapter/search-request-adapter/__tests__/search-params.tests.ts

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import { MatchingStrategies } from '../../../types'
33

44
const DEFAULT_CONTEXT = {
55
indexUid: 'test',
6-
pagination: { paginationTotalHits: 20, page: 0, hitsPerPage: 6 },
6+
pagination: { page: 0, hitsPerPage: 6, finite: false },
77
defaultFacetDistribution: {},
8-
finitePagination: false,
98
}
109

1110
describe('Parameters adapter', () => {
@@ -108,86 +107,63 @@ describe('Pagination adapter', () => {
108107
test('adapting a searchContext with finite pagination', () => {
109108
const searchParams = adaptSearchParams({
110109
...DEFAULT_CONTEXT,
111-
finitePagination: true,
110+
pagination: { page: 0, hitsPerPage: 6, finite: true },
112111
})
113112

114-
expect(searchParams.limit).toBe(20)
113+
expect(searchParams.page).toBe(1)
114+
expect(searchParams.hitsPerPage).toBe(6)
115115
})
116116

117117
test('adapting a searchContext with finite pagination on a later page', () => {
118118
const searchParams = adaptSearchParams({
119119
...DEFAULT_CONTEXT,
120-
pagination: { paginationTotalHits: 20, page: 10, hitsPerPage: 6 },
121-
finitePagination: true,
120+
pagination: { page: 10, hitsPerPage: 6, finite: true },
122121
})
123122

124-
expect(searchParams.limit).toBe(20)
123+
expect(searchParams.page).toBe(11)
124+
expect(searchParams.hitsPerPage).toBe(6)
125125
})
126126

127-
test('adapting a searchContext with finite pagination and pagination total hits lower than hitsPerPage', () => {
128-
const searchParams = adaptSearchParams({
129-
...DEFAULT_CONTEXT,
130-
pagination: { paginationTotalHits: 4, page: 0, hitsPerPage: 6 },
131-
finitePagination: true,
132-
})
133-
134-
expect(searchParams.limit).toBe(4)
135-
})
136-
137-
test('adapting a searchContext with no finite pagination', () => {
127+
test('adapting a searchContext with no finite pagination on page 1', () => {
138128
const searchParams = adaptSearchParams({
139129
...DEFAULT_CONTEXT,
140130
})
141131

142132
expect(searchParams.limit).toBe(7)
133+
expect(searchParams.offset).toBe(0)
143134
})
144135

145136
test('adapting a searchContext with no finite pagination on page 2', () => {
146137
const searchParams = adaptSearchParams({
147138
...DEFAULT_CONTEXT,
148-
pagination: { paginationTotalHits: 20, page: 1, hitsPerPage: 6 },
149-
})
150-
151-
expect(searchParams.limit).toBe(13)
152-
})
153-
154-
test('adapting a searchContext with no finite pagination on page higher than paginationTotalHits', () => {
155-
const searchParams = adaptSearchParams({
156-
...DEFAULT_CONTEXT,
157-
pagination: { paginationTotalHits: 20, page: 40, hitsPerPage: 6 },
139+
pagination: { page: 1, hitsPerPage: 6, finite: false },
158140
})
159141

160-
expect(searchParams.limit).toBe(20)
161-
})
162-
163-
test('adapting a searchContext with no finite pagination and pagination total hits lower than hitsPerPage', () => {
164-
const searchParams = adaptSearchParams({
165-
...DEFAULT_CONTEXT,
166-
pagination: { paginationTotalHits: 4, page: 0, hitsPerPage: 6 },
167-
})
168-
169-
expect(searchParams.limit).toBe(4)
142+
expect(searchParams.limit).toBe(7)
143+
expect(searchParams.offset).toBe(6)
170144
})
171145

172-
test('adapting a searchContext placeholderSearch set to false', () => {
146+
test('adapting a finite pagination with no placeholderSearch', () => {
173147
const searchParams = adaptSearchParams({
174148
...DEFAULT_CONTEXT,
175149
query: '',
176-
pagination: { paginationTotalHits: 4, page: 0, hitsPerPage: 6 },
150+
pagination: { page: 4, hitsPerPage: 6, finite: true },
177151
placeholderSearch: false,
178152
})
179153

180-
expect(searchParams.limit).toBe(0)
154+
expect(searchParams.page).toBe(5)
155+
expect(searchParams.hitsPerPage).toBe(0)
181156
})
182157

183-
test('adapting a searchContext placeholderSearch set to false', () => {
158+
test('adapting a scroll pagination with no placeholderSearch', () => {
184159
const searchParams = adaptSearchParams({
185160
...DEFAULT_CONTEXT,
186161
query: '',
187-
pagination: { paginationTotalHits: 200, page: 0, hitsPerPage: 6 },
188-
placeholderSearch: true,
162+
pagination: { page: 4, hitsPerPage: 6, finite: false },
163+
placeholderSearch: false,
189164
})
190165

191-
expect(searchParams.limit).toBe(7)
166+
expect(searchParams.limit).toBe(0)
167+
expect(searchParams.offset).toBe(0)
192168
})
193169
})

src/adapter/search-request-adapter/search-params-adapter.ts

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,43 @@ import {
66
} from './geo-rules-adapter'
77
import { adaptFilters } from './filter-adapter'
88

9+
function setScrollPagination(
10+
hitsPerPage: number,
11+
page: number,
12+
query?: string,
13+
placeholderSearch?: boolean
14+
): { limit: number; offset: number } {
15+
if (!placeholderSearch && query === '') {
16+
return {
17+
limit: 0,
18+
offset: 0,
19+
}
20+
}
21+
22+
return {
23+
limit: hitsPerPage + 1,
24+
offset: page * hitsPerPage,
25+
}
26+
}
27+
28+
function setFinitePagination(
29+
hitsPerPage: number,
30+
page: number,
31+
query?: string,
32+
placeholderSearch?: boolean
33+
): { hitsPerPage: number; page: number } {
34+
if (!placeholderSearch && query === '') {
35+
return {
36+
hitsPerPage: 0,
37+
page: page + 1,
38+
}
39+
} else {
40+
return {
41+
hitsPerPage: hitsPerPage,
42+
page: page + 1,
43+
}
44+
}
45+
}
946
/**
1047
* Adapts instantsearch.js and instant-meilisearch options
1148
* to meilisearch search query parameters.
@@ -29,7 +66,6 @@ export function MeiliParamsCreator(searchContext: SearchContext) {
2966
highlightPostTag,
3067
placeholderSearch,
3168
query,
32-
finitePagination,
3369
sort,
3470
pagination,
3571
matchingStrategy,
@@ -84,23 +120,24 @@ export function MeiliParamsCreator(searchContext: SearchContext) {
84120
}
85121
},
86122
addPagination() {
87-
// Limit based on pagination preferences
88-
if (
89-
(!placeholderSearch && query === '') ||
90-
pagination.paginationTotalHits === 0
91-
) {
92-
meiliSearchParams.limit = 0
93-
} else if (finitePagination) {
94-
meiliSearchParams.limit = pagination.paginationTotalHits
123+
if (pagination.finite) {
124+
const { hitsPerPage, page } = setFinitePagination(
125+
pagination.hitsPerPage,
126+
pagination.page,
127+
query,
128+
placeholderSearch
129+
)
130+
meiliSearchParams.hitsPerPage = hitsPerPage
131+
meiliSearchParams.page = page
95132
} else {
96-
const limit = (pagination.page + 1) * pagination.hitsPerPage + 1
97-
// If the limit is bigger than the total hits accepted
98-
// force the limit to that amount
99-
if (limit > pagination.paginationTotalHits) {
100-
meiliSearchParams.limit = pagination.paginationTotalHits
101-
} else {
102-
meiliSearchParams.limit = limit
103-
}
133+
const { limit, offset } = setScrollPagination(
134+
pagination.hitsPerPage,
135+
pagination.page,
136+
query,
137+
placeholderSearch
138+
)
139+
meiliSearchParams.limit = limit
140+
meiliSearchParams.offset = offset
104141
}
105142
},
106143
addSort() {

src/adapter/search-request-adapter/search-resolver.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,19 @@ export function SearchResolver(
2727
): Promise<MeiliSearchResponse<Record<string, any>>> {
2828
const { placeholderSearch, query } = searchContext
2929

30-
const { pagination } = searchContext
31-
32-
// In case we are in a `finitePagination`, only one big request is made
33-
// containing a total of max the paginationTotalHits (default: 200).
34-
// Thus we dont want the pagination to impact the cache as every
35-
// hits are already cached.
36-
const paginationCache = searchContext.finitePagination ? {} : pagination
37-
3830
// Create cache key containing a unique set of search parameters
3931
const key = cache.formatKey([
4032
searchParams,
4133
searchContext.indexUid,
4234
searchContext.query,
43-
paginationCache,
35+
searchContext.pagination,
4436
])
4537
const cachedResponse = cache.getEntry(key)
4638

4739
// Check if specific request is already cached with its associated search response.
4840
if (cachedResponse) return cachedResponse
4941

50-
const facetsCache = extractFacets(searchContext, searchParams)
42+
const cachedFacets = extractFacets(searchContext, searchParams)
5143

5244
// Make search request
5345
const searchResponse = await client
@@ -56,7 +48,7 @@ export function SearchResolver(
5648

5749
// Add missing facets back into facetDistribution
5850
searchResponse.facetDistribution = addMissingFacets(
59-
facetsCache,
51+
cachedFacets,
6052
searchResponse.facetDistribution
6153
)
6254

0 commit comments

Comments
 (0)