Skip to content

npm v1.2.0

Compare
Choose a tag to compare
@rikoe rikoe released this 19 Apr 21:40
4cef6a7

v1.2.0 release of the @finos/fdc3 npm package, corresponding with the FDC3 Standard v1.2.

Release highlights

New ES6 Imports

The new methods from the FDC3 1.2 Standard, raiseIntentForContext() and getInfo(), can now be imported:

import { raiseIntentForContext, getInfo } from '@finos/fdc3'

const info = getInfo()
console.log('FDC3 version: ' + info.fdc3Version)

await raiseIntentForContext({
  type: 'fdc3.instrument',
  id: {
    ticker: 'AAPL'
  }
})

New utility functions

  • The fdc3Ready() function wraps waiting for the window.fdc3 global and the new fdc3Ready event:
import { fdc3Ready, joinChannel, broadcast } from '@finos/fdc3'

await fdc3Ready(1000) // specify the amount of milliseconds to wait before a timeout error

await joinChannel('blue')

broadcast({
  type: 'fdc3.contact',
  id: {
    email: '[email protected]'
  }
})
  • The compareVersionNumbers() and versionIsAtLeast() functions can be used together with getInfo() for version checking:
import * as fdc3 from '@finos/fdc3'

const info = fdc3.getInfo()

if (fdc3.versionIsAtLeast(info, 1.2)) {
  console.log('Version is >= 1.2')
}

🚀 New Features

  • ES6 functions for getInfo() and raiseIntentForContext() (#268, #324)
  • fdc3Ready() utility function that wraps checks for the window.fdc3 global object and new fdc3Ready event (#360)
  • compareVersionNumbers() and versionIsAtLeast() utility functions to complement getInfo() (#324)

💅 Enhancements

  • addContextListener(contextType, handler) now supports passing null as the context type (#329)
  • All other API type changes and additions from the FDC3 Standard 1.2 release

👎 Deprecated

  • addContextListener(handler) (#329)
  • IntentResolution.data (#341)

See CHANGELOG.md for more details.