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

Implementing Declaration maps #575

Merged
merged 3 commits into from
Jun 11, 2018
Merged

Implementing Declaration maps #575

merged 3 commits into from
Jun 11, 2018

Conversation

michaelaird
Copy link
Contributor

@michaelaird michaelaird commented May 19, 2018

This implements outputting declaration maps . Issue #574

@ivogabe
Copy link
Owner

ivogabe commented May 23, 2018

Thanks Michael! I think it would be better if we could integrate it with gulp-sourcemaps. If I understand correctly, this new file follows the javascript source map format. (Correct me if I'm wrong.) We can emit those source maps the same way as we emit javascript sourcemaps, and let gulp-sourcemaps.write emit the sourcemaps. That would also mean that this would integrate with a preprocessor.

You would need to modify outputDts in Output. You can take a look at outputJs, which handles the JavaScript sourcemaps. Similarly to declaration, we could set declarationMap always to true. The user can then decide to emit them by adding sourcemaps.write to the declarations stream.

Can you make that change? Let me know if something is unclear or if I can help you with something.

@michaelaird
Copy link
Contributor Author

Thanks for the feedback Ivo.

My thinking was that it should follow the pattern of declaration but I missed that bit of always setting it to true and letting the user decide how to emit it. I'll have another look at it today.

I could definitely use your help in cleaning up the tests. I think I made a mess there. :(

@michaelaird
Copy link
Contributor Author

I think I've captured what you were looking for. Let me know if you think there are other changes needed. Or feel free to make adjustments

@ivogabe
Copy link
Owner

ivogabe commented May 23, 2018

Thanks for the quick changes, I’ll take a look at it friday or this weekend. The test failure is strange, as it shows some C functions in the error. It might be caused by some dependency that doesn’t support the latest node release. Have you tried googling the error message? It does succeed on LTS. I don’t think it has anything to do with your code btw.

@michaelaird
Copy link
Contributor Author

Did you have a chance to review this yet? TS 2.9 was released last Friday and we'd like to take advantage of this functionality in our project.

@ivogabe
Copy link
Owner

ivogabe commented Jun 4, 2018

Sorry, didn't have time for it. Will try to take a look at it tomorrow.

@ivogabe
Copy link
Owner

ivogabe commented Jun 5, 2018

I've taken a look and made some minor changes, see #577. Everything worked well, but I wanted to make declarationMap enabled by default. That way, when you want to have declaration maps, you only need to configure gulp-sourcemaps and you don't need to change your tsconfig file.

I think we can do a new release this week, though I also want to take a look at some other issues before the release.

@michaelaird
Copy link
Contributor Author

@ivogabe Your changes look good. enabling declaration maps by default if declarations are enabled makes total sense. Thanks!

@ivogabe ivogabe merged commit ea2025a into ivogabe:master Jun 11, 2018
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.

2 participants