index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import BasePlugin from 'sentry/plugins/basePlugin';
  2. import DefaultIssuePlugin from 'sentry/plugins/defaultIssuePlugin';
  3. import Registry from 'sentry/plugins/registry';
  4. import SessionStackContextType from './sessionstack/contexts/sessionstack';
  5. import Jira from './jira';
  6. import SessionStackPlugin from './sessionstack';
  7. const contexts: Record<string, React.ElementType> = {};
  8. const registry = new Registry();
  9. // Register legacy plugins
  10. // Sessionstack
  11. registry.add('sessionstack', SessionStackPlugin);
  12. contexts.sessionstack = SessionStackContextType;
  13. // Jira
  14. registry.add('jira', Jira);
  15. export {BasePlugin, DefaultIssuePlugin, registry};
  16. const add: typeof registry.add = registry.add.bind(registry);
  17. const get: typeof registry.get = registry.get.bind(registry);
  18. const isLoaded: typeof registry.isLoaded = registry.isLoaded.bind(registry);
  19. const load: typeof registry.load = registry.load.bind(registry);
  20. export default {
  21. BasePlugin,
  22. DefaultIssuePlugin,
  23. add,
  24. addContext: function (id: string, component: React.ElementType) {
  25. contexts[id] = component;
  26. },
  27. contexts,
  28. get,
  29. isLoaded,
  30. load,
  31. };