Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# TBD

- [FP-2926](https://movai.atlassian.net/browse/FP-2926): Clear console and app errors
- [QAP-3964](https://movai.atlassian.net/browse/QAP-3964): Review devcontainer configuration for lib-code
- [FP-2840](https://movai.atlassian.net/browse/FP-2840): Update ReadMe's on all apps
- [FP-2851](https://movai.atlassian.net/browse/FP-2851): Added new unit tests to repo
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"@codingame/monaco-languageclient": "^0.17.3",
"@mov-ai/mov-fe-lib-core": "^1.2.2-1",
"@mov-ai/mov-fe-lib-react": "^1.3.4-1",
"monaco-editor": "^0.31.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/MonacoCodeEditor/MonacoCodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ MonacoCodeEditor.propTypes = {
value: PropTypes.string,
style: PropTypes.object,
useLanguageServer: PropTypes.bool,
builtins: PropTypes.object,
builtins: PropTypes.array,
};

MonacoCodeEditor.defaultProps = {
Expand Down
40 changes: 23 additions & 17 deletions src/components/MonacoCodeEditor/hooks/useMonacoEditorCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,29 @@ import ReconnectingWebSocket from "reconnecting-websocket";
* */
//========================================================================================

self.MonacoEnvironment = {
getWorkerUrl: function (_, label) {
if (label === "json") {
return "./json.worker.bundle.js";
}
if (label === "css" || label === "scss" || label === "less") {
return "./css.worker.bundle.js";
}
if (label === "html" || label === "handlebars" || label === "razor") {
return "./html.worker.bundle.js";
}
if (label === "typescript" || label === "javascript") {
return "./ts.worker.bundle.js";
}
return "./editor.worker.bundle.js";
},
};
// Commented this because it was throwing an error as something
// In the bundler (spent a few hours investigating this)
// wasn't working. Since I couldn't get the files by any name /
// path, ended up giving up and just commented this. Now we
// only get a simple warning in the console instead of that
// invasive backdrop error and console error.
// self.MonacoEnvironment = {
// getWorkerUrl: function (_, label) {
// if (label === "json") {
// return "./json.worker.js";
// }
// if (label === "css" || label === "scss" || label === "less") {
// return "./css.worker.js";
// }
// if (label === "html" || label === "handlebars" || label === "razor") {
// return "./html.worker.js";
// }
// if (label === "typescript" || label === "javascript") {
// return "./ts.worker.js";
// }
// return "./editor.worker.js";
// },
// };

const createUrl = () => {
const protocol = location.protocol === "https:" ? "wss" : "ws";
Expand Down