Skip to content

Commit 5370f78

Browse files
authored
Merge pull request #1927 from cdr/dead-code
Remove dead code
2 parents eccaf8e + e86c066 commit 5370f78

26 files changed

+197
-1164
lines changed

ci/build/build-code-server.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ main() {
2121
--public-url "/static/$(git rev-parse HEAD)/dist" \
2222
--out-dir dist \
2323
$([[ $MINIFY ]] || echo --no-minify) \
24-
src/browser/pages/app.ts \
2524
src/browser/register.ts \
2625
src/browser/serviceWorker.ts
2726
}

ci/dev/vscode.patch

Lines changed: 42 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ index da4fa3e9d0..50f3e1144f 100644
252252

253253
function processLib() {
254254
diff --git a/package.json b/package.json
255-
index 86e3d5140d..2e52256e49 100644
255+
index 86e3d5140d..962050280c 100644
256256
--- a/package.json
257257
+++ b/package.json
258258
@@ -42,6 +42,9 @@
@@ -265,6 +265,15 @@ index 86e3d5140d..2e52256e49 100644
265265
"applicationinsights": "1.0.8",
266266
"chokidar": "3.2.3",
267267
"graceful-fs": "4.2.3",
268+
@@ -185,5 +188,8 @@
269+
"windows-foreground-love": "0.2.0",
270+
"windows-mutex": "0.3.0",
271+
"windows-process-tree": "0.2.4"
272+
+ },
273+
+ "resolutions": {
274+
+ "minimist": "^1.2.5"
275+
}
276+
}
268277
diff --git a/product.json b/product.json
269278
index 5378b017c8..afdadda974 100644
270279
--- a/product.json
@@ -713,18 +722,17 @@ index eab8591492..26668701f7 100644
713722
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
714723
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
715724
new file mode 100644
716-
index 0000000000..649cf32f0a
725+
index 0000000000..8fb2a87303
717726
--- /dev/null
718727
+++ b/src/vs/server/browser/client.ts
719-
@@ -0,0 +1,264 @@
728+
@@ -0,0 +1,208 @@
720729
+import { Emitter } from 'vs/base/common/event';
721730
+import { URI } from 'vs/base/common/uri';
722731
+import { localize } from 'vs/nls';
723732
+import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
724733
+import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
725734
+import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
726735
+import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
727-
+import { ILogService } from 'vs/platform/log/common/log';
728736
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
729737
+import { Registry } from 'vs/platform/registry/common/platform';
730738
+import { PersistentConnectionEventType } from 'vs/platform/remote/common/remoteAgentConnection';
@@ -886,61 +894,6 @@ index 0000000000..649cf32f0a
886894
+ });
887895
+ }
888896
+
889-
+ const applyUpdate = async (): Promise<void> => {
890-
+ (services.get(ILogService) as ILogService).debug("Applying update...");
891-
+
892-
+ const response = await fetch(normalize(`${options.base}/update/apply`), {
893-
+ headers: { "content-type": "application/json" },
894-
+ });
895-
+ const json = await response.json();
896-
+ if (response.status !== 200 || json.error) {
897-
+ throw new Error(json.error || response.statusText);
898-
+ }
899-
+ (services.get(INotificationService) as INotificationService).info(`Updated to ${json.version}`);
900-
+ };
901-
+
902-
+ const getUpdate = async (): Promise<void> => {
903-
+ (services.get(ILogService) as ILogService).debug("Checking for update...");
904-
+
905-
+ const response = await fetch(normalize(`${options.base}/update`), {
906-
+ headers: { "content-type": "application/json" },
907-
+ });
908-
+ const json = await response.json();
909-
+ if (response.status !== 200 || json.error) {
910-
+ throw new Error(json.error || response.statusText);
911-
+ }
912-
+ if (json.isLatest) {
913-
+ return;
914-
+ }
915-
+
916-
+ (services.get(INotificationService) as INotificationService).notify({
917-
+ severity: Severity.Info,
918-
+ message: `code-server has an update: ${json.version}`,
919-
+ actions: {
920-
+ primary: [{
921-
+ id: 'update',
922-
+ label: 'Apply Update',
923-
+ tooltip: '',
924-
+ class: undefined,
925-
+ enabled: true,
926-
+ checked: true,
927-
+ dispose: () => undefined,
928-
+ run: applyUpdate,
929-
+ }],
930-
+ }
931-
+ });
932-
+ };
933-
+
934-
+ const updateLoop = (): void => {
935-
+ getUpdate().catch((error) => {
936-
+ (services.get(ILogService) as ILogService).warn(error);
937-
+ }).finally(() => {
938-
+ setTimeout(updateLoop, 300000);
939-
+ });
940-
+ };
941-
+
942-
+ updateLoop();
943-
+
944897
+ // This will be used to set the background color while VS Code loads.
945898
+ const theme = (services.get(IStorageService) as IStorageService).get("colorThemeData", StorageScope.GLOBAL);
946899
+ if (theme) {
@@ -3465,7 +3418,7 @@ index 153ac595d0..a6eb49c5dd 100644
34653418
import 'vs/workbench/services/credentials/browser/credentialsService';
34663419
import 'vs/workbench/services/url/browser/urlService';
34673420
diff --git a/yarn.lock b/yarn.lock
3468-
index 6bc96e8377..585401f144 100644
3421+
index 6bc96e8377..a2baf909d6 100644
34693422
--- a/yarn.lock
34703423
+++ b/yarn.lock
34713424
@@ -140,6 +140,23 @@
@@ -3506,7 +3459,35 @@ index 6bc96e8377..585401f144 100644
35063459
just-debounce@^1.0.0:
35073460
version "1.0.0"
35083461
resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea"
3509-
@@ -6798,6 +6822,11 @@ p-try@^2.0.0:
3462+
@@ -6009,26 +6033,11 @@ minimatch@0.3:
3463+
dependencies:
3464+
brace-expansion "^1.1.7"
3465+
3466+
-minimist@0.0.8:
3467+
- version "0.0.8"
3468+
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
3469+
- integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
3470+
-
3471+
-minimist@^1.2.0:
3472+
- version "1.2.0"
3473+
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
3474+
- integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
3475+
-
3476+
-minimist@^1.2.5:
3477+
+minimist@0.0.8, minimist@^1.2.0, minimist@^1.2.5, minimist@~0.0.1:
3478+
version "1.2.5"
3479+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
3480+
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
3481+
3482+
-minimist@~0.0.1:
3483+
- version "0.0.10"
3484+
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
3485+
- integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=
3486+
-
3487+
minipass@^2.2.1, minipass@^2.3.3:
3488+
version "2.3.3"
3489+
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233"
3490+
@@ -6798,6 +6807,11 @@ p-try@^2.0.0:
35103491
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1"
35113492
integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==
35123493

ci/dev/watch.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,7 @@ class Watcher {
144144

145145
private createBundler(out = "dist"): Bundler {
146146
return new Bundler(
147-
[
148-
path.join(this.rootPath, "src/browser/pages/app.ts"),
149-
path.join(this.rootPath, "src/browser/register.ts"),
150-
path.join(this.rootPath, "src/browser/serviceWorker.ts"),
151-
],
147+
[path.join(this.rootPath, "src/browser/register.ts"), path.join(this.rootPath, "src/browser/serviceWorker.ts")],
152148
{
153149
outDir: path.join(this.rootPath, out),
154150
cacheDir: path.join(this.rootPath, ".cache"),

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@
6464
"vfile-message": "^2.0.2"
6565
},
6666
"dependencies": {
67-
"@coder/logger": "1.1.11",
67+
"@coder/logger": "1.1.16",
6868
"env-paths": "^2.2.0",
6969
"fs-extra": "^8.1.0",
7070
"http-proxy": "^1.18.0",
7171
"httpolyglot": "^0.1.2",
7272
"js-yaml": "^3.13.1",
7373
"limiter": "^1.1.5",
7474
"pem": "^1.14.2",
75+
"rotating-file-stream": "^2.1.1",
7576
"safe-compare": "^1.1.4",
7677
"semver": "^7.1.3",
7778
"tar": "^6.0.1",

src/browser/pages/app.html

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

src/browser/pages/app.ts

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

src/browser/pages/error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
crossorigin="use-credentials"
1919
/>
2020
<link rel="apple-touch-icon" href="{{BASE}}/static/{{COMMIT}}/src/browser/media/pwa-icon-384.png" />
21-
<link href="{{BASE}}/static/{{COMMIT}}/dist/pages/app.css" rel="stylesheet" />
21+
<link href="{{BASE}}/static/{{COMMIT}}/dist/register.css" rel="stylesheet" />
2222
<meta id="coder-options" data-settings="{{OPTIONS}}" />
2323
</head>
2424
<body>

src/browser/pages/home.css

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

src/browser/pages/home.html

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

src/browser/pages/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
crossorigin="use-credentials"
1919
/>
2020
<link rel="apple-touch-icon" href="{{BASE}}/static/{{COMMIT}}/src/browser/media/pwa-icon-384.png" />
21-
<link href="{{BASE}}/static/{{COMMIT}}/dist/pages/app.css" rel="stylesheet" />
21+
<link href="{{BASE}}/static/{{COMMIT}}/dist/register.css" rel="stylesheet" />
2222
<meta id="coder-options" data-settings="{{OPTIONS}}" />
2323
</head>
2424
<body>

0 commit comments

Comments
 (0)