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

Ability for compiler host to provide resolution mode for file and say it supports impledNodeFormat #59939

Closed
6 tasks done
dsherret opened this issue Sep 11, 2024 · 2 comments
Closed
6 tasks done

Comments

@dsherret
Copy link
Contributor

πŸ” Search Terms

resolution mode compiler host

βœ… Viability Checklist

⭐ Suggestion

Recent changes in TS 5.6 (ex. #58825) have meant that typescript more conditionally checks sourceFile.impliedNodeFormat. In Deno, we do all the resolution to tell if something is CJS or ESM and this property will always be set accordingly.

Would you be open to a PR that changes some of this code to instead ask the compiler host for the implied node format and the default implementation of that would use what's currently done in TypeScript? (I'm working around this issue in the meantime, but I'd rather not do so many custom changes just for this, which is why I'm opening this issue)

πŸ“ƒ Motivating Example

--

πŸ’» Use Cases

  1. Deno where we know if a file is CJS or ESM already.
@dsherret
Copy link
Contributor Author

I've been looking at the code more and I kind of feel like maybe I should be just using NodeNext in Deno. I guess it's on "Classic" at the moment even though it has its own custom module resolution.

@dsherret
Copy link
Contributor Author

Yeah, going to close this one. It seems just using NodeNext solves my issue.

@dsherret dsherret closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
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

No branches or pull requests

1 participant