File tree Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " lowcoder-sdk" ,
3
- "version" : " 2.4.15 " ,
3
+ "version" : " 2.4.16 " ,
4
4
"type" : " module" ,
5
5
"files" : [
6
6
" src" ,
Original file line number Diff line number Diff line change @@ -105,17 +105,17 @@ export class AppViewInstance<I = any, O = any> {
105
105
} ) ;
106
106
107
107
await DatasourceApi . fetchJsDatasourceByApp ( this . appId ) . then ( ( res ) => {
108
- res . data . data . forEach ( ( i ) => {
108
+ res . data ? .data ? .forEach ( ( i ) => {
109
109
registryDataSourcePlugin ( i . type , i . id , i . pluginDefinition ) ;
110
110
} ) ;
111
111
} ) ;
112
112
113
113
setGlobalSettings ( {
114
- orgCommonSettings : data . data . orgCommonSettings ,
114
+ orgCommonSettings : data ? .data ? .orgCommonSettings ,
115
115
} ) ;
116
116
117
- finalAppDsl = data . data . applicationDSL ;
118
- finalModuleDslMap = data . data . moduleDSL ;
117
+ finalAppDsl = data ? .data ? .applicationDSL || { } ;
118
+ finalModuleDslMap = data ? .data ? .moduleDSL || { } ;
119
119
}
120
120
121
121
if ( this . options . moduleInputs && this . isModuleDSL ( finalAppDsl ) ) {
Original file line number Diff line number Diff line change 1
- import { NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins" ;
1
+ import { sdkConfig } from "@lowcoder-ee/constants/sdkConfig" ;
2
+ import { ASSETS_BASE_URL , NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins" ;
2
3
import { trans } from "i18n" ;
3
4
import { CompConstructor } from "lowcoder-core" ;
4
5
import {
@@ -17,7 +18,12 @@ async function npmLoader(
17
18
// Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
18
19
const localPackageVersion = remoteInfo . packageVersion || "latest" ;
19
20
const { packageName, packageVersion, compName } = remoteInfo ;
20
- const entry = `${ NPM_PLUGIN_ASSETS_BASE_URL } /${ appId } /${ packageName } @${ localPackageVersion } /index.js` ;
21
+
22
+ const pluginBaseUrl = REACT_APP_BUNDLE_TYPE === 'sdk' && sdkConfig . baseURL
23
+ ? `${ sdkConfig . baseURL } /${ ASSETS_BASE_URL } `
24
+ : NPM_PLUGIN_ASSETS_BASE_URL ;
25
+
26
+ const entry = `${ pluginBaseUrl } /${ appId } /${ packageName } @${ localPackageVersion } /index.js` ;
21
27
22
28
try {
23
29
const module = await import (
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { CompContext } from "@lowcoder-ee/comps/utils/compContext";
16
16
import React from "react" ;
17
17
import type { AppState } from "@lowcoder-ee/redux/reducers" ;
18
18
import { useSelector } from "react-redux" ;
19
- import { useApplicationId } from "@lowcoder-ee/util/hooks " ;
19
+ import { ExternalEditorContext } from "@lowcoder-ee/util/context/ExternalEditorContext " ;
20
20
21
21
const ViewError = styled . div `
22
22
display: flex;
@@ -63,7 +63,8 @@ const RemoteCompView = React.memo((props: React.PropsWithChildren<RemoteCompView
63
63
const [ error , setError ] = useState < any > ( "" ) ;
64
64
const editorState = useContext ( EditorContext ) ;
65
65
const compState = useContext ( CompContext ) ;
66
- const appId = useApplicationId ( ) ;
66
+ const externalEditorState = useContext ( ExternalEditorContext ) ;
67
+ const appId = externalEditorState . applicationId ;
67
68
const lowcoderCompPackageVersion = editorState ?. getAppSettings ( ) . lowcoderCompVersion || 'latest' ;
68
69
const latestLowcoderCompsVersion = useSelector ( ( state : AppState ) => state . npmPlugin . packageVersion [ 'lowcoder-comps' ] ) ;
69
70
Original file line number Diff line number Diff line change 1
1
// export const SERVER_HOST = `${REACT_APP_NODE_SERVICE_URL ?? ""}`;
2
2
// export const NPM_REGISTRY_URL = `${SERVER_HOST}/node-service/api/npm/registry`;
3
3
// export const NPM_PLUGIN_ASSETS_BASE_URL = `${SERVER_HOST}/node-service/api/npm/package`;
4
-
4
+ export const ASSETS_BASE_URL = `api/npm/package` ;
5
5
export const SERVER_HOST = `${ REACT_APP_API_SERVICE_URL ?? "" } ` ;
6
6
export const NPM_REGISTRY_URL = `${ SERVER_HOST } /api/npm/registry` ;
7
7
export const NPM_PLUGIN_ASSETS_BASE_URL = `${ SERVER_HOST } /api/npm/package` ;
You can’t perform that action at this time.
0 commit comments