Skip to content

Instantly share code, notes, and snippets.

@KELiON
Created March 28, 2017 14:23
Show Gist options
  • Save KELiON/e6cfb25fced9341927b828b5c8e52141 to your computer and use it in GitHub Desktop.
Save KELiON/e6cfb25fced9341927b828b5c8e52141 to your computer and use it in GitHub Desktop.
test

After discussion of rocket -> messaging integration we found 3 directions of work:

faast client

We should implement unload/unmount/whatever function, that removes all added elements. It should be something like:

faast(...).then(sloow => {
  // calling sloow will remove all added <script> and <link> tags
})

Messaging widget

  1. Add namespacing for routes Currently messaging widget uses root level routes. It should be customizable, so we can specify, i.e. messaging/ prefix for all routes
  2. Add unload/unmount/whatever method to widget object. This method should destroy vue component with calling all lifecycle hooks (like beforeDestroy) and clean all global events. Should be something like:
const widget = new Messaging.Widget(...)
widget.unload()

Messaging react component

  1. We should use new messaging widget (without jquery). API: https://github.schibsted.io/spt-marketplace/messaging-fe-widget/tree/NO-JIRA_Updated_documentation
  2. We should provide a way to load messaging in react. This component should encapsulate all loading/unloading inside.
  3. Developer should be able to provide other components to render loading/error state.
  4. Props should include all faast and widget properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment