fix: bind this in API-returned objects & update docs for JS implementers#1645
Conversation
✅ Deploy Preview for fdc3 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
kriswest
left a comment
There was a problem hiding this comment.
This is looking good so far, although you still need to bind the functions of IntentResolution at: https://github.com/jaybhanushali3166/FDC3/blob/fix/bind-this-in-api-objects-and-docs-update/packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts
I think it would also be worth defining some tests - try repeating an existing test but with a destructured function instead of the DesktopAgent reference itself. As the destructuring is a MUST, we need both conformance tests and unit tests for the code:
- Text description of a tests to go in:
- App Channel tests: https://github.com/jaybhanushali3166/FDC3/blob/fix/bind-this-in-api-objects-and-docs-update/website/docs/api/conformance/App-Channel-Tests.md
- Intent tests: https://github.com/jaybhanushali3166/FDC3/blob/fix/bind-this-in-api-objects-and-docs-update/website/docs/api/conformance/Intents-Tests.md
- Destructuring the desktop functions should probably be testing on a few key functions (repeat existing tests but destructure broadcast, open, raiseIntent?)
- Unit tests for code:
- App Channels: https://github.com/jaybhanushali3166/FDC3/blob/fix/bind-this-in-api-objects-and-docs-update/packages/fdc3-agent-proxy/test/features/app-channels.feature
- Intent Results (binding of getResult function): https://github.com/jaybhanushali3166/FDC3/blob/fix/bind-this-in-api-objects-and-docs-update/packages/fdc3-agent-proxy/test/features/intent-results.feature
- Destructuing desktop agents functions distributed amongst other tests?
|
Please also add a CHANGELOG.md entry in the unreleased section: https://github.com/jaybhanushali3166/FDC3/blob/fix/bind-this-in-api-objects-and-docs-update/CHANGELOG.md#unreleased |
|
@jaybhanushali3166 will you be able to make the requested additions to this PR, or would you like someone else to take this on to complete? |
|
@kriswest, I am working on it. Finishing up the test cases. |
|
@jaybhanushali3166 Awesome, let us know how you get on - and ignore the failing Report coverage task, we need to fix that. |
|
Hi @kriswest , for the test cases as we are using existing tests with destructed methods, are we also expecting new step definitions too? Something like this: |
Hi @jaybhanushali3166, yes I'd add a new step to do the destructuring - however don't include the bind, as you are trying to test that implementation did it already. Hence: |
…dd method binding for default intent resolution
|
Hi @kriswest, I have pushed the updates. let me know if there are any other changes needed. Thanks! |
kriswest
left a comment
There was a problem hiding this comment.
@jaybhanushali3166 this is looking really good. I need a small adjustment to the changelog and conflicts resolved (both look easy, just another test being added).
Your test cases and conformance cases all look really good - although we could do with the same for user channels (fdc3.broadcast and fdc3.addContextListener). These weren't added when the DesktopAgentProxy's functions were bound. If you're willing to add that in that would be awesome, if not we can drop another issue and PR.
kriswest
left a comment
There was a problem hiding this comment.
LGTM, next step is a review by @finos/fdc3-editors (@novavi or @hughtroeger) - and we'll bring it to the next Standards Working Group meeting for final approval (as it introduced an new conformance requirement on the web).
|
@jaybhanushali3166 many thanks for your contribution on this! |
|
Welcome, @kriswest! Thank you for your patience and support as we worked through these changes, it’s well appreciated. |
Related Issue
resolves #1638
Contributor License Agreement
Review Checklist
DesktopAgent,Channel,PrivateChannel,Listener,Bridging)?JSDoc comments on interfaces and types should be matched to the main documentation in /docs
Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined
The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other
npm run build) run and the results checked in?Generated code will be found at
/src/api/BrowserTypes.tsand/or/src/bridging/BridgingTypes.tsBaseContextschema applied viaallOf(as it is in existing types)?titleanddescriptionprovided for all properties defined in the schema?npm run build) run and the results checked in?Generated code will be found at
/src/context/ContextTypes.ts