You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example:
In writing and testing a getAgent implementation it's important to see if an agent has already been created and assigned to window.fdc3. Currently the typing specified it as being DesktopAgent:
declare global {interfaceWindow{fdc3: DesktopAgent;}}
This however should be marked as optional so any code accessing that property check to see if it's defined first:
declare global {interfaceWindow{fdc3?: DesktopAgent;}}
The text was updated successfully, but these errors were encountered:
I realise that this is probably going to be an issue as anyone relying on this type being defined will now get a breaking change as it might not be defined. My proposal is IMHO the "right" thing to do but I understand that there will likely be issues and push back.
HI @Roaders - this is very good point that we haven't discussed in a long time. getAgent does set window.fdc3 by default (if not already set by a 'Desktop Agent Preload' agent, i.e. a traditional FDC3 DA) for backwards compatibility but can be prevented from doing so. Hence, it will not always be set and the typing (which you can't avoid using if importing the @finos/fdc3 lib) may be incorrect when that setting is used and during the set-up of the connection to a web-based DA. We'll need a PR into the https://github.com/finos/FDC3/tree/fdc3-for-web branch to make that change and close this issue - it's a significant (if tiny) change, but is what has been intended since early in the FDC3 for the Web's history.
If you have a moment, please feel free to raise that PR (which you can do at https://github.com/finos/FDC3/edit/fdc3-for-web/src/index.ts) and we'll check with others at the meeting on Thursday and SWG meeting the week after (as its a change to what was voted on).
Enhancement Request
Use Case:
I want to test to see if
window.fdc3
is definedFor example:
In writing and testing a
getAgent
implementation it's important to see if an agent has already been created and assigned towindow.fdc3
. Currently the typing specified it as beingDesktopAgent
:This however should be marked as optional so any code accessing that property check to see if it's defined first:
The text was updated successfully, but these errors were encountered: