Bloomberg Engineering Share Experiences of Adopting TypeScript across a Large Codebase

Bloomberg Engineering Share Experiences of Adopting TypeScript across a Large Codebase

Rob Palmer, JavaScript infrastructure and tooling lead at Bloomberg, recently shared a few learning points and insights from the adoption of TypeScript at scale at Bloomberg. While some learning points are specific to Bloomberg’s custom runtime, others may be valuable across any large codebase switching to TypeScript.

Rob Palmer, JavaScript infrastructure and tooling lead at Bloomberg, recently shared several learning points and insights from  the adoption of TypeScript at scale at Bloomberg. While some learning points are specific to Bloomberg’s custom runtime, others may be valuable across any large codebase switching to TypeScript.

Palmer explained that Bloomberg Engineering followed a thoughtful process to migrate to TypeScript due to the scale of its existing JavaScript codebase. The Bloomberg terminal contains more than 10,000 applications. Bloomberg’s JavaScript codebase has over 50 million lines of code. 2,000 software engineers are writing JavaScript.

Bloomberg has its own JavaScript runtime environment and platform, built on the V8 engine and Chromium. Bloomberg’s custom runtime directly supports TypeScript. It strives to provide a standardized, streamlined experience to Bloomberg developers. Palmer elaborated:

Our platform supports an internal ecosystem of packages that uses a common tooling and publishing system. This allows us to encourage and enforce best practices, such as defaulting to TypeScript’s “strict mode”, as well as ensuring global invariants. For example, we guarantee that all published types are modular rather than global. It also means that engineers can focus on writing code rather than needing to figure out how to make TypeScript play nicely with a bundler or test framework. DevTools and error stacks use sourcemaps correctly. Tests can be written in TypeScript and code coverage is accurately expressed in terms of the original TypeScript code. It just works.

The migration process sought to stick to standards (such as ECMAScript), keep development productivity high even as the TypeScript codebase grows, and ensure that packages efficiently work together. Palmer shared 10 learning points that accumulated over time. Some of those may apply to any codebase migrating to TypeScript. Others relate to Bloomberg’s specific TypeScript adoption strategy.

One generally applicable learning point is to use the parts of the TypeScript specifications that do not contradict future JavaScript features and focus on adding typing information. The alignment with standard ECMAScript syntax and runtime semantics means that TypeScript language features that are not a type-level extension of JavaScript — enumnamespace, parameter properties, or  TypeScript decorators, should be avoided. The TypeScript decorator semantics are for instance incompatible with the JavaScript  class fields proposal (Stage 3, i.e. nearing adoption in the JavaScript language standard). The MobX state management library recently released a  new version that instead aligns with the  new JavaScript decorators proposal (Stage 2).

javascript typescript architecture & design development

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

Hire dedicated JavaScript Developers who are proficient in AngularJS, ReactJS, NodeJS, & VueJS frameworks. Get flexible hiring models as per your business requirements.

JS Development Company India | JavaScript Development Services

Best JavaScript web app development company in India, PixelCrayons provides full stack JS development & maintenance. 16+ Yrs Exp., 60% less cost, Strict NDA

TypeScript Tutorial For JavaScript Developers - TypeScript Basics

TypeScript Tutorial For JavaScript Developers - TypeScript Basics. I will show you guys 4 example of JavaScript code, and how to convert it to TypeScript. This is a typescript beginners tutorial.

Why Website Design and Development is Important for Business?

Ellocent stands as a highly reputed and top Web development company with impeccable services due to resource-rich advanced tools and techniques.

What, Why, and How of Typescript for JavaScript Developers

What, Why, and How of Typescript for JavaScript Developers. If you are a Javascript developer, you must have heard about Typescript at one point or another. What is Typescript, what is its type system, and how would it benefit you as a Javascript developer to use Typescript in your next project?