Skip to content

Commit da57d1a

Browse files
crisbetothePunderWoman
authored andcommitted
build: use TypeScript 5.9 for patch builds
Partially rolls back to using TypeScript 5.9 for the builds on the patch branch, because we bundle our TypeScript version with the language service which can introduce unexpected breakages for users. Note that we still allow users to install TypeScript 6.
1 parent 58ea4d2 commit da57d1a

18 files changed

Lines changed: 200 additions & 223 deletions

File tree

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ use_repo(npm, "npm")
117117
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
118118
rules_ts_ext.deps(
119119
name = "angular_npm_typescript",
120-
# Obtained by: curl --silent https://registry.npmjs.org/typescript/6.0.0-beta | jq -r '.dist.integrity'
121-
ts_integrity = "sha512-CldZdztDpQRLM1HC6WDQjQkQN5Ub5zRau737a1diGh3lPmb9oRsaWHk1y5iqK0o7+1bNJ0oXfEGRkAogFZBL+Q==",
122-
ts_version = "6.0.0-beta",
120+
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.3 | jq -r '.dist.integrity'
121+
ts_integrity = "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
122+
ts_version = "5.9.3",
123123
)
124124
use_repo(rules_ts_ext, **{"npm_typescript": "angular_npm_typescript"})
125125

MODULE.bazel.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"style-mod": "4.1.3",
9292
"tinyglobby": "0.2.15",
9393
"tslib": "2.8.1",
94-
"typescript": "6.0.0-beta",
94+
"typescript": "5.9.3",
9595
"w3c-keyname": "2.2.8",
9696
"zwitch": "^2.0.4"
9797
},

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"todomvc-common": "^1.0.5",
151151
"tslib": "^2.3.0",
152152
"tslint": "6.1.3",
153-
"typescript": "6.0.0-beta",
153+
"typescript": "5.9.3",
154154
"webtreemap": "^2.0.1",
155155
"ws": "^8.15.0",
156156
"xhr2": "0.2.1",
@@ -204,8 +204,7 @@
204204
},
205205
"resolutions": {
206206
"https-proxy-agent": "7.0.6",
207-
"saucelabs": "9.0.2",
208-
"typescript": "6.0.0-beta"
207+
"saucelabs": "9.0.2"
209208
},
210209
"pnpm": {
211210
"patchedDependencies": {},

packages/compiler-cli/src/ngtsc/imports/test/default_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ runInEachFileSystem(() => {
7979
before: [addReferenceTransformer(fooId), tracker.importPreservingTransformer()],
8080
});
8181
const testContents = host.readFile('/test.js')!;
82-
expect(testContents).toContain(`const dep_1 = __importDefault(require("./dep"));`);
82+
expect(testContents).toContain(`var dep_1 = require("./dep");`);
8383
expect(testContents).toContain(`var ref = dep_1.default;`);
8484
});
8585

packages/compiler-cli/src/ngtsc/transform/jit/test/downlevel_decorators_transform_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ describe('downlevel decorator transform', () => {
386386
`);
387387

388388
expect(diagnostics.length).toBe(0);
389-
expect(output).toContain('const externalFile = tslib_1.__importStar(require("./other-file"));');
389+
expect(output).toContain('const externalFile = require("./other-file");');
390390
expect(output).toContain(dedent`
391391
MyDir.ctorParameters = () => [
392392
{ type: externalFile.MyOtherClass }

packages/compiler-cli/src/ngtsc/translator/test/import_manager_spec.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe('import manager', () => {
2727

2828
expect(res).toBe(
2929
omitLeadingWhitespace(`
30-
"use strict";
3130
import { input } from "@angular/core";
3231
input;
3332
`),
@@ -48,7 +47,6 @@ describe('import manager', () => {
4847

4948
expect(res).toBe(
5049
omitLeadingWhitespace(`
51-
"use strict";
5250
import * as i0 from "@angular/core";
5351
i0;
5452
`),
@@ -78,7 +76,6 @@ describe('import manager', () => {
7876

7977
expect(res).toBe(
8078
omitLeadingWhitespace(`
81-
"use strict";
8279
import { input, output } from "@angular/core";
8380
input;
8481
output;
@@ -109,7 +106,6 @@ describe('import manager', () => {
109106

110107
expect(res).toBe(
111108
omitLeadingWhitespace(`
112-
"use strict";
113109
import * as i0 from "@angular/core";
114110
import * as i1 from "@angular/core/rxjs-interop";
115111
i0;
@@ -141,7 +137,6 @@ describe('import manager', () => {
141137

142138
expect(res).toBe(
143139
omitLeadingWhitespace(`
144-
"use strict";
145140
import * as i0 from "@angular/core";
146141
i0;
147142
i0.output;
@@ -172,7 +167,6 @@ describe('import manager', () => {
172167

173168
expect(res).toBe(
174169
omitLeadingWhitespace(`
175-
"use strict";
176170
import * as i0 from "@angular/core";
177171
import { input } from "@angular/core";
178172
input;
@@ -371,7 +365,6 @@ describe('import manager', () => {
371365

372366
expect(res).toBe(
373367
omitLeadingWhitespace(`
374-
"use strict";
375368
import * as i0 from "@angular/core";
376369
i0.input;
377370
i0.output;
@@ -484,7 +477,6 @@ describe('import manager', () => {
484477

485478
expect(res).toBe(
486479
omitLeadingWhitespace(`
487-
"use strict";
488480
import "@angular/core";
489481
`),
490482
);
@@ -506,7 +498,6 @@ describe('import manager', () => {
506498

507499
expect(res).toBe(
508500
omitLeadingWhitespace(`
509-
"use strict";
510501
import { input as input_1 } from "@angular/core";
511502
input_1;
512503
const input = 1;
@@ -534,7 +525,6 @@ describe('import manager', () => {
534525

535526
expect(res).toBe(
536527
omitLeadingWhitespace(`
537-
"use strict";
538528
import { input as input_1 } from "@angular/core";
539529
input_1;
540530
function x() {
@@ -566,7 +556,6 @@ describe('import manager', () => {
566556

567557
expect(res).toBe(
568558
omitLeadingWhitespace(`
569-
"use strict";
570559
import { input } from "@angular/core";
571560
input;
572561
`),
@@ -587,7 +576,6 @@ describe('import manager', () => {
587576

588577
expect(res).toBe(
589578
omitLeadingWhitespace(`
590-
"use strict";
591579
import { input } from "@angular/core";
592580
input;
593581
`),
@@ -617,7 +605,6 @@ describe('import manager', () => {
617605

618606
expect(res).toBe(
619607
omitLeadingWhitespace(`
620-
"use strict";
621608
import { input } from "@angular/core";
622609
import { input as input_1 } from "@angular/core2";
623610
input;
@@ -650,7 +637,6 @@ describe('import manager', () => {
650637
expect(inputRef).toBe(inputRef2);
651638
expect(res).toBe(
652639
omitLeadingWhitespace(`
653-
"use strict";
654640
import { input } from "@angular/core";
655641
input;
656642
input;
@@ -805,7 +791,6 @@ describe('import manager', () => {
805791

806792
expect(res).toBe(
807793
omitLeadingWhitespace(`
808-
"use strict";
809794
import { foo as bar } from "@angular/core";
810795
bar;
811796
bar;
@@ -838,7 +823,6 @@ describe('import manager', () => {
838823

839824
expect(res).toBe(
840825
omitLeadingWhitespace(`
841-
"use strict";
842826
import { foo as bar, foo as baz } from "@angular/core";
843827
bar;
844828
baz;
@@ -870,7 +854,6 @@ describe('import manager', () => {
870854

871855
expect(res).toBe(
872856
omitLeadingWhitespace(`
873-
"use strict";
874857
import { foo, bar as foo } from "@angular/core";
875858
foo;
876859
foo;
@@ -1011,7 +994,6 @@ describe('import manager', () => {
1011994

1012995
expect(res).toBe(
1013996
omitLeadingWhitespace(`
1014-
"use strict";
1015997
import { output } from "@angular/core";
1016998
input;
1017999
output;
@@ -1041,7 +1023,6 @@ describe('import manager', () => {
10411023

10421024
expect(res).toBe(
10431025
omitLeadingWhitespace(`
1044-
"use strict";
10451026
import { input } from "@angular/core";
10461027
input;
10471028
`),
@@ -1065,7 +1046,6 @@ describe('import manager', () => {
10651046

10661047
expect(res).toBe(
10671048
omitLeadingWhitespace(`
1068-
"use strict";
10691049
foo;
10701050
`),
10711051
);

packages/compiler-cli/src/ngtsc/util/test/visitor_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ runInEachFileSystem(() => {
7878
const sf = getSourceFileOrError(program, _('/main.ts'));
7979
program.emit(sf, undefined, undefined, undefined, {before: [testTransformerFactory]});
8080
const main = host.readFile(_('/main.js'));
81-
expect(main).toMatch(/var x = 3;\s+var A_id = 2;\s+class A {/);
81+
expect(main).toMatch(/var x = 3;\s+var A_id = 2;\s+var A =/);
8282
});
8383

8484
it('handles nested statements', () => {
@@ -101,8 +101,8 @@ runInEachFileSystem(() => {
101101
const sf = getSourceFileOrError(program, _('/main.ts'));
102102
program.emit(sf, undefined, undefined, undefined, {before: [testTransformerFactory]});
103103
const main = host.readFile(_('/main.js'));
104-
expect(main).toMatch(/var A_id = 3;\s+export class A {/);
105-
expect(main).toMatch(/var B_id = 4;\s+class B {/);
104+
expect(main).toMatch(/var A_id = 3;\s+var A = /);
105+
expect(main).toMatch(/var B_id = 4;\s+var B = /);
106106
});
107107
});
108108
});

packages/compiler-cli/test/compliance/isolated/isolated_compile_spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ function compileTests(fs: FileSystem, test: ComplianceTest): {errors: string[]}
7878
...test.compilerOptions,
7979
noEmit: true,
8080
skipLibCheck: true,
81+
// Ensure we can resolve the imports in the mock FS
82+
baseUrl: rootDir,
8183
paths: {
82-
'*': ['./node_modules/*'],
84+
'*': ['node_modules/*'],
8385
},
8486
// Use classic Node resolution which works better with the simple mock FS structure
8587
// than 'Bundler' or 'NodeNext' which expect specific package.json exports.
86-
moduleResolution: ts.ModuleResolutionKind.Node16,
87-
module: ts.ModuleKind.Node16,
88+
moduleResolution: ts.ModuleResolutionKind.Node10,
8889
strict: true,
8990
// TODO: enable once we fix the generated code
9091
noImplicitAny: false,

packages/compiler-cli/test/compliance/test_cases/r3_compiler_compliance/components_and_directives/TEST_CASES.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
"description": "should emit a valid setClassMetadata call in ES5 if a class with a custom decorator is referencing itself inside its own metadata",
9696
"inputFiles": ["custom_decorator_es5.ts"],
9797
"compilerOptions": {
98-
"target": "ES5",
99-
"ignoreDeprecations": "6.0"
98+
"target": "ES5"
10099
},
101100
"compilationModeFilter": ["full compile"],
102101
"expectations": [

0 commit comments

Comments
 (0)