Skip to content

Commit

Permalink
Fix missing attributes and event listeners on root receiver elements
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonmade committed Dec 4, 2024
1 parent c917461 commit 807db10
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/wet-mirrors-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@remote-dom/signals': patch
'@remote-dom/core': patch
---

Fix missing attributes and event listeners on root receiver elements
6 changes: 6 additions & 0 deletions packages/core/source/receivers/RemoteReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export interface RemoteReceiverRoot {
readonly type: typeof NODE_TYPE_ROOT;
readonly children: readonly RemoteReceiverNode[];
readonly properties: NonNullable<RemoteElementSerialization['properties']>;
readonly attributes: NonNullable<RemoteElementSerialization['attributes']>;
readonly eventListeners: NonNullable<
RemoteElementSerialization['eventListeners']
>;
readonly version: number;
}

Expand Down Expand Up @@ -102,6 +106,8 @@ export class RemoteReceiver {
children: [],
version: 0,
properties: {},
attributes: {},
eventListeners: {},
};

/**
Expand Down
8 changes: 8 additions & 0 deletions packages/signals/source/SignalRemoteReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ export interface SignalRemoteReceiverRoot {
readonly properties: ReadonlySignal<
NonNullable<RemoteElementSerialization['properties']>
>;
readonly attributes: ReadonlySignal<
NonNullable<RemoteElementSerialization['attributes']>
>;
readonly eventListeners: ReadonlySignal<
NonNullable<RemoteElementSerialization['eventListeners']>
>;
readonly children: ReadonlySignal<readonly SignalRemoteReceiverNode[]>;
}

Expand Down Expand Up @@ -111,6 +117,8 @@ export class SignalRemoteReceiver {
id: ROOT_ID,
type: NODE_TYPE_ROOT,
properties: signal({}),
attributes: signal({}),
eventListeners: signal({}),
children: signal([]),
};

Expand Down

0 comments on commit 807db10

Please sign in to comment.