Skip to content

Svelte 5: default values should be readonly #9763

@Rich-Harris

Description

@Rich-Harris

Describe the bug

As of #9739, props are readonly (unless used with bind:). By extension, default values should also be readonly (enforced at dev time).

At present, that doesn't happen — default values can be mutated, but it's not reflected anywhere

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE42P0WrDMAxFf0WYQVNWkvXVrQNjn7HsYXWczZ1jGVsZDON_n-1AKbQPRS--8tXRVWSTNiow_h6Z_ZwV4-zVObZj9OeKCL_KkMo64OJl6RyD9NpRP1gAPTv0BG_f2owweZxh03ZVtevg5jDYY3eZyGL1dn1GzjjqSauRcfKLSrtLgup5LMNARhFEwNNZSQKRnxIXSxxeIOUS8OQ8utBsb5KcFiK0gFYaLX9EbLYgeoiFudLaSoJnAftD6Uq0AY1qDX41146CTqmGqajAIV7_p7J53Xbn7I_0D3kxjdKEAQAA

Logs

No response

System Info

next

Severity

annoyance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions