Skip to content

Commit 5f8ac38

Browse files
committed
fix(monaco): Do not use CDN version of monaco-editor (fixes #1186)
1 parent 64e7103 commit 5f8ac38

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed

app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"css-loader": "^7.1.2",
2121
"html-webpack-plugin": "^5.6.2",
2222
"jest": "^29.7.0",
23+
"monaco-editor": "^0.52.0",
2324
"monaco-editor-webpack-plugin": "^7.1.0",
2425
"style-loader": "^4.0.0",
2526
"swc-loader": "^0.2.6",

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"eslint-plugin-react-hooks": "^5.0.0",
4848
"eslint-plugin-testing-library": "^6.4.0",
4949
"prettier": "3.3.3",
50+
"typescript": "^5.4.5",
5051
"typescript-eslint": "^8.11.0"
5152
},
5253
"config": {

packages/hawtio/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@hawtio/camel-model-v4_8": "npm:@hawtio/camel-model@~4.8.0",
3838
"@jolokia.js/simple": "^2.1.7",
3939
"@module-federation/utilities": "^3.1.16",
40+
"@monaco-editor/react": "^4.6.0",
4041
"@patternfly/react-charts": "~7.3.0",
4142
"@patternfly/react-code-editor": "~5.3.3",
4243
"@patternfly/react-core": "~5.3.3",

packages/hawtio/src/plugins/camel/endpoints/SendMessage.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ import { doSendMessage } from './endpoints-service'
3030
// TODO: Parameterise the version of Camel mode for the exchange headers
3131
import { headers as exchangeHeaders } from './exchange-headers-camel-model.json'
3232

33+
import { loader } from '@monaco-editor/react'
34+
35+
loader.config({ monaco: monacoEditor })
36+
3337
export const SendMessage: React.FunctionComponent = () => {
3438
const { selectedNode } = useContext(CamelContext)
3539
const messageHeaders = useRef<{ name: string; value: string }[]>([])

packages/hawtio/src/plugins/camel/routes/Source.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import { routesService } from './routes-service'
88
import { eventService } from '@hawtiosrc/core'
99
import { Alert, AlertActionCloseButton, AlertVariant } from '@patternfly/react-core'
1010

11+
import * as monaco from 'monaco-editor'
12+
import { loader } from '@monaco-editor/react'
13+
14+
loader.config({ monaco })
15+
1116
export const Source: React.FunctionComponent = () => {
1217
const { selectedNode } = useContext(CamelContext)
1318
const [xmlSource, setXmlSource] = useState('')

yarn.lock

+3
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,7 @@ __metadata:
20162016
eslint-plugin-react-hooks: "npm:^5.0.0"
20172017
eslint-plugin-testing-library: "npm:^6.4.0"
20182018
prettier: "npm:3.3.3"
2019+
typescript: "npm:^5.4.5"
20192020
typescript-eslint: "npm:^8.11.0"
20202021
languageName: unknown
20212022
linkType: soft
@@ -2028,6 +2029,7 @@ __metadata:
20282029
"@hawtio/camel-model-v4_8": "npm:@hawtio/camel-model@~4.8.0"
20292030
"@jolokia.js/simple": "npm:^2.1.7"
20302031
"@module-federation/utilities": "npm:^3.1.16"
2032+
"@monaco-editor/react": "npm:^4.6.0"
20312033
"@patternfly/react-charts": "npm:~7.3.0"
20322034
"@patternfly/react-code-editor": "npm:~5.3.3"
20332035
"@patternfly/react-core": "npm:~5.3.3"
@@ -4742,6 +4744,7 @@ __metadata:
47424744
css-loader: "npm:^7.1.2"
47434745
html-webpack-plugin: "npm:^5.6.2"
47444746
jest: "npm:^29.7.0"
4747+
monaco-editor: "npm:^0.52.0"
47454748
monaco-editor-webpack-plugin: "npm:^7.1.0"
47464749
react: "npm:^18.3.1"
47474750
react-dom: "npm:^18.3.1"

0 commit comments

Comments
 (0)