typesense / docusaurus-theme-search-typesense

A fork of the awesome @docusaurus/theme-search-algolia library customized to work with Typesense
https://typesense.org/docs/guide/docsearch.html
MIT License
67 stars 15 forks source link

"Please use snake_cased versions" warning #11

Closed octogonz closed 2 years ago

octogonz commented 2 years ago

Description

After upgrading to Docusaurus 2.0.0-beta.17, I now see this warning during the build:

[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in 
additionalSearchParameters instead of camelCased parameters. 
For example: Use query_by instead of queryBy. camelCased parameters will be 
deprecated in a future version. We're making this change so that parameter names 
are identical to the ones sent to Typesense (which are all snake_cased), and to also keep 
the types for these parameters in sync with the types defined in typesense-js.
√ Client: Compiled successfully in 4.70m
√ Server: Compiled successfully in 4.71m

My repo does not configure additionalSearchParameters anywhere.

I think the problem is caused by docusaurus-theme-search-typesense:

https://github.com/typesense/docusaurus-theme-search-typesense/blob/51b7a16f0646f38cebb9affe0bea42d5cb1e9d77/src/theme/SearchPage/index.js#L174-L179

Should we just make a PR to rename queryBy to query_by?

Metadata

Typsense Version: docusaurus-theme-search-typesense@0.3.0

OS: Windows

octogonz commented 2 years ago

Looks like this change was introduced in typesense-instantsearch-adapter issue #85 (bdea259) and released with typesense-instantsearch-adapter@2.4.0.

As a temporary workaround, I was able to eliminate the warning by forcing installation of typesense-instantsearch-adapter@2.3.0.

jasonbosco commented 2 years ago

@octogonz Thank you for catching this.

I've pushed out a fix for this in 0.4.0-2. Could you give it a shot now?

octogonz commented 2 years ago

@jasonbosco thank you! We've confirmed that 0.4.0-2 fixes the problem. 👍