Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(insights): keep track of script loading in global #5551

Merged
merged 5 commits into from Mar 20, 2023

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Mar 16, 2023

Summary

This is needed for example in StrictMode with React InstantSearch Hooks, where there are two InstantSearch instances, but the first one never gets started.

Before this PR, the "should load script" was linked to "should add window.aa", but that doesn't necessarily correspond if start is never called on that instance.

Result

insights client loads in strict mode

This is needed for example in StrictMode with React InstantSearch Hooks, where there are two InstantSearch instances, but the first one never gets started.

Before this PR, the "should load script" was linked to "should add window.aa", but that doesn't necessarily correspond if `start` is never called on that instance.
@Haroenv Haroenv requested review from a team, sarahdayan and aymeric-giraudet and removed request for a team March 16, 2023 15:23
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 16, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7b8c0e4:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-hooks-default-theme Configuration
example-vue-instantsearch-default-theme Configuration

@Haroenv Haroenv requested a review from sarahdayan March 20, 2023 09:07
@Haroenv Haroenv requested a review from sarahdayan March 20, 2023 13:56
@Haroenv Haroenv merged commit 222c8b7 into feat/automatic-insights Mar 20, 2023
@Haroenv Haroenv deleted the fix/insights-load-script branch March 20, 2023 15:15
Haroenv added a commit that referenced this pull request Apr 18, 2023
* fix(insights): keep track of script loading in global

This is needed for example in StrictMode with React InstantSearch Hooks, where there are two InstantSearch instances, but the first one never gets started.

Before this PR, the "should load script" was linked to "should add window.aa", but that doesn't necessarily correspond if `start` is never called on that instance.

* tests

* whoops!

* whoops

* updates
Haroenv added a commit that referenced this pull request Apr 24, 2023
* fix(insights): keep track of script loading in global

This is needed for example in StrictMode with React InstantSearch Hooks, where there are two InstantSearch instances, but the first one never gets started.

Before this PR, the "should load script" was linked to "should add window.aa", but that doesn't necessarily correspond if `start` is never called on that instance.

* tests

* whoops!

* whoops

* updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants