Open slorber opened 1 month ago
I think you need to amend your commit and push again based on this rules 😉 https://github.com/cmfcmf/docusaurus-search-local/blob/main/CONTRIBUTING.md#commit-message-guidelines probably adding fix(deps):
at the start should do
Well summed up @slorber
Pinning the version to the RC is a viable workaround. Nevertheless, the real fix in order to use v1.0.0 of cheerio is also fairly easy (see: https://github.com/cmfcmf/docusaurus-search-local/issues/219).
Instead of using cheerio.default.load(...)
, this just needs to be changed to cheerio.load(...)
(so just removing the usage of "default").
According to my tests, everything works fine with this change (which BTW is also used in other parts of the docusaurus-search-local plugin).
Yes, that would also work but you'd have to also change deps to ensure all RC users upgrade to v1.0 stable
v1.0 stable only works for Node 18.17+ and Docusaurus v3 has support for 18.0. If you upgrade Cheerio to v1.0 stable, you also ask your users to potentially upgrade Node, which is a breaking change.
My suggestion is to release this PR as a minor/patch, and then upgrade Cheerio in the next major, mentioning it requires upgrading Node.
Cheerio just released v1.0.0 after 7 years of RC
https://cheerio.js.org/blog/cheerio-1.0
The only problem is that RC users used semver ranges (
^
) and the 1.0 is not retro-compatible with the latest RC.12, published 2 years agoNotably:
import * as Cheerio from 'cheerio'
instead ofimport Cheerio from 'cheerio'
Docusaurus users installing this plugin will now get Cheerio v1.0, and the following error:
A temporary solution: fix the Cheerio version to rc.12 in this lib so that users never use Cheerio v1.0, until you fix the problems, or Cheerio adds back retrocompatibility.
Until this PR gets merged/released, users will have to force resolution to rc.12 on their side using their package managers features.
For example, Yarn users can do: