-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This offers a new path for performing attribute reads against the Node API. As discussed it is NOT fully wired yet so we can discuss first, but this PR should be ready for merge. There's significant new code here. Some of this is noise, which I detail below, but here are the main bits of new functionality to focus on: 1. packages/protocol/src/action/** - this is a new API for performing interactions that is designed for simplicity and performance - action/protocols.ts - these define a `ProtocolNode` JS contract for exposing a Matter data model in a form that efficiently maps to the wire protocol - action/server/AttributeResponse.ts - implements the attribute subset of a Read Request Action against ProtocolNode - action/Interactable.ts and request/* - an API I created to simplify construction of Matter actions. The goal was to make it easy to initiate Matter interactions for e.g. batch purposes, but with a more convenient JS API. Much of this is stubbed due to focus on read in this commit but I do use some of the type definitions 2. packages/node/src/node/server/ProtocolService.ts - implements ProtocolNode for a @matter/node Node 3. packages/behavior/state/managed/values/StructManager.ts - I updated struct manager to generate ID-based getters and setters. This means that where state values are associated with a Matter element that has an ID you can use `state[id]` and `state.name` interchangeably. I had done this to support attributes that are not in the schema but it also allows us to map protocol queries against state objects without performing name lookup It became apparent as I was working through this that the code was going to be too @matter/node specific unless I performed some code reorganization. Unfortunately that adds noise to the commit but I think it's worthwhile. Moved modules include: - node/src/behavior/state/transaction -> general/src/transaction - node/src/behavior/state/Val.ts -> protocol/src/action - node/src/behavior/errors.ts -> protocol/src/action - node/src/behavior/AccessControl.ts -> protocol/src/action/server Also unfortunate... I encountered a Mocha bug while developing this that indicated there were import cycles. I added a "matter-build cycles" command to detect cycles and fixed all cycles in the node package, but this ended up changing a bunch of extra files that are now hard to disentangle from the commit.
- Loading branch information
Showing
182 changed files
with
4,347 additions
and
1,542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @license | ||
* Copyright 2022-2025 Matter.js Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from "./errors.js"; | ||
export * from "./Transaction.js"; |
Oops, something went wrong.