Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Sheriff: Modularity in TypeScript Applications

Sheriff: Modularity in TypeScript Applications

Modularity is a crucial aspect of any architecture. The same applies to frontend applications.

Keeping track of dependencies and maintaining a clear overview of classes and functions can be overwhelming. Fortunately, there are tools that can help automate this process.

In my talk, I'll demonstrate common tools, like nx or dependency cruiser. The main focus, though, will be a new tool which is called Sheriff.

Furthermore, I will present a reference architecture based on Domain-Driven Design (DDD), which is widely adopted in frameworks like Angular. This architecture, combined with the accompanying Sheriff configuration, provides a practical and effective approach to structuring frontend applications.

Rainer Hahnekamp

October 16, 2023
Tweet

More Decks by Rainer Hahnekamp

Other Decks in Technology

Transcript

  1. Agenda • Frontend Architecture • Sheriff in Theory • Modularity

    in JavaScript/TypeScript • Sheriff in Practice • Q&A
  2. Shared Forms Grid Error Handling Widgets Backend Middleware ... App

    Shell Domain (Holidays ) Domain (Customers) Domain (Bookings) Domain (Diary) Layer 1 - Domain modules
  3. Modularity in JavaScript • Native with ESM • Third-Party Libraries

    ◦ Nx ◦ dependency-cruiser ◦ madge ◦ good-fences ◦ eslint-plugin-boundaries
  4. Sheriff: Modularity in TypeScript • Module Encapsulation • Dependency Rules

    • Lightweight • Convention over Configuration
  5. Sheriff: Modularity in TypeScript • Module Encapsulation • Dependency Rules

    • Lightweight • Convention over Configuration • Zero Dependencies
  6. Sheriff: Modularity in TypeScript • Module Encapsulation • Dependency Rules

    • Lightweight • Convention over Configuration • Zero Dependencies • For all TypeScript Projects
  7. Sheriff: Modularity in TypeScript • Module Encapsulation • Dependency Rules

    • Lightweight • Convention over Configuration • Zero Dependencies • For all TypeScript Projects • (Heavily) Influenced by Nx