Skip to content

Pr/contentbrowser lazy svelte - #1643

Draft
MrTango wants to merge 5 commits into
masterfrom
pr/contentbrowser-lazy-svelte
Draft

MrTango wants to merge 5 commits into
masterfrom
pr/contentbrowser-lazy-svelte

Conversation

@MrTango

@MrTango MrTango commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…ration

The registration module statically imported the svelte runtime
(import { mount } from "svelte") and @plone/registry, even though the
.svelte apps themselves are already loaded through dynamic imports. That
pulled the whole runtime (~110KB min) into the eager patterns chunk, loaded
on every page whether or not a content browser is on it.

Move the svelte import into the dynamic-import path already present in
init(), next to the existing await import("./src/App.svelte"), and the
@plone/registry import into register_default_components().
Same as for pat-contentbrowser: the registration module statically imported
the svelte runtime, putting it in the eager patterns chunk on every page.
Move the import into the dynamic-import path already present in init(),
next to the existing await import("./src/App.svelte").
…ved target

When a JS framework host unmounts the content browser after a selection, the
Svelte app kept running and writing selection state into an input that had
already been removed.

- destroy() now unmounts the Svelte app (so its reactive effects stop) and
  removes the browser node
- setNodeValue() bails out when the target input node is gone

This branch has not been deployed

No deployments
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.

1 participant