Skip to content

Commit cf446b9

Browse files
committed
Build VS Code using TS 3.6
Fixes microsoft#80079 Updates our build to use TS 3.6. Fixes a few changes to dom apis and adds a monkey patch for the node typings break in 3.6
1 parent 31857fa commit cf446b9

16 files changed

Lines changed: 42 additions & 24 deletions

File tree

build/lib/extensions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function fromLocalWebpack(extensionPath) {
101101
result.emit('error', compilation.warnings.join('\n'));
102102
}
103103
};
104-
const webpackConfig = Object.assign({}, require(webpackConfigPath), { mode: 'production' });
104+
const webpackConfig = Object.assign(Object.assign({}, require(webpackConfigPath)), { mode: 'production' });
105105
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
106106
return webpackGulp(webpackConfig, webpack, webpackDone)
107107
.pipe(es.through(function (data) {

build/lib/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ class XLF {
176176
this.buffer.push(line.toString());
177177
}
178178
}
179+
exports.XLF = XLF;
179180
XLF.parsePseudo = function (xlfString) {
180181
return new Promise((resolve) => {
181182
let parser = new xml2js.Parser();
@@ -248,7 +249,6 @@ XLF.parse = function (xlfString) {
248249
});
249250
});
250251
};
251-
exports.XLF = XLF;
252252
class Limiter {
253253
constructor(maxDegreeOfParalellism) {
254254
this.maxDegreeOfParalellism = maxDegreeOfParalellism;

build/npm/postinstall.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ if (fs.existsSync(processTreeDts)) {
8080
fs.unlinkSync(processTreeDts);
8181
}
8282

83+
// Rewrite the @types/node typings avoid a conflict with es2018 typings.
84+
// This is caused by our build not understanding `typesVersions` in the package.json
85+
//
86+
// TODO: Fix this
87+
{
88+
console.log('Rewriting node_modules/@types/node to workaround lack of typesVersions support');
89+
const indexPath = path.join('node_modules', '@types', 'node', 'index.d.ts');
90+
91+
const contents = fs.readFileSync(indexPath).toString()
92+
.replace(/interface IteratorResult<T> \{ \}/, '// VSCODE EDIT — remove IteratorResult\n// interface IteratorResult<T> { }');
93+
fs.writeFileSync(indexPath, contents);
94+
}
95+
8396
function getInstalledVersion(packageName, cwd) {
8497
const opts = {};
8598
if (cwd) {

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"request": "^2.85.0",
4343
"terser": "^4.2.1",
4444
"tslint": "^5.9.1",
45-
"typescript": "3.5.2",
45+
"typescript": "3.6.2",
4646
"vsce": "1.48.0",
4747
"vscode-telemetry-extractor": "^1.5.4",
4848
"xml2js": "^0.4.17"

build/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,10 +2288,10 @@ typed-rest-client@^0.9.0:
22882288
tunnel "0.0.4"
22892289
underscore "1.8.3"
22902290

2291-
typescript@3.5.2:
2292-
version "3.5.2"
2293-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c"
2294-
integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==
2291+
typescript@3.6.2:
2292+
version "3.6.2"
2293+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54"
2294+
integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==
22952295

22962296
typescript@^3.0.1:
22972297
version "3.5.3"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"source-map": "^0.4.4",
132132
"ts-loader": "^4.4.2",
133133
"tslint": "^5.16.0",
134-
"typescript": "3.5.2",
134+
"typescript": "3.6",
135135
"typescript-formatter": "7.1.0",
136136
"underscore": "^1.8.2",
137137
"vinyl": "^2.0.0",

src/vs/base/browser/ui/menu/menubar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ export class MenuBar extends Disposable {
758758
if (menuBarMenu.titleElement.children.length) {
759759
let child = menuBarMenu.titleElement.children.item(0) as HTMLElement;
760760
if (child) {
761-
child.style.textDecoration = (this.options.alwaysOnMnemonics || visible) ? 'underline' : null;
761+
child.style.textDecoration = (this.options.alwaysOnMnemonics || visible) ? 'underline' : '';
762762
}
763763
}
764764
});

src/vs/base/worker/workerMain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
(<any>self).postMessage(msg, transfer);
2525
}, null);
2626

27-
self.onmessage = (e) => messageHandler.onmessage(e.data);
27+
self.onmessage = (e: MessageEvent) => messageHandler.onmessage(e.data);
2828
while (beforeReadyMessages.length > 0) {
2929
self.onmessage(beforeReadyMessages.shift()!);
3030
}
@@ -34,7 +34,7 @@
3434

3535
let isFirstMessage = true;
3636
let beforeReadyMessages: MessageEvent[] = [];
37-
self.onmessage = (message) => {
37+
self.onmessage = (message: MessageEvent) => {
3838
if (!isFirstMessage) {
3939
beforeReadyMessages.push(message);
4040
return;

src/vs/editor/browser/controller/textAreaInput.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ const enum TextAreaInputEventType {
5454
blur
5555
}
5656

57+
interface CompositionEvent extends UIEvent {
58+
readonly data: string;
59+
readonly locale: string;
60+
}
61+
5762
/**
5863
* Writes screen reader content to the textarea and is able to analyze its input events to generate:
5964
* - onCut

src/vs/editor/editor.worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export function initialize(foreignModule: any) {
1919
(<any>self).postMessage(msg);
2020
}, (host: EditorWorkerHost) => new EditorSimpleWorker(host, foreignModule));
2121

22-
self.onmessage = (e) => {
22+
self.onmessage = (e: MessageEvent) => {
2323
simpleWorker.onmessage(e.data);
2424
};
2525
}
2626

27-
self.onmessage = (e) => {
27+
self.onmessage = (e: MessageEvent) => {
2828
// Ignore first message in this case and initialize if not yet initialized
2929
if (!initialized) {
3030
initialize(null);

0 commit comments

Comments
 (0)