René's URL Explorer Experiment


Title: Proposal: Modularize Library · Issue #6974 · microsoft/TypeScript · GitHub

Open Graph Title: Proposal: Modularize Library · Issue #6974 · microsoft/TypeScript

X Title: Proposal: Modularize Library · Issue #6974 · microsoft/TypeScript

Description: Problem Currently TypeScript compiler accepts a single compiler option, target, which specify both version of library to be included during compilation and version of JavaScript for emitting code together. The behaviour presents limitati...

Open Graph Description: Problem Currently TypeScript compiler accepts a single compiler option, target, which specify both version of library to be included during compilation and version of JavaScript for emitting code t...

X Description: Problem Currently TypeScript compiler accepts a single compiler option, target, which specify both version of library to be included during compilation and version of JavaScript for emitting code t...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Modularize Library","articleBody":"# Problem\n\nCurrently TypeScript compiler accepts a single compiler option, `target`, which specify both version of library to be included during compilation and version of JavaScript for emitting code together.\nThe behaviour presents limitations in two parts of the pipeline: consuming the default library and granularly controlling how JavaScript will be emitted (e.g. what features to be down-level etc.).\nThe proposal will mainly focus on the first issue regarding using the default library.\n\nThe current behavior of `target` option doesn't allow users to have a fine-grain control on what library or feature of the library to be included, and user cannot independently control library's version from emit JavaScript version.  As summarized in [#4692](https://github.com/Microsoft/TypeScript/issues/4692) _Proposal: Granular Targeting_ and [#4168](https://github.com/Microsoft/TypeScript/issues/4168) _Normalize our lib files by compiler setting_\n- Emit ES5 JavaScript while using ES6 library during design-time (and vice-versa).\n- Include only sub-part of the ES6/ESnext library\n- Modifying default libraries can conflict with users-defined ones.\n- Using host-specific library.\n## Workaround\n\nAs @yortus points out in the [#4692](https://github.com/Microsoft/TypeScript/issues/4692) _Proposal: Granular Targeting_ , there are possible workarounds for above issues by maintaing customized version of the default library while `target` another version of emit JavaScript.\nSuch approach is cumbersome to maintain and consume any necessary fixes of the default library.\n## Related Issues:\n- [#4692](https://github.com/Microsoft/TypeScript/issues/4692) Proposal: Granular Targeting\n- [#4168](https://github.com/Microsoft/TypeScript/issues/4168) Normalize our lib files by compiler settings\n- [#3215](https://github.com/Microsoft/TypeScript/issues/3215) New APIs added to lib.d.ts may break client codes. Allow duplicated members in interfaces? Make lib.d.ts overridable?\n- [#3005](https://github.com/Microsoft/TypeScript/issues/3005) Using ES6 type default library when targetting ES5 output\n# Proposed Solution\n\nThere are two parts to the proposed solution:\n1. Introducing a new compiler flag `--lib`. The flag will be used to allow users to granularly control the default library.\n   Note: `target` flag will remain. Its behaviors with `--lib` flag will be discussed below.\n2. Breaking down the default library into smaller files, especially ES6 library and any future JavaScript library.\n## Compiler Flag `--lib`\n\nThe flag's options (see below for the full list) allows users to specify what library to be included into the compilation.\nThe flag's options can be separated into following categories:\n- JavaScript only:\n  \n  es3\n  \n  es5\n  \n  es6\n- Host only:\n  \n  node\n  \n  dom\n  \n  dom.iterable\n  \n  webworker\n  \n  scripthost\n- ES6 or ESNext by-features options:\n  \n  es6.array\n  \n  es6.collection\n  \n  es6.function\n  \n  es6.generator\n  \n  es6.iterable\n  \n  es6.math\n  \n  es6.number\n  \n  es6.object\n  \n  es6.promise\n  \n  es6.proxy\n  \n  es6.reflect\n  \n  es6.regexp\n  \n  es6.string\n  \n  es6.symbol\n  \n  es6.symbol.wellknown\n  \n  es7.array.include\n\nThe `--lib` flag is an optional flag and multiple options can be used in combination (e.g `--lib es6,dom.iterable`) and each option will be mapped to associated library.\nSo in this example, files: `lib.es6.d.ts` and `lib.dom.iterable.d.ts` will be loaded into the compilation..\nWhen `--lib` is specified, `--target` will be used solely to indicate version of emitting JavaScript.\n\nIn additional to above behavior, we still need to determine what to be included when `--lib` is not specified, should it remain the same, including  version of library specifying by `--target` and all host libraries, or including every library. -> _Current implementation is to include version of the library using `--target`\n\nThe proposal will only affect when the compiler attempts to create compilation in Program.ts. Other parts of the pipeline will not be affected by the proposal.\n# Usage:\n\nThe `--lib` flag will take an options in the form of string separated by comma. Space will not be allowed as a separator. This rule apply to both command line and tsconfig\n\nValid\n\n``` bash\ntsc --target es5 --lib es6\ntsc --target es5 --lib es5,es6.array\n```\n\n``` json\n\"compilerOptions\": {\n    ...\n    \"lib\": \"es5,es6.array\"\n}\n```\n\nInvalid command-line\n\n``` bash\ntsc --target es5--lib es5, es6.array  // es6.array will be considered a file-name\ntsc --target es5 --lib es5 es6.array  // es6.array will be considered a file-name\n```\n\n``` json\n\"compilerOptions\": {\n    ...\n    \"lib\": \"es5, es6.array\"\n}\n```\n# Working Items:\n- [X] Breaking up the library (PR #6990, this PR is folded into #6974)\n- [X] Adding compiler options (PR #6974)\n- [X] Language Service support in VS\n- [ ] Add node.d.ts and browser.d.ts\n","author":{"url":"https://github.com/yuit","@type":"Person","name":"yuit"},"datePublished":"2016-02-09T03:06:25Z","url":"https://github.com/microsoft/TypeScript/issues/6974"}

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:e8ef78a9-c545-adfc-dc4f-f283daee7bca
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA01E:34DB8F:2262757:2DF31EF:6B019759
html-safe-nonceb6cd2d15f8711e4e9de0adaba68efc24a2ffb1abaeef04768e7693450f0d5528
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDFFOjM0REI4RjoyMjYyNzU3OjJERjMxRUY6NkIwMTk3NTkiLCJ2aXNpdG9yX2lkIjoiNjgzNzI2MjY5NjMzMzgwOTQ5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6acfd0e678f09ce4eb84895062c02ee8ab71d298a733c440e535ef46db3bbffb
hovercard-subject-tagissue:132320081
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/6974/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9df9cce94c86769c564a5ed50cf55606b97f58cb07495c8710b68d1ec77fd3ce/microsoft/TypeScript/issues/6974
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9df9cce94c86769c564a5ed50cf55606b97f58cb07495c8710b68d1ec77fd3ce/microsoft/TypeScript/issues/6974
og:image:altProblem Currently TypeScript compiler accepts a single compiler option, target, which specify both version of library to be included during compilation and version of JavaScript for emitting code t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameyuit
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/6974#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F6974
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%2F6974
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/6974
Reloadhttps://github.com/microsoft/TypeScript/issues/6974
Reloadhttps://github.com/microsoft/TypeScript/issues/6974
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/6974
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/6974
Proposal: Modularize Libraryhttps://github.com/microsoft/TypeScript/issues/6974#top
https://github.com/yuit
@typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22%40types%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.0https://github.com/microsoft/TypeScript/milestone/1
https://github.com/yuit
Yui (yuit)https://github.com/yuit
on Feb 9, 2016https://github.com/microsoft/TypeScript/issues/6974#issue-132320081
#4692https://github.com/Microsoft/TypeScript/issues/4692
#4168https://github.com/Microsoft/TypeScript/issues/4168
Troy Gerwien (@yortus)https://github.com/yortus
#4692https://github.com/Microsoft/TypeScript/issues/4692
#4692https://github.com/Microsoft/TypeScript/issues/4692
#4168https://github.com/Microsoft/TypeScript/issues/4168
#3215https://github.com/Microsoft/TypeScript/issues/3215
#3005https://github.com/Microsoft/TypeScript/issues/3005
Library modularization #6990https://github.com/microsoft/TypeScript/pull/6990
Proposal: Modularize Library #6974https://github.com/microsoft/TypeScript/issues/6974
Proposal: Modularize Library #6974https://github.com/microsoft/TypeScript/issues/6974
Yui (yuit)https://github.com/yuit
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
on Feb 9, 2016https://github.com/microsoft/TypeScript/issues/6974#event-543834721
Yui (yuit)https://github.com/yuit
on Feb 9, 2016https://github.com/microsoft/TypeScript/issues/6974#event-543834725
Yui (yuit)https://github.com/yuit
TypeScript 2.0https://github.com/microsoft/TypeScript/milestone/1
on Feb 9, 2016https://github.com/microsoft/TypeScript/issues/6974#event-543834727
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 9, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-181701611
Yui (@yuit)https://github.com/yuit
Generic iterableshttps://kangax.github.io/compat-table/es6/#test-Promise_Promise.all,_generic_iterables
Well-known symbolshttps://kangax.github.io/compat-table/es6/#test-well-known_symbols
es6.d.tshttps://github.com/yortus/TypeScript/blob/granular-targeting/src/lib/es6.d.ts
https://github.com/yuit
Yui (yuit)https://github.com/yuit
on Feb 9, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-182125851
Troy Gerwien (@yortus)https://github.com/yortus
herehttps://github.com/Microsoft/TypeScript/issues/4692#issuecomment-138759857
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 10, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-182148623
Yui (@yuit)https://github.com/yuit
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
@typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22%40types%22
on Feb 24, 2016https://github.com/microsoft/TypeScript/issues/6974#event-562998665
https://github.com/alexeagle
Alex Eagle (alexeagle)https://github.com/alexeagle
on Mar 6, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-192982762
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
#5504https://github.com/microsoft/TypeScript/issues/5504
https://github.com/yuit
Yui (yuit)https://github.com/yuit
on Mar 9, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-194527558
Alex Eagle (@alexeagle)https://github.com/alexeagle
#5504https://github.com/microsoft/TypeScript/issues/5504
https://github.com/alexeagle
Alex Eagle (alexeagle)https://github.com/alexeagle
on Mar 9, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-194528408
#5504https://github.com/microsoft/TypeScript/issues/5504
https://github.com/yuit
Yui (yuit)https://github.com/yuit
on Mar 9, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-194530087
Alex Eagle (@alexeagle)https://github.com/alexeagle
#5504https://github.com/microsoft/TypeScript/issues/5504
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Apr 4, 2016https://github.com/microsoft/TypeScript/issues/6974#event-614236616
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Apr 4, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-205490581
#7715https://github.com/microsoft/TypeScript/pull/7715
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 4, 2016https://github.com/microsoft/TypeScript/issues/6974#event-614236878
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Apr 24, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-213936784
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Apr 24, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-213946527
almhttp://alm.tools/
https://cloud.githubusercontent.com/assets/874898/14767318/cbdd941a-0a65-11e6-8d0d-80cab7abd042.gif
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Apr 24, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-213947648
#8245 (comment)https://github.com/microsoft/TypeScript/issues/8245#issuecomment-213945296
https://github.com/basarat
Basarat Ali Syed (basarat)https://github.com/basarat
on Apr 25, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-214091481
TypeStrong/atom-typescript#918 (comment)https://github.com/TypeStrong/atom-typescript/issues/918#issuecomment-214076354
https://github.com/yuit
Yui (yuit)https://github.com/yuit
on Jun 23, 2016https://github.com/microsoft/TypeScript/issues/6974#issuecomment-228131685
Types (@types)https://github.com/types
Types (@types)https://github.com/types
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/6974#event-1689637932
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/6974
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/6974
Yui (yuit)https://github.com/yuit
@typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22%40types%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.0https://github.com/microsoft/TypeScript/milestone/1
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.