Sonos Lays Off 200 Employees Amid Ongoing Struggles
Sonos cuts 200 jobs, its largest layoff to date, as the company faces declining demand and a tarnished reputation following last year's app fiasco.
Reese Morgan
Microsoft has released the beta version of TypeScript 5.8, which introduces a limited form of type checking against conditional and indexed access types in return statements. This new feature aims to avoid type assertions, which can defeat legitimate checks that TypeScript would otherwise perform.
The TypeScript 5.8 beta, announced on January 29, allows developers to get started by executing the command `npm install -D typescript@beta` in NPM. With this release, when a function's return type is a generic conditional type, TypeScript will use control flow analysis for generic parameters whose types are used in the conditional type, instantiate the conditional type with the narrowed type of each parameter, and relate against that new type.
However, Microsoft notes some limitations to this feature. Special checking only occurs when a single parameter is associated with the type being checked against in a conditional type or used as a key in an indexed access type. Additionally, at least two checks must exist, with a terminal branch including `never`. The parameter's type must also be generic and be constrained by a union type. Overall, checks will not occur when a specific type is associated with a type parameter.
TypeScript 5.8 is expected to reach general availability on February 25, with a release candidate scheduled for February 11. This follows the release of TypeScript 5.7 in November, which featured improved error reporting.
In addition to the new type checking feature, TypeScript 5.8 includes several other notable features and optimizations. These include optimizations to improve the time to build a program and update a program based on a file change in either `--watch` mode or editor scenarios. TypeScript now avoids array allocations involved in normalizing paths and re-validating options provided to it when edits are made that do not fundamentally change the structure of a project.
Other features in TypeScript 5.8 include support for `require()` of ECMAScript modules in `--module nodenext`, a stable `--module node18` flag, and an `--erasableSyntaxOnly` flag. The latter flag allows users to only use constructs that can be erased from a file, issuing an error if any non-erasable constructs are encountered.
Notably, Node.js 22 no longer accepts import assertions using the `assert` syntax. When `--module nodenext` is enabled in TypeScript 5.8, the compiler will issue an error if it encounters an import assertion.
The release of TypeScript 5.8 beta marks a significant step forward for the typed superset of JavaScript, providing developers with more advanced type checking capabilities and improved performance. As the language continues to evolve, it's likely to have a significant impact on the development community, particularly in the realm of enterprise software development.
Sonos cuts 200 jobs, its largest layoff to date, as the company faces declining demand and a tarnished reputation following last year's app fiasco.
Xbox Game Studios' open-world racing game Forza Horizon 5 is coming to PS5 this spring, featuring crossplay and a new content update called Horizon Realms.
Rwandan President Paul Kagame denies knowledge of Rwandan troops operating in eastern DRC, despite UN estimates of 3,000-4,000 soldiers supporting M23 rebels, as violence escalates in the region.
Copyright © 2024 Starfolk. All rights reserved.