René's URL Explorer Experiment


Title: Consider emitting `export {}` in all ambiguous module output · Issue #38696 · microsoft/TypeScript · GitHub

Open Graph Title: Consider emitting `export {}` in all ambiguous module output · Issue #38696 · microsoft/TypeScript

X Title: Consider emitting `export {}` in all ambiguous module output · Issue #38696 · microsoft/TypeScript

Description: In TypeScript 3.9, we started preserving export * for type-only modules. While this keeps our behavior more predictable long-term, this caused bundle-size regressions for teams combining Webpack and TypeScript (webpack/webpack#10889). My...

Open Graph Description: In TypeScript 3.9, we started preserving export * for type-only modules. While this keeps our behavior more predictable long-term, this caused bundle-size regressions for teams combining Webpack an...

X Description: In TypeScript 3.9, we started preserving export * for type-only modules. While this keeps our behavior more predictable long-term, this caused bundle-size regressions for teams combining Webpack an...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consider emitting `export {}` in all ambiguous module output","articleBody":"In TypeScript 3.9, we started preserving `export *` for type-only modules. While this keeps our behavior more predictable long-term, this caused bundle-size regressions for teams combining Webpack and TypeScript (https://github.com/webpack/webpack/issues/10889).\r\n\r\nMy understanding of the situation is that tools like Webpack use a similar disambiguation strategy as that of TypeScript to figure out whether a file is a module. Given that, when Webpack resolved to an empty file, it would bail out of certain optimizations thinking it was a global script file. In reality, all users using ts-loader's `transpileModule` mode were hitting this as well - it just turned out that the new behavior uncovered this behavior in a very large codebase.\r\n\r\nWe also discovered that we were not emitting `\"use strict\"` prologue directives even under `alwaysStrict` because we assumed that the output would be a module.\r\n\r\nI also just discovered that `import type { foo } from \"bar\"` *doesn't* force an `export {}` in a module that *does* have values in it. That seems bad because this goes beyond special-casing for empty modules.\r\n\r\nHere's the outcomes I could imagine:\r\n\r\n* TypeScript always emits an `export {}`. Is this really useful if the fix is already in-flight for Webpack?\r\n* TypeScript always emits an `export {}` under `alwaysStrict` when the output is empty (but then why does this matter?)\r\n* TypeScript keeps the current behavior.\r\n\r\nPersonally, my gut was to always emit the `export {}`; then I swung into thinking that emitting `export {}` on empty modules would be a weird vestigial behavior for empty modules. But *then* I realized that TypeScript doesn't emit any sort of module marker even when using `import type`, so I'm back to thinking we should always emit `export {}`.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2020-05-20T22:19:55Z","url":"https://github.com/microsoft/TypeScript/issues/38696"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f84bb4ba-42b2-1a21-97c4-6b1de07c7fe6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA08E:7A60E:24DDF73:2F3A564:6B018298
html-safe-nonce6de2ae4891c3b08542d937541525ce81d540e500cd8f5a6c2b221acdcf610a0b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDhFOjdBNjBFOjI0RERGNzM6MkYzQTU2NDo2QjAxODI5OCIsInZpc2l0b3JfaWQiOiIzMDM2NDkwOTY3NTI0OTM0Mjk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2bfd5bf1a243e2801a66c5198eb21ac58f370e2f5ee4048c51317957a74ec426
hovercard-subject-tagissue:622119612
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/38696/issue_layout
twitter:imagehttps://opengraph.githubassets.com/14dec02bb8fb912db7e1f249ce7c6e0e33c0f936eea359c0c9ebf82ac1499712/microsoft/TypeScript/issues/38696
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/14dec02bb8fb912db7e1f249ce7c6e0e33c0f936eea359c0c9ebf82ac1499712/microsoft/TypeScript/issues/38696
og:image:altIn TypeScript 3.9, we started preserving export * for type-only modules. While this keeps our behavior more predictable long-term, this caused bundle-size regressions for teams combining Webpack an...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/38696#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F38696
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%2F38696
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/38696
Reloadhttps://github.com/microsoft/TypeScript/issues/38696
Reloadhttps://github.com/microsoft/TypeScript/issues/38696
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/38696
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/38696
#38712https://github.com/microsoft/TypeScript/pull/38712
Consider emitting export {} in all ambiguous module outputhttps://github.com/microsoft/TypeScript/issues/38696#top
#38712https://github.com/microsoft/TypeScript/pull/38712
https://github.com/weswigham
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 4.0.0https://github.com/microsoft/TypeScript/milestone/114
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on May 20, 2020https://github.com/microsoft/TypeScript/issues/38696#issue-622119612
webpack/webpack#10889https://github.com/webpack/webpack/issues/10889
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
on May 20, 2020https://github.com/microsoft/TypeScript/issues/38696#event-3358529541
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 4.0https://github.com/microsoft/TypeScript/milestone/114
on May 21, 2020https://github.com/microsoft/TypeScript/issues/38696#event-3361761567
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Wesley Wigham (weswigham)https://github.com/weswigham
on May 21, 2020https://github.com/microsoft/TypeScript/issues/38696#event-3361761847
Wesley Wigham (weswigham)https://github.com/weswigham
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#38712https://github.com/microsoft/TypeScript/pull/38712
on May 21, 2020https://github.com/microsoft/TypeScript/issues/38696#event-3362456307
https://github.com/WORMSS
Colin Richardson (WORMSS)https://github.com/WORMSS
on Jul 14, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-658208889
https://github.com/RoystonS
Royston Shufflebotham (RoystonS)https://github.com/RoystonS
on Sep 26, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-699541463
Colin Richardson (@WORMSS)https://github.com/WORMSS
webpack/webpack#11536https://github.com/webpack/webpack/issues/11536
https://github.com/WORMSS
Colin Richardson (WORMSS)https://github.com/WORMSS
on Sep 26, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-699558340
Royston Shufflebotham (@RoystonS)https://github.com/RoystonS
https://github.com/rosdi
Rosdi Kasim (rosdi)https://github.com/rosdi
on Nov 2, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-720239108
Colin Richardson (@WORMSS)https://github.com/WORMSS
https://github.com/WORMSS
Colin Richardson (WORMSS)https://github.com/WORMSS
on Nov 2, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-720241357
https://github.com/jon49
Jon Nyman (jon49)https://github.com/jon49
on Nov 12, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-726170564
https://github.com/jacoroux123
jacoroux123https://github.com/jacoroux123
on Nov 13, 2020https://github.com/microsoft/TypeScript/issues/38696#issuecomment-726591748
https://github.com/dcheung2
Dennis Cheung (dcheung2)https://github.com/dcheung2
on Feb 9, 2021https://github.com/microsoft/TypeScript/issues/38696#issuecomment-775703460
https://www.typescriptlang.org/play?ts=3.9.7#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDuiCAbwFgAoOOAI0ygC4BnGKZAc3IF8ghttps://www.typescriptlang.org/play?ts=3.9.7#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDuiCAbwFgAoOOAI0ygC4BnGKZAc3IF8g
https://www.typescriptlang.org/play?ts=4.0.5#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDuiCAbwFgAoOOAI0ygC4BnGKZAc3IF8ghttps://www.typescriptlang.org/play?ts=4.0.5#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDuiCAbwFgAoOOAI0ygC4BnGKZAc3IF8g
https://github.com/rosdi
Rosdi Kasim (rosdi)https://github.com/rosdi
on Feb 9, 2021https://github.com/microsoft/TypeScript/issues/38696#issuecomment-775774377
https://github.com/WORMSS
Colin Richardson (WORMSS)https://github.com/WORMSS
on Feb 9, 2021https://github.com/microsoft/TypeScript/issues/38696#issuecomment-775776574
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/38696
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/38696
Wesley Wigham (weswigham)https://github.com/weswigham
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 4.0.0https://github.com/microsoft/TypeScript/milestone/114
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.