-
Notifications
You must be signed in to change notification settings - Fork 12.8k
custom syntax providers #21861
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
Comments
I think this may be took so far on changing the syntax |
Like this This URIParserAndEmitter both generate runtime code (like a normal library) and claim itself as a typescript plugin (get type info from typescript, provide type checking), and can safely downgrade to that not support plugin one |
any expression in any language is self-contained
it doesn't seem that the scope of an expression needs to be limited |
I wish that was simple to add. the reality is everything in the compiler relies on the AST kinds, and having new kinds added to the system affects everything. Maybe if we had a system that abstracts about all of these details and can reason about code constructs in a high-level fashion it would be easier. |
you add a special AST node with think about |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
The folks who run Svelte are betting on compilers being the next step in frameworks. If that bet pans out, then a feature like this would allow projects to properly type things in their system, which would let downstream devs reap the benefits of TS, even with strange framework-specific syntax. React works beautifully in TS. It'd be cool if that kind of deep integration was available to others. |
Uh oh!
There was an error while loading. Please reload this page.
it would be great to be able to use pluggable non-typescript syntax right in the typescript code
for example, i need a notion of a valid URI literal, i have its grammar ready, i wish there was a way to specify a valid URI in a typescript code and get it checked at the compile time
currently my options are:
constructor functions (fail only at runtime)
builders (unnatural, clumsy)
i wish i could do something like this:
how it works
in the last example
URIParserAndEmitter
refers to a plugin that:=
at compile timeparsing scope
TS should not care or limit how far the custom parser can go in the source text of the file:
applications
pros
cons
The text was updated successfully, but these errors were encountered: