algolia / algolia/ui-components

[@algolia/ui-components-horizontal-slider-js] `horizontalSlider` not working with `recommend-js` in UMD

Open
#1 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Description

When using `ui-components-horizontal-slider-js` with `recommend-js` and both libraries are loaded in UMD, they both import their own bundled version of Preact. Even if the version is the same, the fact that each function uses a different instance of Preact breaks the app.

## Reproduction

[**Preview →**](https://codesandbox.io/s/boring-feistel-nctlj3?file=/src/index.js)

**Steps**

1. Visit the sandbox
2. See the runtime error

## Expected behavior

The app should run normally.

## Suggested fix

If `recommend-js` was providing `createElement` and `Fragment` in `view` and that `ui-components-horizontal-slider-js` accepted a renderer (like `autocomplete-js`) we could bind the same instance of Preact, which should work.

## Environment

- OS: macOS Monterey 12.3.1
- Browser: Firefox 99.0.1
- Library version: @algolia/ui-components-horizontal-slider-js 1.0.0 / @algolia/recommend-js 1.3.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.