Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/seven-flies-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: correctly transform `$derived` private fields on server
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import * as b from '#compiler/builders';
* @param {Context} context
*/
export function MemberExpression(node, context) {
if (
context.state.analysis.runes &&
node.object.type === 'ThisExpression' &&
node.property.type === 'PrivateIdentifier'
) {
if (context.state.analysis.runes && node.property.type === 'PrivateIdentifier') {
const field = context.state.state_fields?.get(`#${node.property.name}`);

if (field?.type === '$derived' || field?.type === '$derived.by') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
}

get embiggened1() {
return this.#doubled;
const self = this;
return self.#doubled;
}

get embiggened2() {
Expand Down
Loading