microsoft / microsoft/tslib

tslib >=2.5.1 regression - increases bundle size caused by noop `Object.create;` statements

Open
#212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
145
PR merge metrics
No merged PRs in 30d

Description

deps in our repo:

  • typescript 4.7
  • webpack 5.83.1
  • tslib 2.4.1

while bumping from tslib 2.4.1 to 2.5.3 our CI blocked PRs because more than 3kb Size increase in our bundled code.

I did some amount of investigation and it looks like there is increased occurrence of Object.create; statements emitted within the bundle that don't do anything . This looks like cause of __assign helper from tslib.

if we bump only to 2.5.0 the regression does not occur.

tslib-regression.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached tslib-regression.zip and reproduce the bundle using TypeScript 4.7, webpack 5.83.1, and tslib 2.4.1, 2.5.0, and 2.5.3. Compare emitted bundles around the __assign helper and the repeated Object.create; statements; done means explaining the regression and verifying that the bundle-size increase is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.