After discussion of rocket -> messaging integration we found 3 directions of work:
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
})
- 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 - 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()
- We should use new messaging widget (without jquery). API: https://github.schibsted.io/spt-marketplace/messaging-fe-widget/tree/NO-JIRA_Updated_documentation
- We should provide a way to load messaging in react. This component should encapsulate all loading/unloading inside.
- Developer should be able to provide other components to render loading/error state.
- Props should include all faast and widget properties.