How Well Do You Know the Latest TypeScript Release?
Gensen Huang
Created 6/21/2024
Put your knowledge of the latest TypeScript release to the test with this quiz! Answer 20 questions and find out how much you really know.
1. What major performance improvement was introduced in TypeScript 5.5?
Rewriting syntax nodes before serializing them into a string.
Removing type queries for all union types.
Directly operating over original syntax nodes.
Eliminating type declarations in transpileModule.
2. What specific problem does caching contextual types from discriminated unions help with in TypeScript 5.5?
Predicting emitted reference directives.
Improving speed of union type filtering.
Reducing object size in JavaScript output.
Minimizing the complexity of declaration emit.
3. What functionality in TypeScript 5.5 specifically helps in auto-import completions across project references?
Requiring explicit imports
Using isolatedModules
Enhanced contextual type caching
Auto-imports works across anything listed in tsconfig.json references
4. What is a major benefit of not synthesizing reference directives for certain types in TypeScript 5.5?
Reduces the overall output file size.
Ensures backward compatibility with older TypeScript versions.
Prevents unnecessary type imports.
Reduces dependency on third-party libraries.
5. Which new Set method in ECMAScript does NOT mutate the original Sets and returns a boolean?
union
difference
isSupersetOf
symmetricDifference
6. In TypeScript 5.5, what did developers recognize as a limitation when creating declaration emit without type checking?
Union types were too expensive to handle.
Reference directives were inconsistently emitted.
Type predicates were not inferred correctly.
Syntax nodes were not serialized properly.
7. Which optimization reduces TypeScript build times by up to 2%?
Flatter control flow graphs
Faster union type filtering
Enhanced contextual type caching
Optimized syntax node operations
8. What does the new --isolatedDeclarations option in TypeScript 5.5 do?
Ensures type-checking of all module imports.
Reports errors if a module cannot be reliably transformed without a type-checker.
Checks the runtime behavior of functions.
Allows omitting all explicit type annotations.
9. How does TypeScript’s new feature control flow narrowing for constant indexed accesses benefit developers?
Enables type predicates for arrays
Reduces the need for explicit type annotations
Refines the type of a variable as it changes in code
Improves regex error checking
10. What additional method besides transpileModule introduces in TypeScript 5.5 to help developers?
transpileDeclaration
transpileLibrary
transpileTypes
transpileEmit
11. What type of API does the new transpileDeclaration method in TypeScript 5.5 create?
A JavaScript compilation API
An API for generating a declaration file
A type-checking API
A syntax node transformation API
12. What must be enabled alongside isolatedDeclarations for it to work correctly?
declaration or composite flags
type-checking or linting flags
emission or bundling flags
module resolution flags
13. What TypeScript behavior change helps when a module cannot resolve a symlink?
Watching failed lookup paths
Disabling all module imports
Automatically rerunning builds
Clearing the node_modules directory
14. Which attribute ensures backwards compatibility and adds performance improvements when emitting declarations?
preserve="true"
compatible="false"
optimize="true"
flag="emit"
15. What did TypeScript 5.5 temporarily revert due to feedback on interrupted workflows?
ECMAScript Set methods
Inference of type predicates
Reading package.json for module format
Regex syntax checking
16. What specific type refinement applies now more rigorously, pushing developers towards more robust code?
Union type intersections
Control flow narrowing
Contextual type caching
Read-only attribute inference
17. What general optimization was noted to improve performance for transpileModule and transpileDeclaration in TypeScript 5.5?
Skipping unresolved module lookups
Avoiding full type-checking passes
Caching syntax node transformations
Parallelizing type-checking tasks
18. How does the new JSDoc @import tag benefit TypeScript development?
It optimizes file-watching for non-existent files.
It reduces verbosity for multiple imports.
It simplifies regular expression usage.
It enhances type-checking for single files.
19. What is one of the main limitations of TypeScript's regular expression support?
It only checks RegExp literals and not string literals used in new RegExp calls.
It provides full semantic checks for all regex expressions.
It skips over all regular expressions.
It requires explicit type annotations for regex variables.
20. Why is the isolatedDeclarations feature significant for tool authors?
It allows parallel builds on multiple cores.
It enables direct copying of type annotations.
It simplifies type-checker implementation.
It removes the need for public API types.