Skip to content

Commit

Permalink
Merge #871 #872 #873
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
5 people authored Nov 28, 2022
4 parents ea9a3db + d8c62fc + 0bcfc73 + 80d6abf commit 5e55752
Show file tree
Hide file tree
Showing 21 changed files with 687 additions and 499 deletions.
32 changes: 6 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ const searchClient = instantMeiliSearch(
`instant-meilisearch` offers some options you can set to further fit your needs.

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

### Pagination total hits

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>

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`.

Usage:

```js
{ paginationTotalHits: 50 } // default: 200
```

`hitsPerPage` has a value of `20` by default and can [be customized](#-hitsperpage).

### Finite Pagination

Finite pagination is used when you want to add a numbered pagination at the bottom of your hits (for example: `<< < 1, 2, 3 > >>`).
To be able to know the amount of page numbers you have, a search is done requesting `paginationTotalHits` documents (default: `200`).
With the amount of documents returned, instantsearch is able to render the correct amount of numbers in the pagination widget.

It requires the usage of the [`Pagination` widget](#-pagination).

Example:

```js
{ finitePagination: true } // default: false
```

⚠️ 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>
More information about Meilisearch and the pagination [here](https://github.com/meilisearch/documentation/issues/561).

### Primary key

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

**Supported Meilisearch versions**:

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

**Node / NPM versions**:

Expand Down Expand Up @@ -925,9 +907,7 @@ instantsearch.widgets.clearRefinements({

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

The `pagination` widget displays a pagination system allowing the user to change the current page.

We do not recommend using this widget as pagination slows the search responses. Instead, the [InfiniteHits](#-infinitehits) component is recommended.
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.

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

<hr>

**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.
**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.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
"url": "https://github.com/meilisearch/instant-meilisearch.git"
},
"dependencies": {
"meilisearch": "^0.28.0"
"meilisearch": "^0.30.0"
},
"devDependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.18.13",
"@babel/preset-env": "^7.19.4",
"@babel/preset-env": "^7.20.2",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@types/jest": "^27.0.2",
Expand Down Expand Up @@ -103,7 +103,7 @@
"rollup-plugin-typescript2": "^0.32.1",
"shx": "^0.3.3",
"ts-jest": "^27.0.7",
"tslib": "^2.4.0",
"tslib": "^2.4.1",
"typescript": "^4.8.4"
}
}
1 change: 0 additions & 1 deletion playgrounds/react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const searchClient = instantMeiliSearch(
'https://integration-demos.meilisearch.com',
'99d1e034ed32eb569f9edc27962cccf90b736e4c5a70f7f5e76b9fab54d6a185',
{
paginationTotalHits: 60,
primaryKey: 'id',
}
)
Expand Down
66 changes: 21 additions & 45 deletions src/adapter/search-request-adapter/__tests__/search-params.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { MatchingStrategies } from '../../../types'

const DEFAULT_CONTEXT = {
indexUid: 'test',
pagination: { paginationTotalHits: 20, page: 0, hitsPerPage: 6 },
pagination: { page: 0, hitsPerPage: 6, finite: false },
defaultFacetDistribution: {},
finitePagination: false,
}

describe('Parameters adapter', () => {
Expand Down Expand Up @@ -108,86 +107,63 @@ describe('Pagination adapter', () => {
test('adapting a searchContext with finite pagination', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
finitePagination: true,
pagination: { page: 0, hitsPerPage: 6, finite: true },
})

expect(searchParams.limit).toBe(20)
expect(searchParams.page).toBe(1)
expect(searchParams.hitsPerPage).toBe(6)
})

test('adapting a searchContext with finite pagination on a later page', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
pagination: { paginationTotalHits: 20, page: 10, hitsPerPage: 6 },
finitePagination: true,
pagination: { page: 10, hitsPerPage: 6, finite: true },
})

expect(searchParams.limit).toBe(20)
expect(searchParams.page).toBe(11)
expect(searchParams.hitsPerPage).toBe(6)
})

test('adapting a searchContext with finite pagination and pagination total hits lower than hitsPerPage', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
pagination: { paginationTotalHits: 4, page: 0, hitsPerPage: 6 },
finitePagination: true,
})

expect(searchParams.limit).toBe(4)
})

test('adapting a searchContext with no finite pagination', () => {
test('adapting a searchContext with no finite pagination on page 1', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
})

expect(searchParams.limit).toBe(7)
expect(searchParams.offset).toBe(0)
})

test('adapting a searchContext with no finite pagination on page 2', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
pagination: { paginationTotalHits: 20, page: 1, hitsPerPage: 6 },
})

expect(searchParams.limit).toBe(13)
})

test('adapting a searchContext with no finite pagination on page higher than paginationTotalHits', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
pagination: { paginationTotalHits: 20, page: 40, hitsPerPage: 6 },
pagination: { page: 1, hitsPerPage: 6, finite: false },
})

expect(searchParams.limit).toBe(20)
})

test('adapting a searchContext with no finite pagination and pagination total hits lower than hitsPerPage', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
pagination: { paginationTotalHits: 4, page: 0, hitsPerPage: 6 },
})

expect(searchParams.limit).toBe(4)
expect(searchParams.limit).toBe(7)
expect(searchParams.offset).toBe(6)
})

test('adapting a searchContext placeholderSearch set to false', () => {
test('adapting a finite pagination with no placeholderSearch', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
query: '',
pagination: { paginationTotalHits: 4, page: 0, hitsPerPage: 6 },
pagination: { page: 4, hitsPerPage: 6, finite: true },
placeholderSearch: false,
})

expect(searchParams.limit).toBe(0)
expect(searchParams.page).toBe(5)
expect(searchParams.hitsPerPage).toBe(0)
})

test('adapting a searchContext placeholderSearch set to false', () => {
test('adapting a scroll pagination with no placeholderSearch', () => {
const searchParams = adaptSearchParams({
...DEFAULT_CONTEXT,
query: '',
pagination: { paginationTotalHits: 200, page: 0, hitsPerPage: 6 },
placeholderSearch: true,
pagination: { page: 4, hitsPerPage: 6, finite: false },
placeholderSearch: false,
})

expect(searchParams.limit).toBe(7)
expect(searchParams.limit).toBe(0)
expect(searchParams.offset).toBe(0)
})
})
71 changes: 54 additions & 17 deletions src/adapter/search-request-adapter/search-params-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,43 @@ import {
} from './geo-rules-adapter'
import { adaptFilters } from './filter-adapter'

function setScrollPagination(
hitsPerPage: number,
page: number,
query?: string,
placeholderSearch?: boolean
): { limit: number; offset: number } {
if (!placeholderSearch && query === '') {
return {
limit: 0,
offset: 0,
}
}

return {
limit: hitsPerPage + 1,
offset: page * hitsPerPage,
}
}

function setFinitePagination(
hitsPerPage: number,
page: number,
query?: string,
placeholderSearch?: boolean
): { hitsPerPage: number; page: number } {
if (!placeholderSearch && query === '') {
return {
hitsPerPage: 0,
page: page + 1,
}
} else {
return {
hitsPerPage: hitsPerPage,
page: page + 1,
}
}
}
/**
* Adapts instantsearch.js and instant-meilisearch options
* to meilisearch search query parameters.
Expand All @@ -29,7 +66,6 @@ export function MeiliParamsCreator(searchContext: SearchContext) {
highlightPostTag,
placeholderSearch,
query,
finitePagination,
sort,
pagination,
matchingStrategy,
Expand Down Expand Up @@ -84,23 +120,24 @@ export function MeiliParamsCreator(searchContext: SearchContext) {
}
},
addPagination() {
// Limit based on pagination preferences
if (
(!placeholderSearch && query === '') ||
pagination.paginationTotalHits === 0
) {
meiliSearchParams.limit = 0
} else if (finitePagination) {
meiliSearchParams.limit = pagination.paginationTotalHits
if (pagination.finite) {
const { hitsPerPage, page } = setFinitePagination(
pagination.hitsPerPage,
pagination.page,
query,
placeholderSearch
)
meiliSearchParams.hitsPerPage = hitsPerPage
meiliSearchParams.page = page
} else {
const limit = (pagination.page + 1) * pagination.hitsPerPage + 1
// If the limit is bigger than the total hits accepted
// force the limit to that amount
if (limit > pagination.paginationTotalHits) {
meiliSearchParams.limit = pagination.paginationTotalHits
} else {
meiliSearchParams.limit = limit
}
const { limit, offset } = setScrollPagination(
pagination.hitsPerPage,
pagination.page,
query,
placeholderSearch
)
meiliSearchParams.limit = limit
meiliSearchParams.offset = offset
}
},
addSort() {
Expand Down
14 changes: 3 additions & 11 deletions src/adapter/search-request-adapter/search-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,19 @@ export function SearchResolver(
): Promise<MeiliSearchResponse<Record<string, any>>> {
const { placeholderSearch, query } = searchContext

const { pagination } = searchContext

// In case we are in a `finitePagination`, only one big request is made
// containing a total of max the paginationTotalHits (default: 200).
// Thus we dont want the pagination to impact the cache as every
// hits are already cached.
const paginationCache = searchContext.finitePagination ? {} : pagination

// Create cache key containing a unique set of search parameters
const key = cache.formatKey([
searchParams,
searchContext.indexUid,
searchContext.query,
paginationCache,
searchContext.pagination,
])
const cachedResponse = cache.getEntry(key)

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

const facetsCache = extractFacets(searchContext, searchParams)
const cachedFacets = extractFacets(searchContext, searchParams)

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

// Add missing facets back into facetDistribution
searchResponse.facetDistribution = addMissingFacets(
facetsCache,
cachedFacets,
searchResponse.facetDistribution
)

Expand Down
Loading

0 comments on commit 5e55752

Please sign in to comment.