Extension points
Modules never import each other. To collaborate, they go through the core registries.
Why #
Hard-coding a reference from one module to another (e.g. office → code) would break independence: you cannot assume a module is installed.
The two options #
- Vendor the needed file into your module.
- Go through an extension point:
ExtensionRegistry/ModuleServiceRegistryon the frontend.
Example: a cross-module contract #
// Le module calendar publie un service…
ModuleServiceRegistry.publish('calendar', {
openDate: (arg) => { /* ouvre l'agenda sur une date */ }
})
// …qu'un autre module (ex. assistant) consomme s'il est présent
ModuleServiceRegistry.get('calendar')?.openDate('2026-06-25')Note
Dynamic discovery only (DB or registry) and optional calls (?.). Never assume a module is present.
Shared singletons #
React, Radix DropdownMenu, the stores… must stay external and never be re-bundled, or duplicates will break the UI.