Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(NA): moving @kbn/securitysolution-io-ts-list-types to babel transpile #109750

Conversation

mistic
Copy link
Member

@mistic mistic commented Aug 23, 2021

One step forward on #69706

That PR moves the @kbn/securitysolution-io-ts-list-types from using tsc compiler to babel transpiler to produce the js outputs.

@mistic mistic added chore Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.15.0 v7.16.0 v7.14.1 labels Aug 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any ideas on the bundle size changes?

@mistic
Copy link
Member Author

mistic commented Aug 24, 2021

@jbudz It is related with the way typescript and babel differently transpile exports. In most of the packages it is not noticeable but in packages like this one which are file and export intensive it can be noted. Here you have the differences in the outputs between the 2 transpilers:

TSC

"use strict";
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./common"), exports);
tslib_1.__exportStar(require("./request"), exports);
tslib_1.__exportStar(require("./response"), exports);
tslib_1.__exportStar(require("./typescript_types"), exports);
//# sourceMappingURL=index.js.map

BABEL

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _common = require("./common");

Object.keys(_common).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (key in exports && exports[key] === _common[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _common[key];
    }
  });
});

var _request = require("./request");

Object.keys(_request).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (key in exports && exports[key] === _request[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _request[key];
    }
  });
});

var _response = require("./response");

Object.keys(_response).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (key in exports && exports[key] === _response[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _response[key];
    }
  });
});

var _typescript_types = require("./typescript_types");

Object.keys(_typescript_types).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (key in exports && exports[key] === _typescript_types[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function () {
      return _typescript_types[key];
    }
  });
});

I'll search to see if is there anything we can do about this

@mistic mistic requested a review from a team as a code owner August 24, 2021 13:57
Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

  • Looked over this PR and everything looks as advertised 👍

@mistic mistic force-pushed the transpile-kbn-securitysolution-io-ts-list-types-with-babel branch from fd24c0d to c6d75ad Compare August 24, 2021 17:33
@mistic
Copy link
Member Author

mistic commented Aug 25, 2021

@elasticmachine merge upstream

@mistic
Copy link
Member Author

mistic commented Aug 26, 2021

@elasticmachine merge upstream

kibanamachine and others added 2 commits August 25, 2021 20:42
…bel' of github.com:mistic/kibana into transpile-kbn-securitysolution-io-ts-list-types-with-babel
@mistic
Copy link
Member Author

mistic commented Aug 26, 2021

@jbudz do you think we are good to go here?

@mistic
Copy link
Member Author

mistic commented Aug 26, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lists 295.7KB 310.5KB +14.8KB
securitySolution 6.5MB 6.5MB +14.7KB
total +29.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mistic mistic merged commit 49cc258 into elastic:master Aug 26, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 26, 2021
…nspile (elastic#109750)

* chore(NA): moving @kbn/securitysolution-io-ts-list-types to babel transpiler

* chore(NA): add a browser target

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Aug 26, 2021
…nspile (#109750) (#110296)

* chore(NA): moving @kbn/securitysolution-io-ts-list-types to babel transpiler

* chore(NA): add a browser target

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Tiago Costa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants