Conversation
In order to support embedding Canva designs on the tldraw canvas (closes #6473), this PR adds Canva as a recognized embed type alongside Figma, Google Maps, YouTube, and others. Canva design URLs matching `canva.com/design/<id>/<slug>` are detected and converted to embeddable iframes by appending the `?embed` query parameter. The reverse conversion (`fromEmbedUrl`) strips the parameter to recover the original share URL. - [ ] Get Canva logo ### Change type - [x] `feature` ### Test plan 1. Paste a Canva design URL (e.g. `https://www.canva.com/design/DAFrLlkQu3Q/view`) onto the canvas 2. Verify an embed shape is created with the Canva design rendered inside an iframe 3. Verify that non-design Canva URLs (e.g. `https://www.canva.com/templates`) are not converted to embeds - [x] Unit tests ### Release notes - Add Canva as a supported embed type. Pasting a Canva design URL now creates an embedded iframe on the canvas. ### API changes - Added `canva` to `DEFAULT_EMBED_DEFINITIONS` with `type: 'canva'`, `hostnames: ['canva.com']` ### Code changes | Section | LOC change | | --------------- | ---------- | | Core code | +33 / -0 | | Tests | +46 / -0 | | Automated files | +17 / -0 |
…eak (#8476) In order to fix a memory leak where unmounted `Editor` instances were retained via `window.__tldraw__hardReset`, this PR removes the global window assignments from `hardReset.ts` and has `runtime.hardReset()` call `hardReset` directly instead of dispatching through `window.__tldraw__hardReset`. The global was capturing the module scope (including a debounced `updateHoveredShapeId` closure that held `getContainer` → `Editor`), causing ~5.9 MB to be retained per editor after unmount. Closes #8430. ### Change type - [x] `bugfix` ### Test plan 1. Mount a tldraw editor, then unmount it. 2. Take a heap snapshot and confirm the `Editor` instance is no longer retained via `Window.__tldraw__hardReset`. 3. Verify `editor.hardReset()` (via `runtime.hardReset()`) still clears local data and reloads. ### Release notes - Fix a memory leak where `Editor` instances were retained after unmount via the `window.__tldraw__hardReset` global.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )