René's URL Explorer Experiment


Title: Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript · GitHub

Open Graph Title: Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript

X Title: Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript

Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript

Open Graph Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript

X Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript

Opengraph URL: https://github.com/microsoft/TypeScript

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change declaration file import paths from `.js` to `.d.ts`","articleBody":"# Suggestion\r\n\r\n\u003c!--\r\n  Please fill in each section completely. Thank you!\r\n-->\r\n\r\n## 🔍 Search Terms\r\n\r\n\u003c!--\r\n  💡 Did you know? TypeScript has over 2,000 open suggestions!\r\n  🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.\r\n  The \"Common Feature Requests\" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests\r\n\r\n  Replace the text below:\r\n-->\r\n\r\n- `declaration import paths`\r\n- `esnext declaration import path`\r\n\r\nI also know there's a lot of somewhat-related conversation around this area in #37582 and #46452 , but this is only for the output of declaration files, so I'm not sure if it's exactly related to those issues or not. If it is, feel free to close this and accept my apologies. \r\n\r\n## ✅ Viability Checklist\r\n\r\n\u003c!--\r\n   Suggestions that don't meet all these criteria are very, very unlikely to be accepted.\r\n   We always recommend reviewing the TypeScript design goals before investing time writing\r\n   a proposal for ideas outside the scope of the project.\r\n-->\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n\r\n## ⭐ Suggestion\r\n\r\nWhen using TypeScript to `emitDeclarationOnly`, it outputs a `.d.ts` file. However, the contents of that file keep the same import path. An example:\r\n\r\n```ts\r\n// in `index.d.ts`\r\nexport {TestFunc} from './other.js';\r\n```\r\n\r\nWhat would be nice, however, is to have the declaration file import paths point to the actual file, like so:\r\n\r\n```ts\r\n// in `index.d.ts`\r\nexport {TestFunc} from './other.d.ts';\r\n```\r\n\r\nTo maybe help see more clearly, I created [this repo](https://github.com/frehner/typescript-output-testing) that has the current source code and output files when running `npx tsc --emitDeclarationOnly`. You'll note that the [`/types/index.d.ts`](https://github.com/frehner/typescript-output-testing/blob/main/types/index.d.ts) file has an import/export path to a file that doesn't actually exist, but is still found when using something like node's resolution algorithm.\r\n\r\n## 📃 Motivating Example\r\n\r\nWhen using Deno, you can put up your library + types up on a CDN. However, Deno must have the exact path to the file in order for it to work. Unfortunately it seems that it means that the other declaration files cannot be found because the import path in the declaration file isn't exactly correct. \r\n\r\nUnless I've missed something important about TS / Deno? \r\n\r\n## 💻 Use Cases\r\n\r\nI don't _think_ this would have any effects on the ecosystem, would it? Is there a chance it would maybe even make things slightly faster when looking up types (even for node projects), because the declaration files are pointing directly to the correct file instead of having to go through the resolution algorithm? I'm not sure, I'll defer to you experts. \r\n\r\nThank you ❤️ ","author":{"url":"https://github.com/frehner","@type":"Person","name":"frehner"},"datePublished":"2022-09-03T23:15:12Z","url":"https://github.com/microsoft/TypeScript/issues/50629"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:04ffa161-64cc-c57e-603a-9da7b2b976e7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA5AA:240CD1:C67F84:FE14AF:6B00FF1B
html-safe-nonce0b16e4d242190092c05cdd12dec4d3860ff2ce7c9ff0c7c37942f8485f8e11ea
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUFBOjI0MENEMTpDNjdGODQ6RkUxNEFGOjZCMDBGRjFCIiwidmlzaXRvcl9pZCI6IjMyNDI0MzA2OTM3MDMyMjEwMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd828c1b808751f4d2a008ed5ffedd9d2ae2a776f621b0a6a0f188a34d2371280
hovercard-subject-tagrepository:20929025
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/microsoft/TypeScript/issues/50629
twitter:imagehttps://opengraph.githubassets.com/e15f464ad8bbc0886f9cd391ce162cf993e58707e2cc6a0d2b7f905bfb541c3b/microsoft/TypeScript
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e15f464ad8bbc0886f9cd391ce162cf993e58707e2cc6a0d2b7f905bfb541c3b/microsoft/TypeScript
og:image:altTypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Change declaration file import paths from `.js` to `.d.ts` · Issue #50629 · microsoft/TypeScript
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-cache
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/50629#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F50629
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F50629
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/50629
Reloadhttps://github.com/microsoft/TypeScript/issues/50629
Reloadhttps://github.com/microsoft/TypeScript/issues/50629
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50629
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50629
Change declaration file import paths from .js to .d.tshttps://github.com/microsoft/TypeScript/issues/50629#top
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/frehner
Anthony Frehner (frehner)https://github.com/frehner
on Sep 3, 2022https://github.com/microsoft/TypeScript/issues/50629#issue-1360980442
#37582https://github.com/microsoft/TypeScript/issues/37582
#46452https://github.com/microsoft/TypeScript/issues/46452
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
this repohttps://github.com/frehner/typescript-output-testing
/types/index.d.tshttps://github.com/frehner/typescript-output-testing/blob/main/types/index.d.ts
https://github.com/frehner
Anthony Frehner (frehner)https://github.com/frehner
on Sep 6, 2022https://github.com/microsoft/TypeScript/issues/50629#issuecomment-1238626026
"providing types when importing" guidehttps://deno.land/manual@v1.25.1/typescript/types#providing-types-when-importing
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Sep 7, 2022https://github.com/microsoft/TypeScript/issues/50629#issuecomment-1240014658
#50152https://github.com/microsoft/TypeScript/issues/50152
#50153https://github.com/microsoft/TypeScript/pull/50153
Andrew Branch (andrewbranch)https://github.com/andrewbranch
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
on Sep 7, 2022https://github.com/microsoft/TypeScript/issues/50629#event-7342792963
https://github.com/frehner
Anthony Frehner (frehner)https://github.com/frehner
on Sep 7, 2022https://github.com/microsoft/TypeScript/issues/50629#issuecomment-1240029317
#50152https://github.com/microsoft/TypeScript/issues/50152
#50153https://github.com/microsoft/TypeScript/pull/50153
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/50629
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50629
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.