Comments (5)
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.
@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.
@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.
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.
I took the liberty and typed terser.
from terser.
Related Issues (20)
- Is it supports TypeScript to TypeScript obfuscation? HOT 1
- Resolve Ternary Operations with Static Conditions HOT 2
- Resolve Switch Statements with Static Conditions HOT 2
- keep_classnames doesn't work with var MyClass = class {} when using toplevel: true HOT 2
- Enclose setting ignored (sometimes) where topLevel is true HOT 2
- Enclose setting removes code.. irrespective of toplevel value HOT 3
- terser does not mangle function names HOT 1
- Minifying moves await keyword inside inlined non-async function HOT 5
- Build Error (TerserWriter) Cannot read property 'TYPE' of undefined HOT 10
- Build failed it show error ( Cannot read properties of undefined (reading 'TYPE') HOT 4
- Build failed it show error ( Cannot read properties of undefined (reading 'TYPE'), Solve this problem HOT 1
- Failed to minify the bundle. Error: static/js/main.eec18f52.js from Terser plugin HOT 4
- Failure to compress on hexadecimal numbers HOT 1
- Remove empty destructuring HOT 2
- quote_keys: true may cause compilation errors HOT 1
- ✨ Property mangling - allow preserve object key order HOT 5
- Terser creates non "strict" code HOT 3
- Trivial global setter function not inlined
- `ascii_only` changes semantics of redundantly escaped regexes HOT 1
- Remove exception value in `try..catch`, if it's not used HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terser.