René's URL Explorer Experiment


Title: "Build mode" for TypeScript · Issue #22997 · microsoft/TypeScript · GitHub

Open Graph Title: "Build mode" for TypeScript · Issue #22997 · microsoft/TypeScript

X Title: "Build mode" for TypeScript · Issue #22997 · microsoft/TypeScript

Description: This is a follow-up to #3469. Most of this work is already done at https://github.com/RyanCavanaugh/tsbuild and just needs to be ported into the TypeScript code base. "Build Mode" for TypeScript TypeScript currently (soon...) supports pr...

Open Graph Description: This is a follow-up to #3469. Most of this work is already done at https://github.com/RyanCavanaugh/tsbuild and just needs to be ported into the TypeScript code base. "Build Mode" for TypeScript Ty...

X Description: This is a follow-up to #3469. Most of this work is already done at https://github.com/RyanCavanaugh/tsbuild and just needs to be ported into the TypeScript code base. "Build Mode" for Typ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Build mode\" for TypeScript","articleBody":"This is a follow-up to #3469. Most of this work is already done at https://github.com/RyanCavanaugh/tsbuild and just needs to be ported into the TypeScript code base.\r\n\r\n## \"Build Mode\" for TypeScript\r\n\r\nTypeScript currently (soon...) supports *project references*. However, if an upstream project is unbuilt, the developer will see an error telling them to build that project first.\r\n\r\nThere is a clear need for a build-scheduling mode for TypeScript that intelligently builds upstream projects.\r\n\r\nIn *build mode* (`tsc -b`), `tsc` will determine which other builds need to happen, order them correctly, and perform that build.\r\n\r\nOne way to think of it:\r\n```\r\n\"tsc -p\" : \"tsc -b\" :: \"csc\" : \"msbuild\"\r\n or\r\n\"tsc -p\" : \"tsc -b\" :: \"gcc\" : \"make\" \r\n```\r\n\r\n## Terminology\r\n\r\n * Project: A **project** is a single compilation unit, i.e. result of TypeScript's internal `createProgram` call, originating from a `tsconfig` file, with a defined set of inputs and outputs\r\n * Upstream/downstream: A project *depends* on **upstream** projects; projects *which depend on it* are **downstream**\r\n\r\n## Commandline Options\r\n\r\nThe following options are supported under `-b`:\r\n\r\n * `--clean`: Remove all output files from output folders and exit\r\n * `--force`: Force all projects to be rebuilt, even if they appear to be up-to-date\r\n * `--dry`: Do nothing, but display which projects *would* be built\r\n   * Special case: `--dry --clean` displays which files would be deleted\r\n * `--verbose`: Include verbose logging\r\n * (What else do we need?)\r\n\r\nThe following regular `tsc` options are available when `-b` is specified.\r\nUsing any other non-`-b`-specific flag is an error.\r\n * `--help`\r\n * `--watch`\r\n\r\n## Input Specification\r\n\r\nThe `-b` switch takes any number of arguments:\r\n\r\n> `tsc -b [projectOrGlob1] [projectOrGlob2] [projectOrGlobN...]`\r\n\r\nEach argument can be:\r\n * A filename pointing to a `tsconfig.json` file (though it may have a different name, e.g. `mybuildcfg.json`)\r\n * A directory name, which is assumed to contain a `tsconfig.json` file\r\n * A glob that matches filenames\r\n\r\nWhat happens next?\r\n * If `tsc -b` is invoked with zero arguments, then\r\n   * If a `tsconfig.json` file exists in the current directory, it is the only input\r\n   * Otherwise, the current directory is recursively enumerated (excluding `node_modules`) and any `tsconfig.json` files found are added to the input\r\n * Otherwise, the input is the specified list of configs or globs\r\n\r\nAfter determining the set of inputs from the commandline, each input is opened and its references are added to the input list (if it wasn't already present). This repeats until no new inputs are found.\r\n\r\nIf any input cannot be found, an error is issued and nothing happens.\r\n\r\nInputs are then topologically sorted according to their dependencies and built in that order (upstream projects first).\r\n\r\n## Circular dependencies\r\n\r\nCircular dependencies are allowed as long as at least one dependency in the circularity-causing cycle is marked `\"circular\": true`.\r\n\r\nFor the purposes of the topological sorting of inputs, edges which would cause circularity are ignored. Note that this makes the final build order dependent on the initial ordering of inputs, which may be in turn dependent on file system enumeration order. Developers using circular dependencies should observe their build behavior carefully to ensure it's sufficiently deterministic.\r\n\r\n## Errors\r\n\r\nWhen a project has a configuration, syntactic, or semantic error, no files are emitted.\r\n\r\n**Sidebar: Why?** If an upstream project has errors but emits anyway, a downstream build will see the project as \"up to date\" and the errors will be hidden until a clean build or edit to the upstream project occurs. This is potentially fixable; we could write out the errors to disk and re-issue them on subsequent builds. It's not clear if this is desirable or not.\r\n\r\n## Why have two modes (-p and -b) ?\r\n\r\nUsers running `tsc -p` may sometimes see errors that basically amount to *\"You should run `tsc -b` instead\"*. So why not just make `-p` and `-b` the same?\r\n\r\nThe reason is to prevent an `O(n^2)` increase in build I/O for developers writing large solutions using `msbuild` or similar tools. If `msbuild` invokes `tsc -p` on each project in a deep graph, then the files of the every project will get checked once for *each* downstream project.\r\n\r\nFor example, in a linear graph of 3 projects with 10 files each, `tsc -p` on each project (in the correct order) will do 10 + 10 + 10 file checks, whereas `tsc -b` would check 10 + 20 + 30 files.\r\n\r\n## Faster Rebuilds\r\n\r\nDuring a build, `tsc -b` will detect if it's writing an output that is (bytewise) identical to an existing disk artifact. This is an *unchanged output*.\r\n\r\nWhen a downstream project would need to be rebuilt, but only depends on older or unchanged outputs, then it can be *fast rebuilt*.\r\n\r\nA fast rebuild of a module compilation simply increments the timestamps of all the output files to the current time.\r\n\r\nA fast rebuild of an `outFile` compilation with upstream-changed `prepend`s needs to break apart the `.js` file on disk, use the `bundleinfo` file to identify the correct offset, and re-output the JS file.\r\n\r\n > TODO: Consider cutting this feature? If all endpoints have small additions, this isn't a big perf hit\r\n\r\n-----\r\n\r\nMore to come...\r\n","author":{"url":"https://github.com/RyanCavanaugh","@type":"Person","name":"RyanCavanaugh"},"datePublished":"2018-03-29T19:39:11Z","url":"https://github.com/microsoft/TypeScript/issues/22997"}

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:5cff807a-4c7a-30d5-328e-fffa19ba6e4a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id892E:1FE434:43D906:599F99:6B01975F
html-safe-noncec27da3f57b392bb9ba51a6ab10fc4ee6c7a0c0462df30fcf050e24af7e536c90
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTJFOjFGRTQzNDo0M0Q5MDY6NTk5Rjk5OjZCMDE5NzVGIiwidmlzaXRvcl9pZCI6IjkxMzA0NTQ0NjcwNjAyNzUwMzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacef2953bf0630afb87a7c244a3a996f4860566d106265ed3d75c4e2183686dbe4
hovercard-subject-tagissue:309878813
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/22997/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d135f22eae74a5fea47ac9095e7c6b28fc9db40562978ab0d14bed8238dc2ec7/microsoft/TypeScript/issues/22997
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d135f22eae74a5fea47ac9095e7c6b28fc9db40562978ab0d14bed8238dc2ec7/microsoft/TypeScript/issues/22997
og:image:altThis is a follow-up to #3469. Most of this work is already done at https://github.com/RyanCavanaugh/tsbuild and just needs to be ported into the TypeScript code base. "Build Mode" for TypeScript Ty...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRyanCavanaugh
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/22997#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F22997
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%2F22997
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/22997
Reloadhttps://github.com/microsoft/TypeScript/issues/22997
Reloadhttps://github.com/microsoft/TypeScript/issues/22997
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/22997
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/22997
"Build mode" for TypeScripthttps://github.com/microsoft/TypeScript/issues/22997#top
https://github.com/RyanCavanaugh
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
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Mar 29, 2018https://github.com/microsoft/TypeScript/issues/22997#issue-309878813
#3469https://github.com/microsoft/TypeScript/issues/3469
https://github.com/RyanCavanaugh/tsbuildhttps://github.com/RyanCavanaugh/tsbuild
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
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 Mar 29, 2018https://github.com/microsoft/TypeScript/issues/22997#event-1548648560
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Mar 29, 2018https://github.com/microsoft/TypeScript/issues/22997#event-1548648569
https://github.com/krryan
Kevin Ryan (krryan)https://github.com/krryan
on Mar 29, 2018https://github.com/microsoft/TypeScript/issues/22997#issuecomment-377352917
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Mar 29, 2018https://github.com/microsoft/TypeScript/issues/22997#issuecomment-377355045
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 21, 2018https://github.com/microsoft/TypeScript/issues/22997#issuecomment-390723640
Chris Eppstein (@chriseppstein)https://github.com/chriseppstein
https://github.com/linkedin/opticss/blob/ts2.9_use_project_references/project_references_feedback.mdhttps://github.com/linkedin/opticss/blob/ts2.9_use_project_references/project_references_feedback.md
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on May 21, 2018https://github.com/microsoft/TypeScript/issues/22997#issuecomment-390797871
https://github.com/mihailik
mihailikhttps://github.com/mihailik
on Jun 28, 2018https://github.com/microsoft/TypeScript/issues/22997#issuecomment-400987634
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 16, 2018https://github.com/microsoft/TypeScript/issues/22997#event-1971981756
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/22997
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/22997
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
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
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.