Skip to content
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

Pass ts.Program to getCustomTransformers() #889

Merged
merged 3 commits into from Jan 5, 2019

Conversation

andersekdahl
Copy link
Contributor

A lot of transformers requires a Program instance so we pass ts.Program to getCustomTransformers() to be able to pass it on to transformers. Transformers mostly need ts.Program in order to access the type checker.

Fixes #860

@johnnyreilly
Copy link
Member

This looks awesome! Thanks for contributing!

It looks like the test output for the custom transformers needs regenerating. You can find instructions on how to do that here: https://github.com/TypeStrong/ts-loader/blob/master/test/comparison-tests/README.md#regenerating-test-data

@andersekdahl
Copy link
Contributor Author

The expected test output seems correct, as it should make the string literal uppercase but it doesn't. But I get the same failing test on master as on my commit. Do you get that as well?

Looked into it briefly and the custom transformer in the tests seems to get called, but the changes are not applied.

@johnnyreilly
Copy link
Member

As in the functionality doesn't work at all? Or just the test isn't triggering the functionality successfully?

Have you successfully used your fork locally?

I'm travelling at the moment and so can't test this myself I'm afraid...

A lot of transformers requires a Program instance so we pass ts.Program
to getCustomTransformers() to be able to pass it on to transformers
@andersekdahl
Copy link
Contributor Author

Never mind, I forgot to set transformers in an else branch and was running the tests without building first so I was fooled into believing that every commit had the same failing test. 😄

Hopefully works now!

@johnnyreilly
Copy link
Member

Nice one! I'll look to merge and release when I'm back. Thanks!

@johnnyreilly johnnyreilly merged commit e3d6367 into TypeStrong:master Jan 5, 2019
@johnnyreilly
Copy link
Member

Thanks! I'll look to ship this with ts-loader@5.3.3

@johnnyreilly
Copy link
Member

Had hoped this was going to be my first automated deployment with GitHub Actions. Alas not:

#893

Will have to do this by hand 😥

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.

None yet

2 participants