GithubHelp home page GithubHelp logo

Comments (3)

kmturley avatar kmturley commented on September 26, 2024 1

Thanks for your prompt response. I understand what the libraries are, i'm questioning the need for them.

https://www.npmjs.com/package/tslib and importHelpers configuration reduces code size when compiling to es2015, but your project uses es2022.

For example:

git clone https://github.com/jsynowiec/node-typescript-boilerplate.git
cd node-typescript-boilerplate
npm install
npm run build
cat ./build/src/main.js

Then update tsconfig.json value"importHelpers": false and then:

npm run build
cat ./build/src/main.js

Notice nothing has changed in the built main.js file.

Then update tsconfig.json valueES2015 and then:

npm run build
cat ./build/src/main.js

Notice the bloat code is there for es2015, so tslib is useful for es2015.

I didn't try every helper method in: https://github.com/microsoft/tslib/blob/main/modules/index.js
but my assumption is many of these are not needed when compiling to es2022

from node-typescript-boilerplate.

jsynowiec avatar jsynowiec commented on September 26, 2024 1

I appreciate your comment. Because this project has been around for 8 years now, and went through many updates and switched over several Node and TypeScript LTS versions and ES targets, this indeed may be an obsolete artifact now. I will take a look at some point if it is fine to remove, and it does not break anything.

However, I am still convinced that ts-api-utils needs to stay pinned. It is used by, for example, eslint. In the past, there were at least a few non-obvious problems related to version incompatibilities with the old tsutils, what ts-api-util replaces, and the linter and its dependencies.

from node-typescript-boilerplate.

jsynowiec avatar jsynowiec commented on September 26, 2024

This has already been discussed.

tslib is a runtime library for TypeScript importHelpers. When this compiler option is enabled, you need to ensure that the tslib module is available at runtime.

For an explanation about ts-api-utils, please see #37 and #44.

from node-typescript-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.