11import React from 'react' ;
2+ import ReactDOM from 'react-dom' ;
3+ import * as JSXRuntime from 'react/jsx-runtime' ;
24import * as Redux from 'redux' ;
35import * as ReactRedux from 'react-redux' ;
46import _ from 'lodash' ;
@@ -10,12 +12,17 @@ import reduceReducers from 'reduce-reducers';
1012import immer from 'immer' ;
1113import * as reselect from 'reselect' ;
1214import axios from 'axios' ;
15+ import * as GravityUI from '@gravity-ui/uikit' ;
16+ import * as pluginsSDKUI from './plugins-sdk-ui' ;
1317import * as selectors from './selectors' ;
1418import actionNames from './action-names' ;
1519import Details from '../components/details' ;
20+ import { getPluginMiddlewareRoute } from '@/static/modules/utils/pluginMiddlewareRoute' ;
1621
1722const whitelistedDeps = {
1823 'react' : React ,
24+ 'react/jsx-runtime' : JSXRuntime ,
25+ 'react-dom' : ReactDOM ,
1926 'redux' : Redux ,
2027 'react-redux' : ReactRedux ,
2128 'lodash' : _ ,
@@ -27,6 +34,8 @@ const whitelistedDeps = {
2734 'immer' : immer ,
2835 'reselect' : reselect ,
2936 'axios' : axios ,
37+ '@gravity-ui/uikit' : GravityUI ,
38+ 'html-reporter/plugins-sdk/ui' : pluginsSDKUI ,
3039 'components' : {
3140 Details
3241 }
@@ -91,8 +100,16 @@ async function initPlugin(plugin, pluginName, pluginConfig) {
91100 plugin = _ . last ( plugin ) ;
92101 const depArgs = deps . map ( dep => whitelistedDeps [ dep ] ) ;
93102 // cyclic dep, resolve it dynamically
94- const actions = await import ( './actions' ) ;
95- return plugin ( ...depArgs , { pluginName, pluginConfig, actions, actionNames, selectors} ) ;
103+ const actionsModule = await import ( './actions' ) ;
104+ const actions = actionsModule . default || actionsModule ;
105+ return plugin ( ...depArgs , {
106+ pluginName,
107+ pluginConfig,
108+ actions,
109+ actionNames,
110+ selectors,
111+ pluginServerEndpointPrefix : getPluginMiddlewareRoute ( pluginName )
112+ } ) ;
96113 }
97114
98115 return plugin ;
0 commit comments