- Typescript Daily
- Posts
- Summary: Unveiling Bloomberg's TypeScript Transformation
Summary: Unveiling Bloomberg's TypeScript Transformation
Explore Bloomberg Engineering's voyage into TypeScript adoption at scale. Delve into the insights and lessons from this monumental shift within their vast JavaScript ecosystem.
Discover how Bloomberg Engineering navigated the adoption of TypeScript at scale. In a world deeply rooted in JavaScript with millions of lines of code, the move to TypeScript brought about pivotal changes. Explore the key insights and lessons learned as Bloomberg Engineering seamlessly integrated TypeScript into its vast and complex tech landscape. The following is the summary of the full case study article published by Bloomberg Engineering.
Background: Bloomberg transitioned from Fortran/C/C++ to server-side JS and later to client-side JS. They had 50M+ lines of JS code in more than 10,000 apps.
Adoption: TypeScript adoption was self-driven by engineers, with 200+ projects opting in initially and zero reverting.
Unique Integration: Bloomberg's JS runtime environment supported TypeScript directly, providing a seamless developer experience.
Key Principles:
Scalability: Minimize time spent on development tasks as more projects adopt TypeScript.
Ecosystem Coherence: Ensure pain-free compatibility and upgrades across dependencies.
Standards Alignment: Stick to ECMAScript standards while being ready for future changes.
Ten Learning Points:
TypeScript as Enhanced JavaScript: TypeScript adds type syntax and checking on top of JavaScript, ensuring easy debugging and compatibility with future ECMAScript features.
Keeping Pace with TypeScript Versions: Regularly updating TypeScript versions improves type checking but requires attention to inter-project compatibility.
Consistent tsconfig Settings: Ensuring uniform settings across projects streamlines TypeScript adaptation.
Dependency Location Specification: Explicitly declaring dependency locations is crucial for systems diverging from Node's file-system convention.
Type Deduplication: Maintaining single-version types enhances runtime and compile-time efficiency and aligns types with runtime reality.
Avoiding Implicit Type Dependencies: Preventing global types and enforcing explicit dependencies helps avoid hidden coupling between distant packages.
Understanding Declaration File Export Modes: Recognizing the different modes aids in managing and converting declaration files effectively.
Encapsulation of Packages: Explicitly defining public vs. private modules helps preserve compatibility and avoid fragile imports.
Type Inlining Across Package Boundaries: Managing type inlining between packages is critical to prevent coupling and compatibility issues.
Optimizing Published Type Declarations: Eliminating irrelevant or private types from published declarations enhances encapsulation and reduces parsing overhead.
Great Parts of TypeScript: Incremental builds, isolatedModules, Project References, type-only imports, and other features immensely supported Bloomberg's TypeScript integration.
Conclusion: TypeScript became a fundamental language for Bloomberg's platform. Learning curves were manageable, and community support was robust.
The Bloomberg case study showcases the successful adoption of TypeScript at scale, highlighting challenges, best practices, and the overall positive impact on their development ecosystem.
Reply