Skip to content

Svelte 5: Several circular dependencies in client runtime modules #10140

Open
@Conduitry

Description

@Conduitry

Describe the bug

Not a bug, per se, but there are several circular dependencies among various files in the browser runtime. Here are a few that I observed in a project. There may be others that present themselves if you use more of Svelte's runtime.

svelte/src/internal/client/each.js -> svelte/src/internal/client/render.js -> svelte/src/internal/client/transitions.js -> svelte/src/internal/client/each.js
svelte/src/internal/client/proxy/readonly.js -> svelte/src/internal/client/proxy/proxy.js -> svelte/src/internal/client/proxy/readonly.js
svelte/src/internal/client/render.js -> svelte/src/internal/client/transitions.js -> svelte/src/internal/client/render.js
svelte/src/internal/client/runtime.js -> svelte/src/internal/client/block.js -> svelte/src/internal/client/runtime.js
svelte/src/internal/client/runtime.js -> svelte/src/internal/client/proxy/readonly.js -> svelte/src/internal/client/proxy/proxy.js -> svelte/src/internal/client/runtime.js
svelte/src/internal/index.js -> svelte/src/internal/client/custom-element.js -> svelte/src/legacy/legacy-client.js -> svelte/src/internal/index.js

If it comes down to it, I suppose we could suppress these warnings in our official tooling, but it would be nicer not to have the cycles at all if possible, for people with a more homegrown setup.

Reproduction

Attempt to bundle a Svelte 5 app directly with Rollup rather some other higher level tool, without suppressing CIRCULAR_DEPENDENCY warnings, and observe them at build time.

Logs

No response

System Info

n/a

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    runtimeChanges relating to runtime APIs

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions