diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-02 14:05:23 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-02 14:05:23 +0000 |
commit | 856e4ba126ae776753f38c00593c02c4f43be510 (patch) | |
tree | 94671175f90d50e215b6ead77de44fd8a39d3f8e /editors/code/package-lock.json | |
parent | 9006cec4928a28e4b70f536fc740fad5e82319d1 (diff) | |
parent | f08297983faac35e0b0fd475bc935ba0bc0726cb (diff) |
Merge #2979
2979: vscode: now we are actually using tslib r=matklad a=Veetaha
We had an incorrect setup where `tslib` was in `devDependencies`.
FYI:
tslib is a runtime dependency, it contains functions that are used by transpiled JavaScript in order not to inline them in each file.
For example:
```ts
// foo.ts (source code)
import * as foo from "foo";
// ---------------------------
// foo.js (compiled output)
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const foo = __importStar(require("foo"));
```
As you see, `tsc` generated that `__importStar` helper function in compiled output. And it generates it per each file if you don't enable `"importHelpers": true`. Now with `importHelpers` enabled we get the following picture:
```ts
// foo.ts (source code)
import * as foo from "foo";
// ---------------------------
// foo.js (compiled output)
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const foo = tslib_1.__importStar(require("foo"));
```
It saves some bundle size, but I am not entirely sure wheter we want that. Discussions are welcome!
Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'editors/code/package-lock.json')
-rw-r--r-- | editors/code/package-lock.json | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index f92ce1fe2..02e17d184 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json | |||
@@ -749,8 +749,7 @@ | |||
749 | "tslib": { | 749 | "tslib": { |
750 | "version": "1.10.0", | 750 | "version": "1.10.0", |
751 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", | 751 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", |
752 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", | 752 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" |
753 | "dev": true | ||
754 | }, | 753 | }, |
755 | "tslint": { | 754 | "tslint": { |
756 | "version": "5.20.1", | 755 | "version": "5.20.1", |