Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Typescript API into eclipse-zenoh #1

Merged
merged 216 commits into from
Oct 21, 2024

Conversation

Charles-Schleich
Copy link
Member

@Charles-Schleich Charles-Schleich commented Oct 1, 2024

This is a fairly large PR, To break it down and make it easier to consume.

zenoh-plugin-remote-api Is a plugin that

  1. Spawns a listenner of a Websocket server and an Admin space listener
  2. The Websocket server listens for connections and allows remote management of Zenoh Resources on the plugin.
  3. Generates at compile time a set of Typescript interface Type definitions based on the RemoteAPIMsg enum and all sub enums and structures inside.
    This set of interface definitions are consumed by the Typescript bindings

zenoh-ts Is a set of bindings to the core Zenoh functions.
Everything the user will interact with is exported via /src/index.ts
Under the hood, zenoh-ts opens a Websocket connection connecting to the zenoh-plugin-remote-api running on a zenohd instance and remotely manages resources.
If the Websocket connection disconnects, the state (Publishers/Subscribers/Queryables) of that websocket connection is dropped by the plugin and a new session on the front end will have to be opened.

The interface files generated by the zenoh-plugin-remote-api are found in zenoh-ts/src/remote-api/interface

All files inside zenoh-ts/src/remote-api/* are used to manage messages between the Websocket and the user facing API.
This includes long living resources such as Queryables and callback based Subscribers

p-avital and others added 30 commits October 11, 2023 09:28
@Charles-Schleich Charles-Schleich marked this pull request as draft October 1, 2024 15:40
@Charles-Schleich Charles-Schleich marked this pull request as ready for review October 4, 2024 16:41
Copy link
Member

@fuzzypixelz fuzzypixelz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly looked at the public TypeScript API.

zenoh-ts/src/config.ts Outdated Show resolved Hide resolved
zenoh-ts/src/encoding.ts Outdated Show resolved Hide resolved
zenoh-ts/src/encoding.ts Show resolved Hide resolved
zenoh-ts/src/config.ts Show resolved Hide resolved
zenoh-ts/src/config.ts Show resolved Hide resolved
zenoh-ts/src/session.ts Show resolved Hide resolved
zenoh-ts/src/session.ts Show resolved Hide resolved
zenoh-ts/src/session.ts Show resolved Hide resolved
zenoh-ts/src/session.ts Show resolved Hide resolved
*
* @returns Reply
*/
async receive(): Promise<Reply | RecvErr> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ought to throw an exception instead.

Only NTP64 can ensure timestamp uniqueness. RFC3339 is lossy.

This reverts commit ccbfea8.
Comment on lines +8 to +10
remote_api: {
"websocket_port": "10000",
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If TLS/mTLS is supported an example on how to configure it should be present in the config.

zenoh-ts/.npmrc Outdated Show resolved Hide resolved
Copy link
Contributor

@gabrik gabrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few things on the CI and packaging.

Overall I think the copyright year should be 2024 as the code was written this year.

.github/workflows/package-ts.yaml Outdated Show resolved Hide resolved
.github/workflows/release.yaml Show resolved Hide resolved
zenoh-ts/.npmrc Outdated Show resolved Hide resolved
zenoh-ts/package.json Outdated Show resolved Hide resolved
zenoh-ts/package.json Outdated Show resolved Hide resolved
According to the Eclipse Handbook, The copright header year is the year of the initial creation. I interpret this as the year in which the file was added to git.

https://www.eclipse.org/projects/handbook/#ip-copyright-headers
@fuzzypixelz fuzzypixelz merged commit 5e66fc2 into eclipse-zenoh:main Oct 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants