Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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: 0 additions & 1 deletion ci/build/build-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ main() {
--public-url "/static/$(git rev-parse HEAD)/dist" \
--out-dir dist \
$([[ $MINIFY ]] || echo --no-minify) \
src/browser/pages/app.ts \
src/browser/register.ts \
src/browser/serviceWorker.ts
}
Expand Down
103 changes: 42 additions & 61 deletions ci/dev/vscode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ index 0000000000..88b720ceee
+ common.minifyTask("out-vscode")
+));
diff --git a/package.json b/package.json
index 86e3d5140d..2e52256e49 100644
index 86e3d5140d..962050280c 100644
--- a/package.json
+++ b/package.json
@@ -42,6 +42,9 @@
Expand All @@ -231,6 +231,15 @@ index 86e3d5140d..2e52256e49 100644
"applicationinsights": "1.0.8",
"chokidar": "3.2.3",
"graceful-fs": "4.2.3",
@@ -185,5 +188,8 @@
"windows-foreground-love": "0.2.0",
"windows-mutex": "0.3.0",
"windows-process-tree": "0.2.4"
+ },
+ "resolutions": {
+ "minimist": "^1.2.5"
}
}
diff --git a/product.json b/product.json
index 5378b017c8..afdadda974 100644
--- a/product.json
Expand Down Expand Up @@ -679,18 +688,17 @@ index eab8591492..26668701f7 100644
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
new file mode 100644
index 0000000000..649cf32f0a
index 0000000000..8fb2a87303
--- /dev/null
+++ b/src/vs/server/browser/client.ts
@@ -0,0 +1,264 @@
@@ -0,0 +1,208 @@
+import { Emitter } from 'vs/base/common/event';
+import { URI } from 'vs/base/common/uri';
+import { localize } from 'vs/nls';
+import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
+import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
+import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
+import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
+import { ILogService } from 'vs/platform/log/common/log';
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
+import { Registry } from 'vs/platform/registry/common/platform';
+import { PersistentConnectionEventType } from 'vs/platform/remote/common/remoteAgentConnection';
Expand Down Expand Up @@ -852,61 +860,6 @@ index 0000000000..649cf32f0a
+ });
+ }
+
+ const applyUpdate = async (): Promise<void> => {
+ (services.get(ILogService) as ILogService).debug("Applying update...");
+
+ const response = await fetch(normalize(`${options.base}/update/apply`), {
+ headers: { "content-type": "application/json" },
+ });
+ const json = await response.json();
+ if (response.status !== 200 || json.error) {
+ throw new Error(json.error || response.statusText);
+ }
+ (services.get(INotificationService) as INotificationService).info(`Updated to ${json.version}`);
+ };
+
+ const getUpdate = async (): Promise<void> => {
+ (services.get(ILogService) as ILogService).debug("Checking for update...");
+
+ const response = await fetch(normalize(`${options.base}/update`), {
+ headers: { "content-type": "application/json" },
+ });
+ const json = await response.json();
+ if (response.status !== 200 || json.error) {
+ throw new Error(json.error || response.statusText);
+ }
+ if (json.isLatest) {
+ return;
+ }
+
+ (services.get(INotificationService) as INotificationService).notify({
+ severity: Severity.Info,
+ message: `code-server has an update: ${json.version}`,
+ actions: {
+ primary: [{
+ id: 'update',
+ label: 'Apply Update',
+ tooltip: '',
+ class: undefined,
+ enabled: true,
+ checked: true,
+ dispose: () => undefined,
+ run: applyUpdate,
+ }],
+ }
+ });
+ };
+
+ const updateLoop = (): void => {
+ getUpdate().catch((error) => {
+ (services.get(ILogService) as ILogService).warn(error);
+ }).finally(() => {
+ setTimeout(updateLoop, 300000);
+ });
+ };
+
+ updateLoop();
+
+ // This will be used to set the background color while VS Code loads.
+ const theme = (services.get(IStorageService) as IStorageService).get("colorThemeData", StorageScope.GLOBAL);
+ if (theme) {
Expand Down Expand Up @@ -3431,7 +3384,7 @@ index 153ac595d0..a6eb49c5dd 100644
import 'vs/workbench/services/credentials/browser/credentialsService';
import 'vs/workbench/services/url/browser/urlService';
diff --git a/yarn.lock b/yarn.lock
index 6bc96e8377..585401f144 100644
index 6bc96e8377..a2baf909d6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -140,6 +140,23 @@
Expand Down Expand Up @@ -3472,7 +3425,35 @@ index 6bc96e8377..585401f144 100644
just-debounce@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea"
@@ -6798,6 +6822,11 @@ p-try@^2.0.0:
@@ -6009,26 +6033,11 @@ minimatch@0.3:
dependencies:
brace-expansion "^1.1.7"

-minimist@0.0.8:
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
- integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
-
-minimist@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
- integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
-
-minimist@^1.2.5:
+minimist@0.0.8, minimist@^1.2.0, minimist@^1.2.5, minimist@~0.0.1:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

-minimist@~0.0.1:
- version "0.0.10"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
- integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=
-
minipass@^2.2.1, minipass@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233"
@@ -6798,6 +6807,11 @@ p-try@^2.0.0:
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1"
integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==

Expand Down
6 changes: 1 addition & 5 deletions ci/dev/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@ class Watcher {

private createBundler(out = "dist"): Bundler {
return new Bundler(
[
path.join(this.rootPath, "src/browser/pages/app.ts"),
path.join(this.rootPath, "src/browser/register.ts"),
path.join(this.rootPath, "src/browser/serviceWorker.ts"),
],
[path.join(this.rootPath, "src/browser/register.ts"), path.join(this.rootPath, "src/browser/serviceWorker.ts")],
{
outDir: path.join(this.rootPath, out),
cacheDir: path.join(this.rootPath, ".cache"),
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@
"vfile-message": "^2.0.2"
},
"dependencies": {
"@coder/logger": "1.1.11",
"@coder/logger": "1.1.16",
"env-paths": "^2.2.0",
"fs-extra": "^8.1.0",
"http-proxy": "^1.18.0",
"httpolyglot": "^0.1.2",
"js-yaml": "^3.13.1",
"limiter": "^1.1.5",
"pem": "^1.14.2",
"rotating-file-stream": "^2.1.1",
"safe-compare": "^1.1.4",
"semver": "^7.1.3",
"tar": "^6.0.1",
Expand Down
28 changes: 0 additions & 28 deletions src/browser/pages/app.html

This file was deleted.

37 changes: 0 additions & 37 deletions src/browser/pages/app.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/browser/pages/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
crossorigin="use-credentials"
/>
<link rel="apple-touch-icon" href="{{BASE}}/static/{{COMMIT}}/src/browser/media/pwa-icon-384.png" />
<link href="{{BASE}}/static/{{COMMIT}}/dist/pages/app.css" rel="stylesheet" />
<link href="{{BASE}}/static/{{COMMIT}}/dist/register.css" rel="stylesheet" />
<meta id="coder-options" data-settings="{{OPTIONS}}" />
</head>
<body>
Expand Down
51 changes: 0 additions & 51 deletions src/browser/pages/home.css

This file was deleted.

59 changes: 0 additions & 59 deletions src/browser/pages/home.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/browser/pages/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
crossorigin="use-credentials"
/>
<link rel="apple-touch-icon" href="{{BASE}}/static/{{COMMIT}}/src/browser/media/pwa-icon-384.png" />
<link href="{{BASE}}/static/{{COMMIT}}/dist/pages/app.css" rel="stylesheet" />
<link href="{{BASE}}/static/{{COMMIT}}/dist/register.css" rel="stylesheet" />
<meta id="coder-options" data-settings="{{OPTIONS}}" />
</head>
<body>
Expand Down
Loading