mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
d8da2a4d346593814548a66813304bc5a793f070
Great idea from @yuit This restriction was in place because the old parser would mutate nodes as it created them. i.e. when creating a node it would set the parent of its children right then. During incremental parsing, this couldl be bad because we might take an old node, set its parent to be something else, and then decide we didn't even want to go down that speculative path to begin with. Now the parent of some child node would be mutated. So we might have a node that pointed to a child that then pointed to a different parent. To get around this, we restricted the incremental so that it would not reuse from the previous tree if we were speculatively parsing. However, Yui had a very good idea to just move the parent setting phase to be a postpast (similar to the new compiler). By doing this, we never mutate nodes as we parse, and thus we never end up with inconsistent nodes. The post pass then ensures that all parents are correct relative to the new tree. Conflicts: src/services/syntax/SyntaxGenerator.js src/services/syntax/SyntaxGenerator.js.map src/services/syntax/incrementalParser.ts src/services/syntax/scanner.ts src/services/syntax/syntaxGenerator.ts src/services/syntax/syntaxNodes.concrete.generated.ts
TypeScript
TypeScript is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the playground, and stay up to date via our blog and twitter account.
Contribute
There are many ways to contribute to TypeScript.
- Submit bugs and help us verify fixes as they are checked in.
- Review the source code changes.
- Engage with other TypeScript users and developers on StackOverflow.
- Join the #typescript discussion on Twitter.
- Contribute bug fixes.
- Read the language specification (docx, pdf).
Documentation
Building
In order to build the TypeScript compiler, ensure that you have Git and Node.js installed.
Clone a copy of the repo:
git clone https://github.com/Microsoft/TypeScript.git
Change to the TypeScript directory:
cd TypeScript
Install Jake tools and dev dependencies:
npm install -g jake
npm install
Use one of the following to build and test:
jake local # Build the compiler into built/local
jake clean # Delete the built compiler
jake LKG # Replace the last known good with the built one.
# Bootstrapping step to be executed when the built compiler reaches a stable state.
jake tests # Build the test infrastructure using the built compiler.
jake runtests # Run tests using the built compiler and test infrastructure.
# You can override the host or specify a test for this command.
# Use host=<hostName> or tests=<testPath>.
jake runtests-browser # Runs the tests using the built run.js file. Syntax is jake runtests. Optional
parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]'.
jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests.
jake -T # List the above commands.
Usage
node built/local/tsc.js hello.ts
Roadmap
For details on our planned features and future direction please refer to our roadmap.
Description
Releases
212
TypeScript 5.9
Latest
Languages
TypeScript
97.9%
jsonc
1.9%
JavaScript
0.2%