typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
MIT License
360 stars 62 forks source link

Incompatibility with WordPress 6.6 RC1 #210

Open elzadj opened 4 days ago

elzadj commented 4 days ago

Description

Looks like typesense-instantsearch-adapter 2.8.0 doesn't work on WordPress 6.6 RC1. 2.9.0-3 has the same problem. Please refer to this issue https://github.com/WordPress/gutenberg/issues/62923#issuecomment-2199915867

Our plugin where we use typesense: https://github.com/maxi-blocks/maxi-blocks https://wordpress.org/plugins/maxi-blocks/

Steps to reproduce

Try to use typesense-instantsearch-adapter 2.8.0 / 2.9.0-3 on WordPress 6.6RC1

Expected Behavior

Same as on WordPress 6.5.5: screenshot-maxithemedev dev600 com-2024 07 01-14_51_44

Actual Behavior

The Template Library block crashes with

loadable.esm.mjs:377 Uncaught 
TypeError: Cannot read properties of undefined (reading 'mark')
    at SearchRequestAdapter.js:518:1
    at SearchRequestAdapter.js:545:6
    at ./node_modules/typesense-instantsearch-adapter/lib/SearchRequestAdapter.js (SearchRequestAdapter.js:563:2)
    at __webpack_require__ (bootstrap:19:1)
    at ./node_modules/typesense-instantsearch-adapter/lib/TypesenseInstantsearchAdapter.js (TypesenseInstantsearchAdapter.js:22:29)
    at __webpack_require__ (bootstrap:19:1)
    at ./src/editor/library/container.js (MasonryItem.js:203:27)
    at Function.__webpack_require__ (bootstrap:19:1)

Screenshot from 2024-07-01 14-49-43

Metadata

React 18.3.1 Node v20.11.1 PHP 8.2.20

List of all packages we use in our plugin:

├── @babel/plugin-proposal-class-properties@7.18.6 ├── @babel/plugin-proposal-object-rest-spread@7.20.7 ├── @babel/plugin-syntax-object-rest-spread@7.8.3 ├── @babel/plugin-transform-spread@7.24.7 ├── @babel/traverse@7.24.7 ├── @floating-ui/react-dom@2.1.1 ├── @langchain/openai@0.0.23 ├── @loadable/component@5.16.4 ├── @prettier/plugin-php@0.22.2 ├── @uiw/react-textarea-code-editor@3.0.2 ├── @wordpress/babel-preset-default@7.42.0 ├── @wordpress/base-styles@5.2.0 ├── @wordpress/block-editor@13.2.0 ├── @wordpress/blocks@13.2.0 ├── @wordpress/components@28.2.0 ├── @wordpress/compose@7.2.0 ├── @wordpress/data@10.2.0 ├── @wordpress/e2e-test-utils@11.2.0 ├── @wordpress/editor@14.2.0 ├── @wordpress/element@6.2.0 ├── @wordpress/env@10.2.0 ├── @wordpress/hooks@4.2.0 ├── @wordpress/i18n@5.2.0 ├── @wordpress/icons@10.2.0 ├── @wordpress/jest-preset-default@12.2.0 ├── @wordpress/primitives@4.2.0 ├── @wordpress/rich-text@7.2.0 ├── @wordpress/scripts@27.9.0 ├── babel-eslint@10.1.0 ├── babel-preset-react@6.24.1 ├── bezier-easing-editor@0.8.0 ├── caniuse-lite@1.0.30001639 ├── classnames@2.5.1 ├── css-minimizer-webpack-plugin@7.0.0 ├── css-to-react-native@3.2.0 ├── deep-object-diff@1.1.9 ├── dompurify@3.1.5 ├── dotenv-webpack@8.1.0 ├── enzyme@3.11.0 ├── eslint-config-airbnb@19.0.4 ├── eslint-config-prettier@9.1.0 ├── eslint-plugin-import@2.29.1 ├── eslint-plugin-jsx-a11y@6.9.0 ├── eslint-plugin-prettier@5.1.3 ├── eslint-plugin-react-hooks@4.6.2 ├── eslint-plugin-react@7.34.3 ├── eslint@8.57.0 ├── html-react-parser@5.1.10 ├── is-mobile@4.0.0 ├── jest-canvas-mock@2.5.2 ├── langchain@0.1.37 ├── leaflet@1.9.4 ├── masonry-layout@4.2.2 ├── minify-css-string@1.0.0 ├── prettier@3.3.2 ├── re-resizable@6.9.17 ├── react-accessible-accordion@5.0.0 ├── react-color@2.19.3 ├── react-compound-slider@3.4.0 ├── react-drag-listview@2.0.0 ├── react-icons@5.2.1 ├── react-iframe@1.8.5 ├── react-image-crop@11.0.5 ├── react-inlinesvg@4.1.3 ├── react-instantsearch-dom@6.40.4 ├── react-instantsearch@7.11.4 ├── react-lazy-load@4.0.1 ├── react-leaflet-google-layer@2.2.0 ├── react-leaflet@4.2.1 ├── react-linear-gradient-picker@3.0.1 ├── react-lorem-ipsum@1.4.10 ├── react-paginate@8.2.0 ├── react-select@5.8.0 ├── react-slider@2.0.6 ├── react-spinners@0.14.1 ├── react-tilt@1.0.2 ├── tilt.js@1.2.1 ├── tinycolor2@1.6.0 ├── typesense-instantsearch-adapter@2.8.0 ├── typesense@1.8.2 ├── uuid@10.0.0 ├── w3c-css-validator@1.3.2 └── webpack-bundle-analyzer@4.10.2

elzadj commented 4 days ago

Note: loading the src version of the script helps, but can we expect a version that doesn't need polyfill in the future, since WP decided to remove it from the default dependencies? Or should we try to add wp-polyfil manually?