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(NOJIRA-123): Prevent loading live embed multiple times #668

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Conversation

mathio
Copy link
Contributor

@mathio mathio commented Nov 20, 2024

When the SDK is included multiple times, live embeds get loaded multiple times because they are loaded async. Customers may end up with multiple embed.js scripts in their website when they copy-paste multiple embed snippets into one page.

The issue is most visible when the embedded form opens automatically, eg. on load, as reported in this community thread.

@mathio mathio requested a review from a team November 20, 2024 08:54
Thr44
Thr44 previously approved these changes Nov 20, 2024
@typeform-ops-gha
Copy link

[BOT] Preview available with hash fa685c52d659ee4dd0acd7222149af41c5dbadba here.

Copy link

sonarcloud bot commented Nov 20, 2024

Copy link

gitstream-cm bot commented Nov 20, 2024

🥷 Code experts: gierlas, mumpo

gierlas, mumpo have most 🧠 knowledge in the files.

See details

packages/demo-html/public/live-embed.html

Knowledge based on git-blame:
gierlas: 97%
mumpo: 3%

packages/embed/e2e/spec/functional/live-embed.cy.ts

Knowledge based on git-blame:
gierlas: 74%
mumpo: 26%

packages/embed/src/initializers/initialize-live-embeds.ts

Knowledge based on git-blame:
gierlas: 55%
mumpo: 45%

To learn more about /:\ gitStream - Visit our Docs

@mathio mathio merged commit ac398e0 into main Nov 20, 2024
17 checks passed
@mathio mathio deleted the live-embed branch November 20, 2024 13:41
typeform-ops-gha pushed a commit that referenced this pull request Nov 20, 2024
# [@typeform/embed-v5.2.0](https://github.com/Typeform/embed/compare/@typeform/embed-v5.1.0...@typeform/embed-v5.2.0) (2024-11-20)

### Bug Fixes

* **NOJIRA-123:** Prevent loading live embed multiple times ([#668](#668)) ([ac398e0](ac398e0))

### Features

* **TU-17542:** Update docs on sandbox mode ([#664](#664)) ([be89ed2](be89ed2)), closes [#662](#662)
@typeform-ops-gha
Copy link

🎉 This PR is included in version @typeform/embed-v5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants