fix: implement ref counting for mount with same target#17695
fix: implement ref counting for mount with same target#17695Rich-Harris merged 5 commits intosveltejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 23cedac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Rich-Harris
left a comment
There was a problem hiding this comment.
thank you — the fix is correct, though we can reuse the map between target and document so I tweaked that.
Finding it curiously different to create a suitable test for this — the one in #17694 is too complicated to whittle down because it uses bits-ui, and the one in #17492 uses Svelte 4 stuff that will eventually go away (and stops failing if converted to Svelte 5), but a regression seems very unlikely so in this case, 🤷
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## svelte@5.51.0 ### Minor Changes - feat: Use `TrustedTypes` for HTML handling where supported ([#16271](#16271)) ### Patch Changes - fix: sanitize template-literal-special-characters in SSR attribute values ([#17692](#17692)) - fix: follow-up formatting in `print()` — flush block-level elements into separate sequences ([#17699](#17699)) - fix: preserve delegated event handlers as long as one or more root components are using them ([#17695](#17695)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Would it be reasonable to maybe add an internal __property that contains the count map instead as a performance optimization? |
|
This isn't hot code — in most apps there'll only be a single |
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lintFixes #17694
Not really sure how to add a failing test here.
The code was generated by Codex 5.3, but I cleaned it up and manually reviewed it myself. Not sure if this is the best approach to solving the issue, though. It does add some overhead with the extra maps.