microsoft / microsoft/TypeScript
Bloomberg feedback for 6.0
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 132
Description
### Acknowledgement
- [x] I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
### Comment
We evaluated the 6.0 RC releases and 6.0 is a moderate impact release for us.
| # | Change | Affects | Release notes | Packages affected | Reported as |
| - | -------------------------------------------------------------------------- | ---------------- | ------------- | ----------------- |-------------|
| 1 | Deprecation of `node` module resolution | Module Resolution| Yes | <1% | |
| 2 | Key mapping in mapped clause cause contextual types to fail | Type Checking | No | <1% | #63225 |
| 3 | Inference produces different result | Type Checking | No | <1% | #63227 |
| 4 | JS emit removes comments | Emit | No | <1% | |
| 5 | API changes hasDefaultLib removed | Type Checking | Yes | 100% | |
## Deprecation of `node` module resolution
All our projects used the `node` moduleResolution. With the release of 6.0 this was deprecated. The resolution closest to our internal module loader behavior is `bundler`.
Most of the projects did not have issue migrating, although some did due to two main causes:
1. Some import types in declarations switched to using `import('.')` instead of `import('.\index')` which we do not support
2. Some projects used declaration files for `json` files that used the extension `json.d.ts` which worked fine in node but not with bundler (and using `--allowArbitraryExtensions` requires the extension to be `d.json.ts` which we currently do not support)
However these impacted a very small number of packages.
## JS emit removes comments
Some comments above JSX elements are removed where before they were preserved. These seem like an improvement:
```ts
function Component() {
return (
// Comment is removed in 6.0
)
}
```
[Playground Link 6.0](https://www.typescriptlang.org/play/?ts=6.0.0-dev.20260311#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wFgAoTAVwDsNgIa4APACgEo4BvCuPuIjCpQmrXvwkB6SXADCuEEhrxgAZwFIQEAG5IAJnGBMAbADoADOIl8APHuDaAfDcn2nVuOwoBfIA)
[Playground Link 5.0](https://www.typescriptlang.org/play/?ts=6.0.0-dev.20260311#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wFgAoTAVwDsNgIa4APACgEo4BvCuPuIjCpQmrXvwkB6SXADCuEEhrxgAZwFIQEAG5IAJnGBMAbADoADOIl8APHuDaAfDcn2nVuOwoBfIA)
## API changes hasDefaultLib removed
We had a custom implementation of skipLibChecks that only checked declarations authored in the project (usually hand authored) but not those that come from a trusted central source. This relies on setting the `hasDefaultLib` flag on the declaration source files from the trusted source and using `skipDefaultLibChecks`. This approach unfortunately no longer works with 6.0 resulting in slower build times for us.
One workaround if overriding `isSourceFileDefaultLibrary` on the `program` instance. This seems to work well in 6.0. It would be useful to have a better way to exclude files from type checking in 7.0 where we will not be able to do such monkey patching. Even with the perf improvements in 7.0 it seems wasteful to check files we know are valid.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par les exemples Playground liés et les problèmes signalés #63225 et #63227, puis étudiez les domaines de la résolution des modules, de la génération de JavaScript et de la Program API mentionnés dans le rapport. Il n’existe pas de critère d’achèvement unique : les effets de la migration, la suppression des commentaires, les changements d’inférence et les problèmes liés à la vérification de la bibliothèque par défaut nécessiteraient chacun une reproduction et des décisions distinctes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, typescript
- Domaine
- compilers
- Type d'issue
- Bug
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100