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

Strip extensions on file import paths when writing out TypeScript generated code #4057

Conversation

ernieturner
Copy link
Contributor

Fixes #4056

In the typegen for Typescript when we're writing the pathname for module and type imports, this PR strips any trailing .ts that might exist on the path. This is required for TypeScript file imports which don't like the trailing file suffix. This was partially fixed in #4002 but not completely.

I'm new to this repo and it's been a while since I've written some Rust, so definitely let me know if I'm doing anything wrong here or if there's any code I've missed, thanks!

I've also filled out the CLA as well.

@rbalicki2
Copy link
Contributor

Looks good to me! Thank you for making this change. I'll go ahead and import and merge it.
For future reference, it looks like this may be fixed upstream at some point: microsoft/TypeScript#37582

@facebook-github-bot
Copy link
Contributor

@rbalicki2 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@ernieturner ernieturner deleted the relayResolverImportExtensionRemoval branch September 12, 2022 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relay Resolver has module resolution problem in TypeScript
4 participants