-
Notifications
You must be signed in to change notification settings - Fork 151
fix: bind this in API-returned objects & update docs for JS implementers #1645
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
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
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.ts
and/or/src/bridging/BridgingTypes.ts
BaseContext
schema applied viaallOf
(as it is in existing types)?title
anddescription
provided 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