Skip to content

page.data mutable in legacy mode #13178

Open
@henrykrinkle01

Description

@henrykrinkle01

Describe the bug

I found that the new page.data is mutable in legacy mode but not in rune mode.

Reproduction

Can't import from the new '$app/state` module in Sveltelab for unknown reasons (Kit updated). So here is the code:

//+page.server.ts
export async function load() {
    return { random: Math.random() }
}
<script lang="ts">
	import { page } from '$app/state';
</script>

{page.data.random}
<button onclick={() => page.data.random++}> Increment </button>

Logs

No response

System Info

N/A

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions