Skip to content

Commit 7ce90a3

Browse files
apmortonAbrilRBS
andauthored
Update to latest monaco webpack plugin (compiler-explorer#1836)
* Update to latest monaco webpack plugin to get content hashes on worker script path * Move to Monaco built-in Pascal mode Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
1 parent e60593f commit 7ce90a3

File tree

7 files changed

+20
-240
lines changed

7 files changed

+20
-240
lines changed

app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,11 @@ async function main() {
572572
* fabricate a worker on the fly.
573573
*
574574
* This is bad and I feel bad.
575+
*
576+
* This should no longer be needed, but is left here for safety because people with
577+
* workers already installed from this url may still try to hit this page for some time
578+
*
579+
* TODO: remove this route in the future now that it is not needed
575580
*/
576581
router.get('/workers/:worker', (req, res) => {
577582
staticHeaders(res);

package-lock.json

Lines changed: 10 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"lru-cache": "^4.1.3",
4343
"lz-string": "^1.4.4",
4444
"mkdirp": "^0.5.1",
45-
"monaco-editor": "^0.15.6",
46-
"monaco-vim": "0.1.3",
45+
"monaco-editor": "^0.19.3",
46+
"monaco-vim": "^0.1.6",
4747
"morgan": "^1.9.1",
4848
"node-graceful": "^2.0.1",
4949
"node-targz": "^0.2.0",
@@ -85,7 +85,7 @@
8585
"mini-css-extract-plugin": "^0.7.0",
8686
"mocha": "^5.2.0",
8787
"mock-fs": "^4.10.2",
88-
"monaco-editor-webpack-plugin": "^1.7.0",
88+
"monaco-editor-webpack-plugin": "^1.8.2",
8989
"nock": "^9.1.4",
9090
"nyc": "^14.1.1",
9191
"requirejs": "2.3.6",

static/modes/pascal-mode.js

Lines changed: 0 additions & 172 deletions
This file was deleted.

static/options.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,4 @@ for (var k in extraOptions) {
3636

3737
__webpack_public_path__ = window.staticRoot;
3838

39-
// really gross monaco web worker cross origin workaround
40-
window.__webpack_public_path__ = window.httpRoot + 'workers/';
41-
4239
module.exports = window.compilerExplorerOptions;

static/panes/editor.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ require('../modes/llvm-ir-mode');
4141
require('../modes/haskell-mode');
4242
require('../modes/ocaml-mode');
4343
require('../modes/clean-mode');
44-
require('../modes/pascal-mode');
4544
require('../modes/cuda-mode');
4645
require('../modes/fortran-mode');
4746
require('../modes/zig-mode');

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const staticPath = path.join(distPath, 'static');
1313

1414
let plugins = [
1515
new MonacoEditorWebpackPlugin({
16-
languages: ['cpp', 'go', 'rust', 'swift']
16+
languages: ['cpp', 'go', 'rust', 'swift', 'pascal'],
17+
filename: isDev ? '[name].worker.js' : '[name].worker.[contenthash].js'
1718
}),
1819
new CopyWebpackPlugin([
1920
{

0 commit comments

Comments
 (0)