-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Typescript Extensibility / Plugins #4876
Comments
👍 A system that could allow plugins to perform their own passes during stages of analyization and compilation would be excellent. Babel is already proving the value of this. |
👍 Yup, this can be really awesome, there are many features that can turn into extensions and shouldn't or won't ever be part of the language but people still need/want them. The question is how far is the compiler infrastructure from supporting such a story? I really hope that it's not that far but my guess is that if they will ever add it it's going to be after 2.0 :) |
This is similar to #2900 and #3003. In particular #3003 discusses why a pluggable compiler/analyzer is a challenge for TypeScript at the moment. |
Definetly agree that analyzers or things that have to plug into typescript in a high fidelity way are unlikely. But this that simply operate over the raw text would still be useful. |
If there can't be super high fidelity. I don't think people mind creating analyzers based on low fidelity? |
@RichiCoder1 then you don't need that integrated to TypeScript... This seem to be asking for some level of integration to change what is emitted at certain points as the code is processed. If all you needed to do was run over the raw text, why would you need that integrated into TypeScript? You would just use a pre-processor or a post-processor, which a lot of people do already. |
Ya my interest in this is deep integration with the language service. So you could There's lot of parts of TypeScript that could go in the 'extendable' scope. |
I think #3003 covers this topic well enough. Let's just discuss it over there. A large proposal of some particular design/implementation might warrant a new issue but we already have a place to +1 this idea and chat about it. |
Thanks! |
I think typescript could benefit from some sort of plugin/extensibility system. This would allow for people to design language features that are helpful to their particular needs, without requiring a change in Typescript.
Here are a few examples of possible extensions:
Add language support for defining properties with getters and setters.
Add preprocessing to the code that doesn't break source mapping.
While this can be accomplished with external tools, it breaks source mapping. With a complex build, like:
-- note(UglifyJS can optimize out constants, so defining a
const DEBUG=true|false
can optimize out debug code as well.if(DEBUG) expr;
)The text was updated successfully, but these errors were encountered: