ts.SourceFile
versioning (#41475)
Generally, the compiler assumes that `ts.SourceFile`s are immutable objects. If a new `ts.Program` is compared to an old one, and a `ts.SourceFile` within that program has not changed its object identity, the compiler will assume that its prior analysis and understanding of that source file is still valid. However, not all TypeScript workflows uphold this assumption. For `ts.Program`s that originate from the `ts.LanguageService`, some source files may be re-parsed or otherwise undergo mutations without changing their object identity. This breaks the compiler's incremental workflow. Within such environments, it's necessary to track source file changes differently. In addition to object identity, it's necessary to compare a "version" string associated with each source file, between when that file is analyzed originally and when a new program is presented that still contains it. It's possible for the object identity of the source file to be the same, but the version string to have changed, indicating that the source file should be treated as changed. This commit adds an optional method `getSourceFileVersion` to the `ProgramDriver`, to provide access to version information if available. When this method is present, the compiler will build a map of source file version strings, and use this map to augment identity comparison during incremental compilation. PR Close #41475
Angular - One framework. Mobile & desktop.
Angular is a development platform for building mobile and desktop web applications
using Typescript/JavaScript and other languages.
Contributing Guidelines
·
Submit an Issue
·
Blog
Documentation
Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.
Advanced
Development Setup
Prerequisites
- Install Node.js which includes Node Package Manager
Setting Up a Project
Install the Angular CLI globally:
npm install -g @angular/cli
Create workspace:
ng new [PROJECT NAME]
Run the application:
cd [PROJECT NAME]
ng serve
Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.
Quickstart
Ecosystem
Changelog
Learn about the latest improvements.
Upgrading
Check out our upgrade guide to find out the best way to upgrade your project.
Contributing
Contributing Guidelines
Read through our contributing guidelines to learn about our submission process, coding rules and more.
Want to Help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.
Community
Join the conversation and help the community.
Love Angular? Give our repo a star ⭐ ⬆️.