Title: Bloomberg feedback for 5.4 Beta · Issue #57464 · microsoft/TypeScript · GitHub
Open Graph Title: Bloomberg feedback for 5.4 Beta · Issue #57464 · microsoft/TypeScript
X Title: Bloomberg feedback for 5.4 Beta · Issue #57464 · microsoft/TypeScript
Description: Acknowledgement I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion. Comment by Ashley Claymore (@acutmore), Michael Molisani (@molisani), Titian Cernicova-Dragomir (@dra...
Open Graph Description: Acknowledgement I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion. Comment by Ashley Claymore (@acutmore), Michael Molisani (@mo...
X Description: Acknowledgement I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion. Comment by Ashley Claymore (@acutmore), Michael Molisani ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/57464
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bloomberg feedback for 5.4 Beta","articleBody":"### Acknowledgement\n\n- [X] I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.\n\n### Comment\n\nby @acutmore, @molisani, @dragomirtitian \r\n\r\nWe have completed our evaluation of the impact of upgrading to TypeScript 5.4 on our codebase. Here are our findings.\r\n\r\nThis is shaping up to be a medium impact release. The following table lists changes that affected our codebase, and where appropriate a link to a separate Issue:\r\n\r\n🟢 = positive breaking change\r\n🔴 = negative breaking change\r\n🐛 = compiler bug\r\n\r\n\r\n\r\n| Change | Affects | Release notes | Packages affected | Reported as |\r\n| ---------------------------------------------------------------------- | ------------- | ------------- | --------------------------- | ----------- |\r\n| [More Accurate Conditional Type Constraints (with optional property)](#user-content-bb-item-1) 🟢 | Type Checking | Yes | ~95% (transitive)(3 direct) | |\r\n| Preserved Narrowing in Closures Following Last Assignments 🟢 | Type Checking | Yes | 2 | |\r\n| Errors When Type-Only Imports Conflict with Local Values 🟢 | Type Checking | Yes | 2 | |\r\n| `...any[]` becoming `...unknown[]` 🐛 | Type Checking | | 2 | #57389 |\r\n| New circular type alias error 🐛 | Type Checking | | 1 | #57357 |\r\n| `instanceof` type narrowing change due to `.prototype` inference 🟢 | Type Checking | | 1 | #57397 |\r\n| [Interface merging no longer masking wider return type](#user-content-bb-item-2) 🟢 | Type Checking | | 1 | n/a |\r\n| [Inline type import not utilizing existing import](#user-content-bb-item-3) 🔴 | .d.ts emit | | 8 | #57415 |\r\n\r\n\u003ch2 id=\"bb-item-1\">More Accurate Conditional Type Constraints (with optional property)\u003c/h2>\r\n\r\nComes from: #56004\r\n\r\n[Playground](https://www.typescriptlang.org/play?ts=5.4.0-dev.20231121#code/FAFwngDgpgBAwgewHYDMCWBzA8igPAFQEYA+GAXhiJigA8QokATAZxgG9gYuYBjZdDAC4YaVFABOlAEwwA9ACpqdBi3YBfGPNkBuYBoD80mMLZrdoSLACyAQwiJUmAkvpNWAJSh9xjXMxDiohgANDAIAEYAVl4gxKQU+Oa0EAjiIDDg0PD8mOQwnt6+-oFIITA2SGDEusmp6ZmwAAriCNE86RRsvDkY+sIOAjBmwMC1aRmWMADiUCAAyrMArhC4jS4qrM2tMfHsnNx8jkIwtvY9uAOYOKtx2nKyMLgAtDBIUADu1OItkqIwAKwAOgALICAAxPRhQABugKkYKkAGZCIQpIQ9MAgA)\r\n\r\nThis impacted most of our packages because it caused a new error in core packages that almost everything else depends on, and we don't `skipLibChecks`.\r\n\r\nLooking at the error it is correctly identifying that the type may not be valid when instantiated, so is a good error. We have since improved these types to have a more accurate constraint.\r\n\r\nSide-note: This particular pattern only errors when `exactOptionalPropertyTypes` is disabled (we keep this as the default).\r\n\r\n\u003ch2 id=\"bb-item-2\">Interface merging no longer masking wider return type\u003c/h2>\r\n\r\nBisects to: #55447\r\n\r\nThis bug fix impacted one package. This error _does_ also appear in TS 5.3 if the order of a union is changed - so 5.4 is now more reliably catching this regardless of union order.\r\n\r\n[Playground](https://www.typescriptlang.org/play?target=99&ts=5.4.0-beta#code/CYUwxgNghgTiAEkoGdnwMoE8B2YCSAtgA4QA8AKgHzwDeAUPI9iAB4AuAFAJQBc8ebEDChsA9jABKIZAFcIbCpQDcdAL506AS2yCYAMyhgEAQWQ58xMlVoMmrTgDcoEGSAD8fKNky94ABRhRAk1kEFIBIRFxKVl5RWU1DVAkOERoVHhTc0ISRRtGeGZ2bj4AoJCwr0wE9TokDIB1YSIiITz6AuToVM1LPixcHKtqAB9Ms0HLRSV4AHpZ+FIAWnhkAHcoIng2AAsEGWxNUWx4cVAYeC9gbb34IUCLzdbYNG14AFYAOgBmW0L7bj5AqMOBsGQwE67EKfXokT5FThcFQFdS1FDmeB6A5gNhHE4IxQcNZ8JpPNpULhA+AQEBseAwPgRYRiSTSOQKaxjbByCDwAC8hR5yMYfzWO00NPgHAAhBwLgKoBtNHS1vCAVwuJ9gMcQJSOsD6Z8nC4EPNFksVsw1ncYA94G8vgAWT4ABiWACNaVA-qi6EA)\r\n\r\n\u003ch2 id=\"bb-item-3\">Inline type import not utilizing existing import\u003c/h2>\r\n\r\nBisects to: #56857\r\n\r\nThis negatively impacted 8 packages. In some cases TypeScript is no longer utilizing existing `import` statements for declaration emit, and instead adding new inline type imports. This triggers an error in our build pipeline where we assert that `.d.ts` imports only resolve to a package's public entrypoints.\r\n","author":{"url":"https://github.com/acutmore","@type":"Person","name":"acutmore"},"datePublished":"2024-02-21T16:21:55Z","url":"https://github.com/microsoft/TypeScript/issues/57464"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2432573a-5d04-8308-7cd1-1434304b38d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8920:181E33:96B9EA:CAB961:6B04D9DC |
| html-safe-nonce | 428f65553787ff7565a1711158f98356d09f16171d60cb79a187d30b22e1b5e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTIwOjE4MUUzMzo5NkI5RUE6Q0FCOTYxOjZCMDREOURDIiwidmlzaXRvcl9pZCI6Ijc4NDIyOTUxMzU3NTA2MTk4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 904acda8a714f331437faa73673f079d64eddb75ef5cbbcaa50d1af6083849b7 |
| hovercard-subject-tag | issue:2147175029 |
| 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/57464/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a32c381d0cc78329461b0d3f6ae1fb9a3841ec3ccf8f02c407da09e9d6b982d7/microsoft/TypeScript/issues/57464 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a32c381d0cc78329461b0d3f6ae1fb9a3841ec3ccf8f02c407da09e9d6b982d7/microsoft/TypeScript/issues/57464 |
| og:image:alt | Acknowledgement I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion. Comment by Ashley Claymore (@acutmore), Michael Molisani (@mo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | acutmore |
| hostname | github.com |
| expected-hostname | github.com |
| None | 194dacb8acfd3e4d3ffb2704e0b1f10327f0dad690a7142acc7b0e0a2d073965 |
| 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 | 6c35540a0a2991ee20bd053ba2601cce33f72cb1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width