Skip to content

Commit b730176

Browse files
arcanismerceyz
andauthored
Improves boot time (#4261)
* Implements code splitting * Trims some fat * Reverts the parser changes * Reverts logs * Removes webpack from the dependencies * Libzip sync/async * Versions * Reverts --split * Reverts libzip changes * Reverts clipanion compat changes * Reverts unneeded changes * chore: versions * chore: lint * chore: remove `yup` dependency Co-authored-by: merceyz <[email protected]>
1 parent fde9dfa commit b730176

20 files changed

+88
-246
lines changed

.pnp.cjs

Lines changed: 17 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

.yarn/versions/78804c3b.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
releases:
2+
"@yarnpkg/cli": major
3+
"@yarnpkg/core": major
4+
"@yarnpkg/libzip": patch
5+
6+
declined:
7+
- "@yarnpkg/plugin-compat"
8+
- "@yarnpkg/plugin-constraints"
9+
- "@yarnpkg/plugin-dlx"
10+
- "@yarnpkg/plugin-essentials"
11+
- "@yarnpkg/plugin-exec"
12+
- "@yarnpkg/plugin-file"
13+
- "@yarnpkg/plugin-git"
14+
- "@yarnpkg/plugin-github"
15+
- "@yarnpkg/plugin-http"
16+
- "@yarnpkg/plugin-init"
17+
- "@yarnpkg/plugin-interactive-tools"
18+
- "@yarnpkg/plugin-link"
19+
- "@yarnpkg/plugin-nm"
20+
- "@yarnpkg/plugin-npm"
21+
- "@yarnpkg/plugin-npm-cli"
22+
- "@yarnpkg/plugin-pack"
23+
- "@yarnpkg/plugin-patch"
24+
- "@yarnpkg/plugin-pnp"
25+
- "@yarnpkg/plugin-pnpm"
26+
- "@yarnpkg/plugin-stage"
27+
- "@yarnpkg/plugin-typescript"
28+
- "@yarnpkg/plugin-version"
29+
- "@yarnpkg/plugin-workspace-tools"
30+
- vscode-zipfs
31+
- "@yarnpkg/builder"
32+
- "@yarnpkg/doctor"
33+
- "@yarnpkg/fslib"
34+
- "@yarnpkg/nm"
35+
- "@yarnpkg/pnp"
36+
- "@yarnpkg/pnpify"
37+
- "@yarnpkg/sdks"

packages/acceptance-tests/pkg-tests-specs/sources/commands/add.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ describe(`Commands`, () => {
283283
const content = await xfs.readFilePromise(`${path}/yarn.lock` as PortablePath, `utf8`);
284284
const lock = parseSyml(content);
285285

286-
await expect(lock).toMatchObject({
286+
expect(lock).toMatchObject({
287287
[`inject-node-gyp@npm:^1.0.0`]: {
288288
dependencies: {
289289
[`node-gyp`]: `latest`,

packages/yarnpkg-cli/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@
2929
"clipanion": "^3.2.0-rc.4",
3030
"semver": "^7.1.2",
3131
"tslib": "^1.13.0",
32-
"typanion": "^3.3.0",
33-
"yup": "^0.32.9"
32+
"typanion": "^3.3.0"
3433
},
3534
"devDependencies": {
3635
"@types/semver": "^7.1.0",
37-
"@types/yup": "^0",
3836
"@yarnpkg/builder": "workspace:^",
3937
"@yarnpkg/monorepo": "workspace:^",
4038
"@yarnpkg/pnpify": "workspace:^",

packages/yarnpkg-cli/sources/tools/getDynamicLibs.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as shell from '@yarnpkg/shell';
77
import * as clipanion from 'clipanion';
88
import * as semver from 'semver';
99
import * as typanion from 'typanion';
10-
import * as yup from 'yup';
1110

1211
export const getDynamicLibs = () => new Map<string, any>([
1312
[`@yarnpkg/cli`, cli],
@@ -21,6 +20,4 @@ export const getDynamicLibs = () => new Map<string, any>([
2120
[`clipanion`, clipanion],
2221
[`semver`, semver],
2322
[`typanion`, typanion],
24-
// TODO: remove in next major
25-
[`yup`, yup],
2623
]);

packages/yarnpkg-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"semver": "^7.1.2",
2727
"strip-ansi": "^6.0.0",
2828
"tar": "^6.0.5",
29-
"tinylogic": "^1.0.3",
29+
"tinylogic": "^2.0.0",
3030
"treeify": "^1.1.0",
3131
"tslib": "^1.13.0",
3232
"tunnel": "^0.0.6"

packages/yarnpkg-core/sources/httpUtils.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import {PortablePath, xfs} from '@yarnpkg/fslib';
2-
import {ExtendOptions, RequestError, Response, TimeoutError} from 'got';
3-
import {Agent as HttpsAgent} from 'https';
4-
import {Agent as HttpAgent} from 'http';
5-
import micromatch from 'micromatch';
6-
import tunnel, {ProxyOptions} from 'tunnel';
7-
import {URL} from 'url';
8-
9-
import {ConfigurationValueMap, Configuration} from './Configuration';
10-
import {MessageName} from './MessageName';
11-
import {ReportError} from './Report';
12-
import * as formatUtils from './formatUtils';
13-
import {MapValue, MapValueToObjectValue} from './miscUtils';
14-
import * as miscUtils from './miscUtils';
15-
16-
export {RequestError} from 'got';
1+
import {PortablePath, xfs} from '@yarnpkg/fslib';
2+
import type {ExtendOptions, RequestError, Response} from 'got';
3+
import {Agent as HttpsAgent} from 'https';
4+
import {Agent as HttpAgent} from 'http';
5+
import micromatch from 'micromatch';
6+
import tunnel, {ProxyOptions} from 'tunnel';
7+
import {URL} from 'url';
8+
9+
import {ConfigurationValueMap, Configuration} from './Configuration';
10+
import {MessageName} from './MessageName';
11+
import {ReportError} from './Report';
12+
import * as formatUtils from './formatUtils';
13+
import {MapValue, MapValueToObjectValue} from './miscUtils';
14+
import * as miscUtils from './miscUtils';
15+
16+
export type {RequestError} from 'got';
1717

1818
const cache = new Map<string, Promise<Buffer> | Buffer>();
1919
const fileCache = new Map<PortablePath, Promise<Buffer> | Buffer>();
@@ -64,8 +64,8 @@ async function prettyNetworkError(response: Promise<Response<any>>, {configurati
6464
}
6565
}
6666

67-
if (err instanceof TimeoutError && err.event === `socket`)
68-
message += ` (can be increased via ${formatUtils.pretty(configuration, `httpTimeout`, formatUtils.Type.SETTING)})`;
67+
if (err.code === `ETIMEDOUT` && err.event === `socket`)
68+
message += `(can be increased via ${formatUtils.pretty(configuration, `httpTimeout`, formatUtils.Type.SETTING)})`;
6969

7070
const networkError = new ReportError(MessageName.NETWORK_ERROR, message, report => {
7171
if (err.response) {

packages/yarnpkg-libzip/sources/async.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import createModule from './libzipAsync';
21
import {Libzip, makeInterface} from './makeInterface';
32

43
let promise: Promise<Libzip> | null = null;
@@ -8,8 +7,12 @@ export function getLibzipSync() {
87
}
98

109
export async function getLibzipPromise() {
11-
if (promise === null)
12-
promise = createModule().then(libzip => makeInterface(libzip));
10+
if (promise === null) {
11+
promise = import(`./libzipAsync`).then(async ({default: createModule}) => {
12+
const libzip = await createModule();
13+
return makeInterface(libzip);
14+
});
15+
}
1316

1417
return promise;
1518
}

yarn.lock

Lines changed: 7 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ __metadata:
17161716
languageName: node
17171717
linkType: hard
17181718

1719-
"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.0, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.10.5, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.14.0, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.3.4, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.7, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7":
1719+
"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.0, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.14.0, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.3.4, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.7, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7":
17201720
version: 7.15.4
17211721
resolution: "@babel/runtime@npm:7.15.4"
17221722
dependencies:
@@ -1777,20 +1777,6 @@ __metadata:
17771777
languageName: node
17781778
linkType: hard
17791779

1780-
"@chevrotain/types@npm:^9.1.0":
1781-
version: 9.1.0
1782-
resolution: "@chevrotain/types@npm:9.1.0"
1783-
checksum: 95621f85dde7afbc3298440407814a04857f45fa0deefed0006441d1bdd1e09ae2243e141753ca2d1b08845f3c391dd03532f219e12be8c5e1d12b0b12ad342a
1784-
languageName: node
1785-
linkType: hard
1786-
1787-
"@chevrotain/utils@npm:^9.1.0":
1788-
version: 9.1.0
1789-
resolution: "@chevrotain/utils@npm:9.1.0"
1790-
checksum: 3bf20cd22e2f5d64f9cfd968c6355e440abb833b8283a37ff67d1ba56a219f2c9f93a194f2c51befb9932475c6d1fa98376f2ace248c2e391639931e0305a783
1791-
languageName: node
1792-
linkType: hard
1793-
17941780
"@cnakazawa/watch@npm:^1.0.3":
17951781
version: 1.0.3
17961782
resolution: "@cnakazawa/watch@npm:1.0.3"
@@ -4351,7 +4337,7 @@ __metadata:
43514337
languageName: node
43524338
linkType: hard
43534339

4354-
"@types/lodash@npm:*, @types/lodash@npm:^4.14.136, @types/lodash@npm:^4.14.165, @types/lodash@npm:^4.14.92":
4340+
"@types/lodash@npm:*, @types/lodash@npm:^4.14.136, @types/lodash@npm:^4.14.92":
43554341
version: 4.14.172
43564342
resolution: "@types/lodash@npm:4.14.172"
43574343
checksum: e93b14543aa7c9f14bd8f1fdd5e309927d00e13ad3a91f16be167ea0f36ad412901d648dd16dd6df68973c02b899c354a28c3b5f76ec881d6bc2e8a8ef1e3a41
@@ -4822,13 +4808,6 @@ __metadata:
48224808
languageName: node
48234809
linkType: hard
48244810

4825-
"@types/yup@npm:^0":
4826-
version: 0.29.11
4827-
resolution: "@types/yup@npm:0.29.11"
4828-
checksum: d33af937ef241499ee22e7a819c8fe8b07403c6aaaa750567a8daf79982df58a599f5c16fe405eb139fed49553731586620e04d4d0a21b7010597d8d643946b5
4829-
languageName: node
4830-
linkType: hard
4831-
48324811
"@typescript-eslint/eslint-plugin@npm:^4.29.3":
48334812
version: 4.31.2
48344813
resolution: "@typescript-eslint/eslint-plugin@npm:4.31.2"
@@ -5407,7 +5386,6 @@ __metadata:
54075386
resolution: "@yarnpkg/cli@workspace:packages/yarnpkg-cli"
54085387
dependencies:
54095388
"@types/semver": ^7.1.0
5410-
"@types/yup": ^0
54115389
"@yarnpkg/builder": "workspace:^"
54125390
"@yarnpkg/core": "workspace:^"
54135391
"@yarnpkg/fslib": "workspace:^"
@@ -5438,7 +5416,6 @@ __metadata:
54385416
semver: ^7.1.2
54395417
tslib: ^1.13.0
54405418
typanion: ^3.3.0
5441-
yup: ^0.32.9
54425419
peerDependencies:
54435420
"@yarnpkg/core": "workspace:^"
54445421
languageName: unknown
@@ -5486,7 +5463,7 @@ __metadata:
54865463
semver: ^7.1.2
54875464
strip-ansi: ^6.0.0
54885465
tar: ^6.0.5
5489-
tinylogic: ^1.0.3
5466+
tinylogic: ^2.0.0
54905467
treeify: ^1.1.0
54915468
tslib: ^1.13.0
54925469
tunnel: ^0.0.6
@@ -8373,17 +8350,6 @@ __metadata:
83738350
languageName: node
83748351
linkType: hard
83758352

8376-
"chevrotain@npm:^9.1.0":
8377-
version: 9.1.0
8378-
resolution: "chevrotain@npm:9.1.0"
8379-
dependencies:
8380-
"@chevrotain/types": ^9.1.0
8381-
"@chevrotain/utils": ^9.1.0
8382-
regexp-to-ast: 0.5.0
8383-
checksum: d8e5cd89c0baa0b227ed39eb425cc8a1ffe533fe9993850f130bd7771963f30bb6095624e58c2acd0dc933b622834f17df0e5100f63d1008d64967a135f6e229
8384-
languageName: node
8385-
linkType: hard
8386-
83878353
"chokidar@npm:^2.1.8":
83888354
version: 2.1.8
83898355
resolution: "chokidar@npm:2.1.8"
@@ -17102,13 +17068,6 @@ __metadata:
1710217068
languageName: node
1710317069
linkType: hard
1710417070

17105-
"lodash-es@npm:^4.17.15":
17106-
version: 4.17.21
17107-
resolution: "lodash-es@npm:4.17.21"
17108-
checksum: d1c3ee94118daeeee47c630ab5f91e94cc4e41ebe2452d837edbe599e853eb2d4be7edf82b4fe62f9fc74f27a8ed7f82fdbd9d301d0acef88f00941db64c4843
17109-
languageName: node
17110-
linkType: hard
17111-
1711217071
"lodash._reinterpolate@npm:~3.0.0":
1711317072
version: 3.0.0
1711417073
resolution: "lodash._reinterpolate@npm:3.0.0"
@@ -18695,13 +18654,6 @@ __metadata:
1869518654
languageName: node
1869618655
linkType: hard
1869718656

18698-
"nanoclone@npm:^0.2.1":
18699-
version: 0.2.1
18700-
resolution: "nanoclone@npm:0.2.1"
18701-
checksum: 24a9268a93d4e40f5bda016777ebbc4bdf878ec92c062070fee95d0d77ae22869da6589eb1037116c9d59ded61fd30f8c4418bff24bec9d49f4c65ea7f0c4746
18702-
languageName: node
18703-
linkType: hard
18704-
1870518657
"nanocolors@npm:^0.1.5":
1870618658
version: 0.1.6
1870718659
resolution: "nanocolors@npm:0.1.6"
@@ -21077,13 +21029,6 @@ __metadata:
2107721029
languageName: node
2107821030
linkType: hard
2107921031

21080-
"property-expr@npm:^2.0.4":
21081-
version: 2.0.4
21082-
resolution: "property-expr@npm:2.0.4"
21083-
checksum: 5c68f0d092c0962469749a7913d11e43d43ae970cdd2dce80b653bdf53170625d41142d7f787d45d2d36633c82c2fee4221176aa3b87d3cdda438defb7206afa
21084-
languageName: node
21085-
linkType: hard
21086-
2108721032
"property-information@npm:^5.0.0, property-information@npm:^5.3.0":
2108821033
version: 5.6.0
2108921034
resolution: "property-information@npm:5.6.0"
@@ -22084,13 +22029,6 @@ __metadata:
2208422029
languageName: node
2208522030
linkType: hard
2208622031

22087-
"regexp-to-ast@npm:0.5.0":
22088-
version: 0.5.0
22089-
resolution: "regexp-to-ast@npm:0.5.0"
22090-
checksum: 7f03ab05187a8e2bece21ef75ea844cf280202fc011e91408d109ea02f324d1662757f5a746ab68716606bb582e9490af4bf9ebece5f3200737fb99ac3132efc
22091-
languageName: node
22092-
linkType: hard
22093-
2209422032
"regexp.prototype.flags@npm:^1.3.1":
2209522033
version: 1.3.1
2209622034
resolution: "regexp.prototype.flags@npm:1.3.1"
@@ -24917,12 +24855,10 @@ resolve@^2.0.0-next.3:
2491724855
languageName: node
2491824856
linkType: hard
2491924857

24920-
"tinylogic@npm:^1.0.3":
24921-
version: 1.0.3
24922-
resolution: "tinylogic@npm:1.0.3"
24923-
dependencies:
24924-
chevrotain: ^9.1.0
24925-
checksum: c2df54738430317f7900bb50502ee74ea57ccd31ce49bd42b51f05be7ef4460240ac18304a014ac51dd2457a873200114b424ee371a89f5bd017db47854fb936
24858+
"tinylogic@npm:^2.0.0":
24859+
version: 2.0.0
24860+
resolution: "tinylogic@npm:2.0.0"
24861+
checksum: 8c97825b2916ace0cee7dbd9f39762c063ca7cf27f5f0c3f0c16bab2de8580b07a8bb123ebcd52767ff5923919eb70f241ccc4f7d1889ad0c07aa77d88dcb409
2492624862
languageName: node
2492724863
linkType: hard
2492824864

@@ -27430,21 +27366,6 @@ [email protected]:
2743027366
languageName: node
2743127367
linkType: hard
2743227368

27433-
"yup@npm:^0.32.9":
27434-
version: 0.32.9
27435-
resolution: "yup@npm:0.32.9"
27436-
dependencies:
27437-
"@babel/runtime": ^7.10.5
27438-
"@types/lodash": ^4.14.165
27439-
lodash: ^4.17.20
27440-
lodash-es: ^4.17.15
27441-
nanoclone: ^0.2.1
27442-
property-expr: ^2.0.4
27443-
toposort: ^2.0.2
27444-
checksum: 37ba8d0c0de093b212ba0a7839dc385df914b60aff4c0e32af5173e7d54fad30d021c77ed7833c6283dbade9101c029357eb37c664e55c7216141e3c76720dd2
27445-
languageName: node
27446-
linkType: hard
27447-
2744827369
"yurnalist@npm:^2.1.0":
2744927370
version: 2.1.0
2745027371
resolution: "yurnalist@npm:2.1.0"

0 commit comments

Comments
 (0)