Skip to content

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

Merged
merged 1 commit into from
May 14, 2018

Conversation

Wilfred
Copy link
Contributor

@Wilfred Wilfred commented May 9, 2018

TypeScript does not have preprocessor macros. It was proposed in microsoft/TypeScript#4691 but never added to the language.

TypeScript does not have preprocessor macros. It was proposed in
microsoft/TypeScript#4691 but never added
to the language.
@josteink
Copy link
Member

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?

@josteink
Copy link
Member

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!

@josteink josteink merged commit 7a5c74d into emacs-typescript:master May 14, 2018
@Wilfred Wilfred deleted the remove_cpp branch May 15, 2018 08:17
@quirinpa
Copy link

quirinpa commented Aug 5, 2018

Oh my, what destructive joy. I joke. You know what this would be useful for?
Conditional static imports. Oh well. Good thing we can still run gcc before tsc, or.. Use gcc for dependency resolution, even..

Turtle master, into the sky, on a cloud.

@quirinpa
Copy link

quirinpa commented Aug 5, 2018

Oh oh. I forgot to say: Conditional static imports. Just joking.

Remember what you have destroyed.

I'll just stop now.

@josteink
Copy link
Member

josteink commented Aug 6, 2018

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? 😄

@quirinpa
Copy link

quirinpa commented Aug 8, 2018

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.
Now where's Bulma?

@quirinpa
Copy link

quirinpa commented Aug 8, 2018

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.

@Wilfred
Copy link
Contributor Author

Wilfred commented Aug 9, 2018

This PR did not actually change typescript, it only changed syntax highlighting in Emacs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants