Skip to content

Breaking Changes

野声 edited this page May 10, 2024 · 12 revisions

For some reason, in v2.x.y there may also be a Break Change in the x bit.

v3.0

component

Popover

如果你使用了 OpenSumi 的 Popover 组件,我们优化了一下该组件的参数。

仅需传入一个 className 即可。

monaco 相关

由于循环依赖 原来从 @opensumi/ide-comments 里引入的 toRange 要换成 positionToRange.

同时 positionToRange 要从 @opensumi/ide-monaco 里引入了。

connection 相关

3.0 已经移除了对 vscode-jsonrpc 的依赖,如果你仍在使用并遇到以下报错:

Uncaught (in promise) Error: No runtime abstraction layer installed
  at RAL (xxx.js:xx:x)

请在你的前端代码顶部加入一句 import '@opensumi/vscode-jsonrpc/lib/node/main';

v2.24.0

Changed the path of ExplorerOpenedEditorViewId

-  import { ExplorerOpenedEditorViewId } from '@opensumi/ide-opened-editor/lib/browser/opened-editor.contribution'
+  import { ExplorerOpenedEditorViewId } from '@opensumi/ide-opened-editor'

v2.22.0

Please see our CHANGELOG.md

v2.21.0

We added a new Provider in ElectronBasicModule: ElectronHeaderService, which allow you change the header text in Electron.

image

The registerColor function's parameter changed:

import { registerColor, Color } from '@opensumi/ide-theme/lib';

/* default button */
export const defaultButtonForeground = registerColor(
  'xxxx',
  { dark: '#D7DBDE', light: '#4D4D4D', hcDark: Color.black, hcLight: Color.white },
  localize('xxxx', 'Danger Ghost Button Foreground color.')
);

v2.20.9

The Terminal View ID changed from TerminalContainerId to TERMINAL_CONTAINER_ID.

v2.20.0

1. Some module command definitions moved to @opensumi/ide-core-browser

Common dependencies such as TERMINAL_COMMANDS, LAYOUT_COMMANDS, MARKER_COMMANDS, SCM_COMMANDS, QUICK_OPEN_COMMANDS are moved to common.command.ts file, you need to adjust the import path when using it.

It is recommended to uniformly import it through the following paths:

import { TERMINAL_COMMANDS } from '@opensumi/ide-core-browser';

2. Some Panel's Container IDs changed

Removed the ide- prefix in the ID to make it consistent with how the view IDs of other regions of the framework are named.

Problem

- export const MARKER_CONTAINER_ID = 'ide-markers';
+ export const MARKER_CONTAINER_ID = 'markers';

Output

- const OUTPUT_CONTAINER_ID = 'ide-output';
+ const OUTPUT_CONTAINER_ID = 'output';

3. Using @parcel/watcher as a new watcher library

In order to further improve the monitoring performance and accuracy of the framework file service, we replace the nsfw dependency with @parcel/watcher in this version.

It is recommended to replace the relevant version dependencies globally as follows:

- "nsfw": "2.1.2"
+ "@parcel/watcher": "2.0.5"

At the same time, you also need to replace nsfw in build native dependencies with @parcel/watcher, as in webpack.node.config.ts:

externals: [
  ({ context, request }, callback) => {
-   if (['node-pty', 'nsfw', 'spdlog', '@opensumi/vscode-ripgrep', 'vm2', 'keytar'].indexOf(request || '') !== -1) {
+   if (['node-pty', '@parcel/watcher', 'spdlog', '@opensumi/vscode-ripgrep', 'vm2', 'keytar'].indexOf(request || '') !== -1) {
      return callback(undefined, `commonjs ${request}`);
    }
    callback();
  },
],

The same is true for other modifications. It is recommended to search for nsfw directly in the project repository and replace them one by one.

4. Terminal

Fix the typo in the INodePtyInstance object returned by TerminalServiceClientImpl.create2 #1528

// packages/terminal-next/src/node/terminal.service.client.ts
export interface INodePtyInstance {
  id: string;
  name: string;
  pid: number;
-  proess: string;
+  process: string;
  shellPath?: string;
}

Remove ITerminalClientFactory, please replace with ITerminalClientFactory2, the usage remains the same #1528

-  @Autowired(ITerminalClientFactory)
-  protected readonly clientFactory: ITerminalClientFactory;
+  @Autowired(ITerminalClientFactory2)
+  protected readonly clientFactory2: ITerminalClientFactory2;

createTerminal() {
- const client = await this.clientFactory(widget, /** @type TerminalOptions */ options);
+ const client = await this.clientFactory2(widget, /** @type ICreateTerminalOptions */ options);
}

ITerminalController API Changed #1528

  • Change from createClientWithWidget2 to createTerminalWithWidgetByTerminalOptions
  • Remove createClientWithWidget

Some of the function name changed:

  createTerminal(options: ICreateTerminalOptions): Promise<ITerminalClient>;
  createTerminalWithWidget(options: ICreateTerminalOptions): Promise<ITerminalClient>;
  createTerminalWithWidgetByTerminalOptions(options: ICreateClientWithWidgetOptions): Promise<ITerminalClient>;

If you were using createClientWithWidget before, you can change it to:

- this.terminalController.createClientWithWidget({
-   name: terminalName,
-   shellArgs: ['-c', ...args],
-   cwd: cwd,
- })
+ this.terminalController.createTerminalWithWidgetByTerminalOptions({
+   terminalOptions: {
+     name: terminalName,
+     shellArgs: ['-c', ...args],
+     cwd: cwd,
+   },
+ });

ITerminalClient remove options property and add launchConfig property #1528

The TerminalOptions type was originally only used as an input parameter for the plugin API to create a terminal. We need to use IShellLaunchConfig to create a terminal within the entire OpenSumi. We implemented IShellLaunchConfig on v2.15.0 and is compatible with the previous TerminalOptions notation.

And ITerminalClient has an attribute _terminalOptions to save the parameters when it was created, and the external can get the value through the options getter. Since v2.20.0, we have removed all TerminalOptions logic inside ITerminalClient, the changes are as follows:

class TerminalClient {
-   get options() {
-    return this._terminalOptions;
-   }
-   updateOptions(options: TerminalOptions) {
-     // ...
-   }
-
+   get launchConfig(): IShellLaunchConfig {
+     return this._launchConfig;
+   }
+   updateLaunchConfig(launchConfig: IShellLaunchConfig) {
+     // ...
+   }
+   updateTerminalName(options: ITerminalNameOptions) {
+     // ...
+   }
}

For example, .options is useful for the value of TerminalClient in Task, and now all are changed to .launchConfig, the changes are visible: #1528

5. IWorkspaceService and IMainLayoutService definition changed

Changes:

- import { IWorkspaceService } from '@opensumi/ide-workspace/lib/common/workspace-defination';
+ import { IWorkspaceService } from '@opensumi/ide-workspace';
- import { IMainLayoutService } from '@opensumi/ide-main-layout/lib/common/main-layout.defination';
+ import { IMainLayoutService } from '@opensumi/ide-main-layout';

6. Upgrade vscode-textmate and vscode-oniguruma

Due to the updated version of Monaco Editor (0.35.x), you need to upgrade the dependent vscode-textmate and vscode-origuruma to the latest version

- "vscode-textmate": "5.4.0"
+ "vscode-textmate": "7.0.1"
- "vscode-oniguruma": "1.5.1"
+ "vscode-oniguruma": "1.6.1"

v2.19.0

Changed the reference path of utility methods in @opensumi/ide-utils

Before

Change Schemas to Schemes #1013

Fix the wrong spelling problem, and let Schemes define variables as a global scheme for easy reuse.

Change Explorer Container ID from ExplorerContainerId to EXPLORER_CONTAINER_ID #784

Since there are multiple ways to write the global view ID, all subsequent view IDs are unified in all uppercase format, such as EXPLORER_CONTAINER_ID, and the used integrator needs to be referenced in the following way:

import { EXPLORER_CONTAINER_ID } from '@opensumi/ide-explorer/lib/browser/explorer-contribution';

Added @opensumi/ide-utils module, and adjusted the introduction method of some tool methods #784

Due to the repeated content of tools and methods in opensumi, in this version, we have summarized the utils-related codes, removed most of the unnecessary methods, and extracted the @opensumi/ide-utils module. You can still import corresponding tool methods from @opensumi/ide-core-common, @opensumi/ide-core-browser, @opensumi/ide-core-node.

There are the following changes in simultaneous use:

1. Adjustment of the usage of some tools and methods

For some tool methods, there may be duplicate method problems, such as strings, objects, arrays, path and other methods, and you need to obtain specific methods in the following ways:

import { path } from '@opensumi/ide-core-common';

const { Path } = path;

See the changes here:utils/src/index.ts

2. Replace parse method in glob

Replaced the parse method in the glob utility method with the more explicit notation of parseGlob.

3. Removed redundant OS.type defined in platform

Project Management

Troubleshooting

Clone this wiki locally