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

Evaluate wot-typescript-definitions as dependency #19

Open
relu91 opened this issue Jul 9, 2021 · 3 comments
Open

Evaluate wot-typescript-definitions as dependency #19

relu91 opened this issue Jul 9, 2021 · 3 comments

Comments

@relu91
Copy link
Contributor

relu91 commented Jul 9, 2021

As mentioned in WebThingsIO/gateway#2806 (comment) W3C now publish the official schema and its corrective Typescript types in a npm package. I was wondering if, in the near future, it would be better for the addons and the gateway to depend upon this official schema rather than the one defined here.

@relu91
Copy link
Contributor Author

relu91 commented Jul 9, 2021

One problem is that wot-typescript-definitions contains also the type for the Scripting API, plus it is not clear which version of the thing description schema is contained. Perhaps it might make a new package dedicated only to the schema+ td typescript types.

@benfrancis
Copy link
Member

My understanding is that this repository contains schemas for the IPC messages sent between add-ons and the gateway which, although happen to follow a similar data model for convenience, are not necessarily intended to follow any W3C standard.

What is your thinking in using the W3C repo as a dependency? Is there a subset of the schemas in this repo which could be replaced by the W3C ones?

@relu91
Copy link
Contributor Author

relu91 commented Jul 12, 2021

I was thinking about this particular file: https://github.com/WebThingsIO/gateway-addon-ipc-schema/blob/master/messages/definitions.json (which is the one that I need to edit in WebThingsIO/gateway#2811). In my understanding that file is basically a 1-1 schema definition for Thing Descriptions.

My hypothesis here is that it would be much cleaner to have an entry in the packaged JSON that states wot-thing-description : 1.1.x-y. We gain in readability and maintainability (cause we outsource the schema definition). I would only do this when the package actually contains just the schema plus the TS definitions. Let's see how w3c/wot-scripting-api#327 goes.

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

No branches or pull requests

2 participants