devtools/packages/devtools-utils/tsconfig.json
Alem Tuzlak d7c5a93710
feat: add Svelte 5 adapter and devtools-utils Svelte factories (#366)
* docs: add Svelte devtools adapter design doc

* docs: add Svelte devtools implementation plan

* feat(svelte-devtools): add Svelte 5 adapter package

* feat(devtools-utils): add Svelte factory functions and build config

* fix: resolve knip issues and update svelte vite plugin to v6

* docs: add Svelte documentation

* chore: add changeset for Svelte adapter

* ci: apply automated fixes

* fix(svelte-devtools): mount once and tear down stale plugin components on update

- Mount the core exactly once: untrack props in the mount $effect so a prop
  change no longer destroys and rebuilds the entire devtools core (the update
  $effect already handles config/plugin changes reactively).
- update() now calls destroyAllComponents() before setConfig(), matching the
  Angular adapter — the core re-invokes render/name for the new plugin set, so
  without this the previous Svelte instances were orphaned and leaked.
- renderComponent() keys mounted components by container.id directly (the core
  always assigns one) instead of an empty-string fallback that could never be
  matched on destroy.
- vite.config: cast svelte() plugin as any, matching the vue/solid configs, to
  satisfy the vite 8 plugin types.

* chore(devtools-utils): add svelte devDependency for the svelte subpath build

The `./svelte` build type-checks svelte-importing source, so svelte must be
resolvable at build time (mirroring vite-plugin-solid for the solid build)
rather than relying on workspace hoisting of the optional peer.

* test(devtools-utils): cover svelte plugin and panel factories

Mirrors the existing solid class factory tests: createSveltePlugin shape +
NoOp behavior, and createSveltePanel mounting/tearing down a class-based core.

* ci: apply automated fixes

* refactor(devtools-utils): make createSveltePlugin generic over component props

Threads a TComponentProps generic through the svelte plugin factory (mirroring
createVuePlugin) so plugin props are type-checked against the component instead
of falling back to `any`. Addresses PR review feedback.

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-23 11:12:54 +02:00

19 lines
375 B