-
Notifications
You must be signed in to change notification settings - Fork 132
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
Enhancements to messages defined in BrowserTypes #1268
Comments
@Roaders There exist AppRequestMessage, AgentResponseMessage and AgentEvent message schemas and types. See:
The types are structurally compatible with all messages derived from them so you can use them to write generalized TypeScript code in your implementation. However, as we generate the TypeScript code from the schemas, the type definitions of specific message types don't formally extend these types - but as TypeScript uses structural compatibility rather than than more traditional declarative typing that should not matter (other than it feeling a little odd to those of us that grew up with OO languages). Given the number of messages, we should try to avoid creating a manual maintenance situation wherever possible (lest we incur the wrath of future generations of FDC3 maintainers). However, I believe it could/should be possible to come up with a way to generate some of your above suggestions by post processing the BrowserTypes file. Type detection does seem like something the Convert class could be doing... |
Closed as completed - merged into fdc3-for-web-impl branch |
Enhancement Request
Use Case:
I am a developer implementing a Desktop Agent Proxy that will use the proposed messaging protocol to communicate with a Desktop Agent. The types defined in BrowserTypes are very helpful but there are things that can be done to make things easier.
FDC3Message
(name is just an example. I am not good at naming things! feel free to suggest a different name)FDC3Message
union type should be composed of 2 other union typesRequestMessage
andResponseMessage
RequestMessageBase
and aResponseMessageBase
. All response messages should have asource: AppIdentifier
and request / response uuid in the meta object for example (I am not sure how practical this is but some commanality between messages would be great)This isn't necessarily the desired implementation - we could probably use some of the logic from the
Convert
class to do a better check that it is in fact a valid message. The important bit is the type predicate return type.We have already implemeted a lot of type predicates and union types but I am not sure how useful it would be to contribute these as I understand that the
BrowserTypes
are generated by magic so that magic should probably also generate the predicates and union types.The text was updated successfully, but these errors were encountered: