Skip to content

Commit 1b0a962

Browse files
committed
Remove loading screen and move require.posix fill
1 parent d705bb1 commit 1b0a962

4 files changed

Lines changed: 4 additions & 92 deletions

File tree

packages/ide/src/client.ts

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ export abstract class IdeClient {
2323
public readonly upload = upload;
2424

2525
private start: Time | undefined;
26-
private readonly progressElement: HTMLElement | undefined;
27-
private tasks: string[] = [];
26+
private readonly tasks = <string[]>[];
2827
private finishedTaskCount = 0;
2928
private readonly loadTime: Time;
30-
private sharedProcessDataPromise: Promise<ISharedProcessData>;
29+
private readonly sharedProcessDataPromise: Promise<ISharedProcessData>;
3130

3231
public constructor() {
3332
logger.info("Loading IDE");
@@ -38,27 +37,6 @@ export abstract class IdeClient {
3837
client.onSharedProcessActive(resolve);
3938
});
4039

41-
const overlay = document.getElementById("overlay");
42-
const logo = document.getElementById("logo");
43-
const msgElement = overlay
44-
? overlay.querySelector(".message") as HTMLElement
45-
: undefined;
46-
47-
if (overlay && logo) {
48-
overlay.addEventListener("mousemove", (event) => {
49-
const xPos = ((event.clientX - logo.offsetLeft) / 24).toFixed(2);
50-
const yPos = ((logo.offsetTop - event.clientY) / 24).toFixed(2);
51-
52-
logo.style.transform = `perspective(200px) rotateX(${yPos}deg) rotateY(${xPos}deg)`;
53-
});
54-
}
55-
56-
this.progressElement = typeof document !== "undefined"
57-
? document.querySelector("#fill") as HTMLElement
58-
: undefined;
59-
60-
require("path").posix = require("path");
61-
6240
window.addEventListener("contextmenu", (event) => {
6341
event.preventDefault();
6442
});
@@ -72,28 +50,9 @@ export abstract class IdeClient {
7250
this.uriFactory = this.createUriFactory();
7351

7452
this.initialize().then(() => {
75-
if (overlay) {
76-
overlay.style.opacity = "0";
77-
overlay.addEventListener("transitionend", () => {
78-
overlay.remove();
79-
});
80-
}
8153
logger.info("Load completed", field("duration", this.loadTime));
8254
}).catch((error) => {
8355
logger.error(error.message);
84-
if (overlay) {
85-
overlay.classList.add("error");
86-
}
87-
if (msgElement) {
88-
const button = document.createElement("div");
89-
button.className = "reload-button";
90-
button.innerText = "Reload";
91-
button.addEventListener("click", () => {
92-
location.reload();
93-
});
94-
msgElement.innerText = `Failed to load: ${error.message}.`;
95-
msgElement.parentElement!.appendChild(button);
96-
}
9756
logger.warn("Load completed with errors", field("duration", this.loadTime));
9857
});
9958
}
@@ -116,12 +75,6 @@ export abstract class IdeClient {
11675
if (!this.start) {
11776
this.start = time(1000);
11877
}
119-
const updateProgress = (): void => {
120-
if (this.progressElement) {
121-
this.progressElement.style.width = `${Math.round((this.finishedTaskCount / (this.tasks.length + this.finishedTaskCount)) * 100)}%`;
122-
}
123-
};
124-
updateProgress();
12578

12679
let start: Time | undefined;
12780
try {
@@ -135,7 +88,6 @@ export abstract class IdeClient {
13588
this.tasks.splice(index, 1);
13689
}
13790
++this.finishedTaskCount;
138-
updateProgress();
13991
if (this.tasks.length === 0) {
14092
logger.info("Finished all queued tasks", field("duration", this.start), field("count", this.finishedTaskCount));
14193
this.start = undefined;
@@ -144,9 +96,6 @@ export abstract class IdeClient {
14496
return value;
14597
} catch (error) {
14698
logger.error(`Failed "${description}"`, field("duration", typeof start !== "undefined" ? start : "not started"), field("error", error));
147-
if (this.progressElement) {
148-
this.progressElement.style.backgroundColor = "red";
149-
}
15099
throw error;
151100
}
152101
}

packages/vscode/src/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import "./fill/require";
12
import * as paths from "./fill/paths";
23
import "./fill/platform";
34
import "./fill/storageDatabase";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require("path").posix = require("path");

packages/web/src/index.html

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,9 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
43
<head>
54
<meta name="viewport" content="width=device-width, initial-scale=1">
65
<title>VS Code</title>
76
</head>
8-
97
<body>
10-
<div id="overlay">
11-
<div id="logo">
12-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 313.7 220.7">
13-
<g stroke="none">
14-
<path d="M303,96.2c-6.1,0-10.2-3.5-10.2-10.7V44c0-26.5-11.1-41.1-39.8-41.1h-13.3v28h4.1c11.3,0,16.7,6.1,16.7,17.1
15-
v36.7c0,15.9,4.8,22.4,15.4,25.8c-10.6,3.2-15.4,9.8-15.4,25.8c0,9.1,0,18.2,0,27.2c0,7.6,0,15-2,22.6c-2,7-5.4,13.7-10,19.5
16-
c-2.6,3.3-5.6,6.1-8.9,8.7v3.7h13.3c28.7,0,39.8-14.6,39.8-41.1v-41.5c0-7.4,3.9-10.7,10.2-10.7h7.6v-28h-7.4L303,96.2L303,96.2z" />
17-
<path d="M212.3,45.1H171c-0.9,0-1.7-0.7-1.7-1.7v-3.2c0-0.9,0.7-1.7,1.7-1.7h41.3c0.9,0,1.7,0.7,1.7,1.7v3.2
18-
C214,44.3,213.2,45.1,212.3,45.1z" />
19-
<path d="M219.2,85.1h-30c-0.9,0-1.7-0.7-1.7-1.7v-3.1c0-0.9,0.7-1.7,1.7-1.7h30c0.9,0,1.7,0.7,1.7,1.7v3.2
20-
C220.8,84.2,220.1,85.1,219.2,85.1z" />
21-
<path d="M231,65.1h-59.9c-0.9,0-1.7-0.7-1.7-1.7v-3.1c0-0.9,0.7-1.7,1.7-1.7H231c0.9,0,1.7,0.7,1.7,1.7v3.2
22-
C232.7,64.1,232,65.1,231,65.1z" />
23-
<path d="M123.4,54.1c4.1,0,8.2,0.4,12,1.3v-7.6c0-10.7,5.6-17.1,16.7-17.1h4.1v-28h-13.3c-28.7,0-39.8,14.6-39.8,41.1
24-
v13.7C109.5,55.4,116.3,54.1,123.4,54.1z" />
25-
26-
<path d="M243.6,155c-3-23.5-21.1-43.2-44.5-47.6c-6.5-1.3-13-1.5-19.3-0.4c-0.2,0-0.2-0.2-0.4-0.2
27-
c-10.2-21.3-32.1-35.4-55.8-35.4c-23.7,0-45.4,13.7-55.8,35c-0.2,0-0.2,0.2-0.4,0.2c-6.7-0.7-13.3-0.4-20,1.3
28-
c-23,5.6-40.4,24.8-43.6,48.2c-0.4,2.4-0.6,4.8-0.6,7c0,7,4.8,13.5,11.9,14.5c8.7,1.3,16.3-5.4,16.1-13.9c0-1.3,0-2.8,0.2-4.1
29-
c1.5-11.9,10.6-21.9,22.4-24.7c3.7-0.9,7.4-1.1,10.9-0.6C76,135.8,87.1,130,91.9,120c3.5-7.4,9.1-13.9,16.5-17.4
30-
c8.2-3.9,17.4-4.4,25.9-1.5c8.9,3.2,15.6,9.8,19.6,18.2c4.3,8.2,6.3,13.9,15.4,15c3.7,0.6,14.1,0.4,18,0.2c7.6,0,15.2,2.6,20.6,8
31-
c3.5,3.7,6.1,8.3,7.2,13.5c1.7,8.3-0.4,16.7-5.4,23c-3.5,4.4-8.3,7.8-13.7,9.3c-2.6,0.7-5.2,0.9-7.8,0.9c-1.5,0-3.5,0-5.9,0
32-
c-7.4,0-23.2,0-35,0c-8.2,0-14.6-6.5-14.6-14.6v-27.4v-26.9c0-2.2-1.9-4.1-4.1-4.1h-5.7c-11.3,0.2-20.4,12.8-20.4,26.1
33-
s0,48.7,0,48.7c0,14.5,11.7,26.1,26.1,26.1c0,0,64.3-0.2,65.2-0.2c14.8-1.5,28.5-9.1,37.8-20.8C241.2,185,245.5,170.2,243.6,155z" />
34-
</g>
35-
</svg>
36-
</div>
37-
<div id="status">
38-
<div id="progress">
39-
<div id="fill"></div>
40-
</div>
41-
</div>
42-
<div class="statusbar"></div>
43-
<div class="message">
44-
</div>
45-
</div>
468
</body>
47-
489
</html>

0 commit comments

Comments
 (0)