Giter Club home page Giter Club logo

Comments (5)

kzc avatar kzc commented on May 19, 2024

Terser only supports standard ECMAScript. By accepting JSX or TypeScript syntax it's a slippery slope towards maintaining non-standard features. There is a risk of ECMAScript grammar breakage if TypeScript syntax is introduced. It would also slow down ES parsing. Nevermind the TS language extensions (enums for example) - we don't want to get into the business of being a TS/JSX to ES transpiler.

But if you do create such a Terser fork and publish it yourself it can easily be dropped into existing projects with the yarn resolutions mechanism.

from terser.

Conduitry avatar Conduitry commented on May 19, 2024

@kzc I don't think @manucorporat is talking about transpiling or porting anything - I believe this ticket is just to provide a types.d.ts file that describes terser's API, which consuming projects can use for type inference.

from terser.

kibertoad avatar kibertoad commented on May 19, 2024

@kzc Here is an example of typings inside a 100% standard ECMAScript project :)
https://github.com/kibertoad/objection-find-query/blob/master/index.d.ts

from terser.

kzc avatar kzc commented on May 19, 2024

provide a types.d.ts file that describes terser's API

My mistake. If that's the case and it does not interfere with the existing Terser ES5 codebase in any way, then such a PR would be considered. Mind you, as the Terser minify API is extended and altered it is an additional maintenance burden.

from terser.

JordiAnderl avatar JordiAnderl commented on May 19, 2024

I took the liberty and typed terser.

from terser.

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.