Title: Ability for compiler host to provide resolution mode for file and say it supports impledNodeFormat · Issue #59939 · microsoft/TypeScript · GitHub
Open Graph Title: Ability for compiler host to provide resolution mode for file and say it supports impledNodeFormat · Issue #59939 · microsoft/TypeScript
X Title: Ability for compiler host to provide resolution mode for file and say it supports impledNodeFormat · Issue #59939 · microsoft/TypeScript
Description: 🔍 Search Terms resolution mode compiler host ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavior of existing JavaScript code This could be implemented ...
Open Graph Description: 🔍 Search Terms resolution mode compiler host ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavior of existing Ja...
X Description: 🔍 Search Terms resolution mode compiler host ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavior of exi...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/59939
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ability for compiler host to provide resolution mode for file and say it supports impledNodeFormat","articleBody":"### 🔍 Search Terms\n\nresolution mode compiler host\n\n### ✅ Viability Checklist\n\n- [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code\n- [X] This wouldn't change the runtime behavior of existing JavaScript code\n- [X] This could be implemented without emitting different JS based on the types of the expressions\n- [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\n- [X] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types\n- [X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals\n\n### ⭐ Suggestion\n\nRecent changes in TS 5.6 (ex. https://github.com/microsoft/TypeScript/pull/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.\r\n\r\nWould 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)\n\n### 📃 Motivating Example\n\n--\n\n### 💻 Use Cases\n\n1. Deno where we know if a file is CJS or ESM already.\r\n","author":{"url":"https://github.com/dsherret","@type":"Person","name":"dsherret"},"datePublished":"2024-09-11T09:10:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/59939/TypeScript/issues/59939"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6fab58a5-60de-cd5a-65b7-41e6354fd8ec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9056:2B9CDD:74760AE:9ED900F:6A5E52DA |
| html-safe-nonce | e49af346e9b72a004f0a64e75c9e17cb080c411f7d5967dd55056ab176f29ff8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDU2OjJCOUNERDo3NDc2MEFFOjlFRDkwMEY6NkE1RTUyREEiLCJ2aXNpdG9yX2lkIjoiMTc0MDM4NTEyMzA5MzU5ODkzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 80f3b72a70cc9163056c71f3f27d2dfbe469e47b4f5777cc5c1281d576292194 |
| hovercard-subject-tag | issue:2519110825 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/59939/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ab0327ca48f27bfb5b6741f91c4cf8df283198f125d816b675a643e9b86f0d05/microsoft/TypeScript/issues/59939 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ab0327ca48f27bfb5b6741f91c4cf8df283198f125d816b675a643e9b86f0d05/microsoft/TypeScript/issues/59939 |
| og:image:alt | 🔍 Search Terms resolution mode compiler host ✅ Viability Checklist This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime behavior of existing Ja... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dsherret |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7034b9f0130cdfcbd93bbcf3e8c0f4cc3007af54a2804bfd31f70d472b22852b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e75cd8524a0802713165f77a0088258ff9261683 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width