Skip to content

Commit 230b5dd

Browse files
authored
perf(compiler): speed up bootstrap time for isolatedModules:true (#2055)
Initializing `LanguageService` with fetching only `.d.ts` files
1 parent a726c44 commit 230b5dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+9132
-9714
lines changed

e2e/__external-repos__/custom-typings/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"test": "jest"
66
},
77
"devDependencies": {
8-
"@types/jest": "^26.0.14",
9-
"@types/jquery": "^3.5.2",
10-
"jest": "^26.5.2",
8+
"@types/jest": "^26.0.15",
9+
"@types/jquery": "^3.5.3",
10+
"jest": "^26.6.0",
1111
"jquery": "^3.5.1",
1212
"typescript": "^4.0.3"
1313
},

e2e/__external-repos__/custom-typings/yarn.lock

Lines changed: 302 additions & 358 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
*.log
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
globals: {
5+
'ts-jest': {
6+
tsconfig: "tsconfig.spec.json"
7+
}
8+
}
9+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "memory-usage",
3+
"private": true,
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "jest --no-cache --runInBand --logHeapUsage ./test"
8+
},
9+
"volta": {
10+
"node": "12.18.3"
11+
},
12+
"wantedDependencies": {
13+
"@nestjs/common": "latest",
14+
"@nestjs/core": "latest",
15+
"@nestjs/platform-express": "latest",
16+
"@nestjs/testing": "latest",
17+
"@types/jest": "latest",
18+
"@types/lodash": "latest",
19+
"jest": "latest",
20+
"lodash": "latest",
21+
"reflect-metadata": "latest",
22+
"rxjs": "latest",
23+
"typescript": "latest",
24+
"weak-napi": "latest"
25+
},
26+
"devDependencies": {
27+
"@nestjs/common": "^7.4.4",
28+
"@nestjs/core": "^7.4.4",
29+
"@nestjs/platform-express": "^7.4.4",
30+
"@nestjs/testing": "^7.4.4",
31+
"@types/jest": "^26.0.15",
32+
"@types/lodash": "^4.14.162",
33+
"jest": "^26.6.0",
34+
"lodash": "^4.17.20",
35+
"reflect-metadata": "^0.1.13",
36+
"rxjs": "^6.6.3",
37+
"typescript": "^4.0.3",
38+
"weak-napi": "^2.0.2"
39+
}
40+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Module } from "@nestjs/common";
2+
3+
@Module({})
4+
export class AppModule {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test1", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test10", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test11", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test12", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test2", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test3", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test4", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test5", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test6", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test7", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test8", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { range } from "lodash";
2+
3+
describe("test9", () => {
4+
afterAll(() => {
5+
global.gc();
6+
})
7+
8+
test.each(range(0, 100))("%i", () => {
9+
expect(true).toBe(true);
10+
});
11+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test1", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test10", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test11", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test12", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test2", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test3", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NestExpressApplication } from "@nestjs/platform-express";
2+
import { Test } from "@nestjs/testing";
3+
import { range } from "lodash";
4+
import { AppModule } from "../../src/app.module";
5+
6+
describe("test4", () => {
7+
let app: NestExpressApplication;
8+
9+
beforeAll(async () => {
10+
const testingModule = await Test.createTestingModule({
11+
imports: [AppModule],
12+
}).compile();
13+
14+
const app = testingModule.createNestApplication<NestExpressApplication>();
15+
await app.init();
16+
});
17+
18+
afterAll(async () => {
19+
await app.close();
20+
});
21+
22+
test.each(range(0, 100))("%i", () => {
23+
expect(true).toBe(true);
24+
});
25+
});

0 commit comments

Comments
 (0)