Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update monaco-editor-core to 1.96.3 #14737

Merged
merged 8 commits into from
Jan 30, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -61,8 +61,9 @@ const webpack = require('webpack');
const yargs = require('yargs');
const resolvePackagePath = require('resolve-package-path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CompressionPlugin = require('compression-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js');

const outputPath = path.resolve(__dirname, 'lib', 'frontend');
const { mode, staticCompression } = yargs.option('mode', {
@@ -99,7 +100,8 @@ const plugins = [
new webpack.ProvidePlugin({
// the Buffer class doesn't exist in the browser but some dependencies rely on it
Buffer: ['buffer', 'Buffer']
})
}),
new MonacoWebpackPlugin()
];
// it should go after copy-plugin in order to compress monaco as well
if (staticCompression) {
@@ -171,6 +173,10 @@ module.exports = [{
test: /source-map-support/,
loader: 'ignore-loader'
},
{
test: /\\.d\\.ts$/,
loader: 'ignore-loader'
},
{
test: /\\.js$/,
enforce: 'pre',
@@ -240,6 +246,7 @@ module.exports = [{
filename: "[name].css",
chunkFilename: "[id].css",
}),
new MonacoWebpackPlugin(),
],
devtool: 'source-map',
entry: {
@@ -345,6 +352,7 @@ const yargs = require('yargs');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const NativeWebpackPlugin = require('@theia/native-webpack-plugin');
const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js');

const { mode } = yargs.option('mode', {
description: "Mode to use",
@@ -432,6 +440,10 @@ const config = {
name: 'native/[name].[ext]'
}
},
{
test: /\\.d\\.ts$/,
loader: 'ignore-loader'
},
{
test: /\\.js$/,
enforce: 'pre',
@@ -451,7 +463,8 @@ const config = {
// Optional node dependencies can be safely ignored
new webpack.IgnorePlugin({
checkResource: resource => ignoredResources.has(resource)
})
}),
new MonacoWebpackPlugin()
],
optimization: {
// Split and reuse code across the various entry points
32 changes: 0 additions & 32 deletions dev-packages/cli/patches/@theia+monaco-editor-core+1.83.101.patch

This file was deleted.

26 changes: 26 additions & 0 deletions dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// *****************************************************************************
// Copyright (C) 2023 TypeFox and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0.
//
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
// with the GNU Classpath Exception which is available at
// https://www.gnu.org/software/classpath/license.html.
//
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import * as webpack from 'webpack';

export class MonacoWebpackPlugin {
apply(compiler: webpack.Compiler): void {
compiler.hooks.contextModuleFactory.tap('MonacoBuildPlugin', cmf => {
cmf.hooks.contextModuleFiles.tap('MonacoBuildPlugin', files => files.filter(file => !file.endsWith('.d.ts')));

});
}
}
2 changes: 1 addition & 1 deletion examples/api-samples/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"@theia/file-search": "1.57.0",
"@theia/filesystem": "1.57.0",
"@theia/monaco": "1.57.0",
"@theia/monaco-editor-core": "1.83.101",
"@theia/monaco-editor-core": "1.96.302",
"@theia/output": "1.57.0",
"@theia/ovsx-client": "1.57.0",
"@theia/search-in-workspace": "1.57.0",
10 changes: 3 additions & 7 deletions examples/api-tests/src/monaco-api.spec.js
Original file line number Diff line number Diff line change
@@ -14,6 +14,8 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

const { IOpenerService } = require('@theia/monaco-editor-core/esm/vs/platform/opener/common/opener');

// @ts-check
describe('Monaco API', async function () {
this.timeout(5000);
@@ -149,14 +151,8 @@ describe('Monaco API', async function () {
});

it('OpenerService.open', async () => {
const hoverContribution = monacoEditor.getControl().getContribution('editor.contrib.hover');
assert.isDefined(hoverContribution);
if (!('_openerService' in hoverContribution)) {
assert.fail('hoverContribution does not have OpenerService');
return;
}
/** @type {import('@theia/monaco-editor-core/esm/vs/editor/browser/services/openerService').OpenerService} */
const openerService = hoverContribution['_openerService'];
const openerService = StandaloneServices.get(IOpenerService);

let opened = false;
const id = '__test:OpenerService.open';
3 changes: 2 additions & 1 deletion examples/browser/package.json
Original file line number Diff line number Diff line change
@@ -108,6 +108,7 @@
"watch:compile": "tsc -b -w"
},
"devDependencies": {
"@theia/cli": "1.57.0"
"@theia/cli": "1.57.0",
"@theia/native-webpack-plugin": "1.57.0"
}
}
5 changes: 4 additions & 1 deletion examples/browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"extends": "../../configs/base.tsconfig",
"include": [],
"include": [ ],
"compilerOptions": {
"composite": true
},
"references": [
{
"path": "../../dev-packages/cli"
},
{
"path": "../../dev-packages/native-webpack-plugin"
},
{
"path": "../../packages/ai-anthropic"
},
1 change: 1 addition & 0 deletions examples/browser/webpack.config.js
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ configs[0].module.rules.push({
loader: require.resolve('@theia/application-manager/lib/expose-loader')
});


module.exports = [
...configs,
nodeConfig.config
6 changes: 4 additions & 2 deletions examples/electron/webpack.config.js
Original file line number Diff line number Diff line change
@@ -10,10 +10,12 @@ const nodeConfig = require('./gen-webpack.node.config.js');
* Expose bundled modules on window.theia.moduleName namespace, e.g.
* window['theia']['@theia/core/lib/common/uri'].
* Such syntax can be used by external code, for instance, for testing.
config.module.rules.push({
*/
configs[0].module.rules.push({
test: /\.js$/,
loader: require.resolve('@theia/application-manager/lib/expose-loader')
}); */
});


module.exports = [
...configs,
Loading

Unchanged files with check annotations Beta

expect(line, { message: 'Line number 1 should exists' }).toBeDefined();
const box = await line?.boundingBox();
console.log(`Split cell test: visible = ${await line?.isVisible()}, box = {${box?.x},${box?.y},${box?.width},${box?.height}}`);
await line!.click();

Check failure on line 119 in examples/playwright/src/tests/theia-notebook-editor.test.ts

GitHub Actions / Playwright Tests (ubuntu-22.04, Node.js 18.x)

../../src/tests/theia-notebook-editor.test.ts:101:9 › Theia Notebook Editor interaction › should split cell

1) ../../src/tests/theia-notebook-editor.test.ts:101:9 › Theia Notebook Editor interaction › should split cell Error: elementHandle.click: Element is not attached to the DOM Call log: - attempting click action - waiting for element to be visible, enabled and stable 117 | const box = await line?.boundingBox(); 118 | console.log(`Split cell test: visible = ${await line?.isVisible()}, box = {${box?.x},${box?.y},${box?.width},${box?.height}}`); > 119 | await line!.click(); | ^ 120 | await line!.press('ArrowRight'); 121 | 122 | // split cell at /home/runner/work/theia/theia/examples/playwright/src/tests/theia-notebook-editor.test.ts:119:21
await line!.press('ArrowRight');
// split cell