-
Notifications
You must be signed in to change notification settings - Fork 78
Remove logic handling preprocessor macros #72
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
Conversation
TypeScript does not have preprocessor macros. It was proposed in microsoft/TypeScript#4691 but never added to the language.
Thanks for another PR @Wilfred! I'm all for removing pointless legacy code to keep the rest of the code easier to maintain. Glancing over this, I cannot see it covered by any tests, and all the code in question seems to stem from the initial commit (meaning none of the current maintainers feel any ownership to it). As long as everything still works, I'm supportive of these changes. Anyone else have any opinions? |
LGTM. I've just ran and tested this on some of my projects, and I can't see it introducing any regressions. Consider it merged! |
Oh my, what destructive joy. I joke. You know what this would be useful for? Turtle master, into the sky, on a cloud. |
Oh oh. I forgot to say: Conditional static imports. Just joking. Remember what you have destroyed. I'll just stop now. |
Maybe this is a joke, and I'm just slow (it's monday morning after all)... But would you care to elaborate on this with an example? 😄 |
You're not slow, I'm just confusing, and confused. All the time. Here it goes; In a config.ts file (or though gcc's -D flag): #define DEVELOPMENT 1 And then... #if DEVELOPMENT
import { a } from 'whatever-dev';
#else
import { a } from 'whatever-prod';
#endif Or even: #if DEVELOPMENT
#include "whatever-dev.ts"
#else
#include "whatever-prod.ts"
#endif Kawabunga. |
I'm not sure if that should be typescript's responsibility... But it would be a shame to have to let go of Tsuquyomi in order to use the gcc preprocessor. I wish JS build tools integrated well with oldschool tools.. Sad turtle. |
This PR did not actually change typescript, it only changed syntax highlighting in Emacs. |
TypeScript does not have preprocessor macros. It was proposed in microsoft/TypeScript#4691 but never added to the language.