# Subdivision - a tiny library for building highly decoupled and modular web apps

- Speaker: [Boris Kozorovitzky](/wiki/speakers/boris-kozorovitzky.md)
- Event: [Reversim Summit 2016](/wiki/years/2016.md)
- Video: https://www.youtube.com/watch?v=fZy1tO3SGW4
- Transcript: [/transcripts/2016/11-fZy1tO3SGW4.md](/transcripts/2016/11-fZy1tO3SGW4.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Software Engineering](/wiki/topics/software-engineering.md), [Architecture](/wiki/topics/architecture.md), [Frontend](/wiki/topics/frontend.md), [JavaScript](/wiki/topics/javascript.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker introduces Subdivision, a small open-source JavaScript library designed to help structure and decouple complex web applications. The talk highlights architectural challenges in growing front-end apps, such as managing menus, module dependencies, and applying solid principles. The speaker demonstrates how the library uses add-in trees, registries, and topological sorting to organize code cleanly. Ultimately, audience members learn an alternative approach to modularizing client and server JavaScript applications.

## Key points

- [0:10](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=10s) The speaker introduces Subdivision, a tiny JavaScript library for Node.js and browsers designed to help organize application code.
- [1:12](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=72s) Complex web applications often face architectural challenges when menus and UI components need to know about all system modules.
- [2:18](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=138s) Applying Robert Martin's Solid principles helps create extensible and maintainable software architecture.
- [3:19](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=199s) The Open-Closed Principle states that entities should be open for extension but closed for modification.
- [4:24](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=264s) Using a generic registry helps decouple modules from UI elements like menus, but managing order and feature flags still requires better patterns.
- [5:25](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=325s) Subdivision is inspired by the add-in tree concept found in platforms like SharpDevelop and brings an opinionated structure to JavaScript.
- [6:30](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=390s) The library is built around registries, topological sorting for ordering, builders for transformations, and manifests.
- [7:30](https://www.youtube.com/watch?v=fZy1tO3SGW4&t=450s) The project includes additional utilities like services and commands, high unit test coverage, and complete documentation.

## Takeaways

- Apply the Open-Closed Principle to prevent modifying core components every time a new feature is added.
- Use a registry pattern to decouple UI components from the underlying application modules.
- Consider add-in tree architectures and topological sorting when managing ordered extensions in complex web apps.

## Questions this talk answers

- How can I decouple navigation menus from feature modules in a large front-end application?
- What is an add-in tree pattern and how can it be applied to JavaScript web apps?
- How does topological sorting help manage module ordering and extensions dynamically?

## Technologies

JavaScript, Node.js, React, Angular

## Tags

architecture, front-end, javascript, modularity, open source, solid principles
