Skip to content

chore(Code): upgrade to 1.65 #5047

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

Merged
merged 7 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ test/test-results

# Quilt's internal data.
/.pc
/patches/*.diff~
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ re-apply the patches.
### Version updates to Code

1. Update the `lib/vscode` submodule to the desired upstream version branch.
2. From the code-server **project root**, run `yarn install`.
3. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
2. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
stage you may need to resolve conflicts. For example use `quilt push -f`,
manually apply the rejected portions, then `quilt refresh`.
3. From the code-server **project root**, run `yarn install`.
Comment on lines -99 to +102
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to update this when we moved to patches

4. Test code-server locally to make sure everything works.
5. Check the Node.js version that's used by Electron (which is shipped with VS
Code. If necessary, update your version of Node.js to match.
Expand Down
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 2032 files
12 changes: 6 additions & 6 deletions patches/base-path.diff
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
productConfiguration: <Partial<IProductConfiguration>>{
+ rootEndpoint: base,
embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
...this._productService.extensionsGallery,
'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
@@ -289,7 +295,9 @@ export class WebClientServer {
@@ -290,7 +296,9 @@ export class WebClientServer {
} : undefined
}
})))
Expand All @@ -199,7 +199,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts

const cspDirectives = [
'default-src \'self\';',
@@ -368,3 +376,70 @@ export class WebClientServer {
@@ -369,3 +377,70 @@ export class WebClientServer {
return res.end(data);
}
}
Expand Down Expand Up @@ -286,19 +286,19 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
@@ -504,6 +504,7 @@ function doCreateUri(path: string, query
@@ -482,6 +482,7 @@ function doCreateUri(path: string, query
});
}

+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
return URI.parse(window.location.href).with({ path, query });
}

@@ -515,7 +516,7 @@ function doCreateUri(path: string, query
@@ -493,7 +494,7 @@ function doCreateUri(path: string, query
if (!configElement || !configElementAttribute) {
throw new Error('Missing web configuration element');
}
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }

// Create workbench
Expand Down
4 changes: 2 additions & 2 deletions patches/integration.diff
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
@@ -69,6 +69,7 @@ import { ICredentialsService } from 'vs/
import { IndexedDB } from 'vs/base/browser/indexedDB';
@@ -69,6 +69,7 @@ import { IndexedDB } from 'vs/base/brows
import { BrowserCredentialsService } from 'vs/workbench/services/credentials/browser/credentialsService';
import { IWorkspace } from 'vs/workbench/services/host/browser/browserHostService';
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
+import { CodeServerClient } from 'vs/workbench/browser/client';

export class BrowserMain extends Disposable {
Expand Down
24 changes: 0 additions & 24 deletions patches/last-opened.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,3 @@ respect it here then remove our own redirction code that handles this.

Our version might be better anyway since it puts the workspace in the URL.

Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
@@ -410,19 +410,6 @@ class WorkspaceProvider implements IWork
workspace = { folderUri: URI.revive(config.folderUri) };
} else if (config.workspaceUri) {
workspace = { workspaceUri: URI.revive(config.workspaceUri) };
- } else {
- workspace = (() => {
- const lastWorkspaceRaw = window.localStorage.getItem(WorkspaceProvider.LAST_WORKSPACE_STORAGE_KEY);
- if (lastWorkspaceRaw) {
- try {
- return parse(lastWorkspaceRaw); // use marshalling#parse() to revive potential URIs
- } catch (error) {
- // Ignore
- }
- }
-
- return undefined;
- })();
}
}

2 changes: 1 addition & 1 deletion patches/local-storage.diff
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
@@ -126,7 +126,14 @@ export class BrowserWorkbenchEnvironment
@@ -52,7 +52,14 @@ export class BrowserWorkbenchEnvironment
get logFile(): URI { return joinPath(this.logsHome, 'window.log'); }

@memoize
Expand Down
2 changes: 1 addition & 1 deletion patches/logout.diff
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
rootEndpoint: base,
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
+ logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
embedderIdentifier: 'server-distro',
extensionsGallery: {
...this._productService.extensionsGallery,
'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
Expand Down
4 changes: 2 additions & 2 deletions patches/marketplace.diff
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -285,14 +285,14 @@ export class WebClientServer {
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
@@ -286,14 +286,14 @@ export class WebClientServer {
productConfiguration: <Partial<IProductConfiguration>>{
rootEndpoint: base,
embedderIdentifier: 'server-distro',
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
+ extensionsGallery: {
...this._productService.extensionsGallery,
Expand Down
7 changes: 4 additions & 3 deletions patches/node-version.diff
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
===================================================================
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
+++ code-server/lib/vscode/build/gulpfile.reh.js
@@ -122,9 +122,7 @@ const serverWithWebEntryPoints = [
@@ -124,9 +124,7 @@ const serverWithWebEntryPoints = [
];

function getNodeVersion() {
Expand Down Expand Up @@ -71,7 +71,7 @@ Index: code-server/lib/vscode/build/lib/util.ts
===================================================================
--- code-server.orig/lib/vscode/build/lib/util.ts
+++ code-server/lib/vscode/build/lib/util.ts
@@ -371,9 +371,7 @@ export function streamToPromise(stream:
@@ -371,9 +371,7 @@ export function streamToPromise(stream:
}

export function getElectronVersion(): string {
Expand All @@ -91,10 +91,11 @@ Index: code-server/lib/vscode/remote/.yarnrc
===================================================================
--- code-server.orig/lib/vscode/remote/.yarnrc
+++ /dev/null
@@ -1,3 +0,0 @@
@@ -1,4 +0,0 @@
-disturl "http://nodejs.org/dist"
-target "14.16.0"
-runtime "node"
-build_from_source "true"
Index: code-server/lib/vscode/.yarnrc
===================================================================
--- code-server.orig/lib/vscode/.yarnrc
Expand Down
4 changes: 2 additions & 2 deletions patches/proxy-uri.diff
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
embedderIdentifier: 'server-distro',
extensionsGallery: {
...this._productService.extensionsGallery,
'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
Expand All @@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
@@ -388,7 +388,7 @@ export function createTerminalEnvironmen
@@ -390,7 +390,7 @@ export function createTerminalEnvironmen

// Sanitize the environment, removing any undesirable VS Code and Electron environment
// variables
Expand Down
1 change: 0 additions & 1 deletion patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ post-install.diff
log-level.diff
local-storage.diff
service-worker.diff
last-opened.diff
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny enough, they removed the same last-opened logic that we did which means we were able to remove our patch!

microsoft/vscode@6124b10

microsoft/vscode#146364

connection-type.diff
sourcemaps.diff
4 changes: 2 additions & 2 deletions patches/service-worker.diff
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -296,6 +296,10 @@ export class WebClientServer {
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
@@ -297,6 +297,10 @@ export class WebClientServer {
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
proxyEndpointTemplate: base + '/proxy/{{port}}',
embedderIdentifier: 'server-distro',
+ serviceWorker: {
+ scope: vscodeBase + '/',
+ path: base + '/_static/out/browser/serviceWorker.js',
Expand Down
6 changes: 3 additions & 3 deletions patches/sourcemaps.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
===================================================================
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
+++ code-server/lib/vscode/build/gulpfile.reh.js
@@ -195,8 +195,7 @@ function packageTask(type, platform, arc
@@ -197,8 +197,7 @@ function packageTask(type, platform, arc

const src = gulp.src(sourceFolderName + '/**', { base: '.' })
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
Expand All @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js

const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
const isUIExtension = (manifest) => {
@@ -235,9 +234,9 @@ function packageTask(type, platform, arc
@@ -237,9 +236,9 @@ function packageTask(type, platform, arc
.map(name => `.build/extensions/${name}/**`);

const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
Expand All @@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js

let version = packageJson.version;
const quality = product.quality;
@@ -363,7 +362,7 @@ function packageTask(type, platform, arc
@@ -374,7 +373,7 @@ function tweakProductForServerWeb(produc
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
optimizeTask,
util.rimraf(`out-vscode-${type}-min`),
Expand Down
2 changes: 1 addition & 1 deletion patches/unique-db.diff
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Index: code-server/lib/vscode/src/vs/platform/storage/browser/storageService.ts
@@ -13,6 +13,7 @@ import { InMemoryStorageDatabase, isStor
import { ILogService } from 'vs/platform/log/common/log';
import { AbstractStorageService, IS_NEW_KEY, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { IWorkspaceInitializationPayload } from 'vs/platform/workspaces/common/workspaces';
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
+import { hash } from 'vs/base/common/hash';

export class BrowserStorageService extends AbstractStorageService {
Expand Down
2 changes: 1 addition & 1 deletion patches/update-check.diff
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
productConfiguration: <Partial<IProductConfiguration>>{
rootEndpoint: base,
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
embedderIdentifier: 'server-distro',
extensionsGallery: {
...this._productService.extensionsGallery,
'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
Expand Down
10 changes: 5 additions & 5 deletions patches/webview.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
@@ -240,7 +240,7 @@ export class BrowserWorkbenchEnvironment
@@ -176,7 +176,7 @@ export class BrowserWorkbenchEnvironment

@memoize
get webviewExternalEndpoint(): string {
Expand All @@ -31,11 +31,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
_wrapWebWorkerExtHostInIframe,
developmentOptions: { enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined },
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
Index: code-server/lib/vscode/src/vs/workbench/api/common/shared/webview.ts
Index: code-server/lib/vscode/src/vs/workbench/common/webview.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/api/common/shared/webview.ts
+++ code-server/lib/vscode/src/vs/workbench/api/common/shared/webview.ts
@@ -25,7 +25,7 @@ export const webviewResourceBaseHost = '
--- code-server.orig/lib/vscode/src/vs/workbench/common/webview.ts
+++ code-server/lib/vscode/src/vs/workbench/common/webview.ts
@@ -24,7 +24,7 @@ export const webviewResourceBaseHost = '

export const webviewRootResourceAuthority = `vscode-resource.${webviewResourceBaseHost}`;

Expand Down