Status: Proposed Priority: Medium Created: 2026-08-18 Blocked on: Developer decision — memory Q3
DraftlyPlugin declares:
/** Plugin dependencies - names of required plugins */
readonly dependencies: string[] = [];Nothing reads it. There is no topological sort in draftly(), no validation that a
declared dependency is present, and no plugin currently populates it. It is an API
promise the library does not keep.
Ordering today is controlled entirely by decorationPriority (ascending) for decorations,
and by array order for keymaps and extensions. That works, but it encodes dependencies
implicitly as magic numbers — HTMLPlugin uses priority 30 specifically so it runs after
everything else, and nothing states that requirement anywhere the compiler can see it.
Leaving a declared-but-inert field is the worst of both worlds: a plugin author who populates it in good faith gets silent no-op behaviour.
Two coherent options; the developer picks.
- Validate at composition time in
draftly(): for each plugin, assert every name independenciesexists in the plugin array; throw (or warn) with a clear message naming both plugins. - Topologically sort the plugin list by
dependenciesbefore processing, so extension and keymap registration order respects declared relationships. - Decide how it interacts with
decorationPriority— the cleanest answer is thatdependenciesorders registration whiledecorationPriorityorders decoration, and they stay independent. Document that distinction explicitly. - Populate it where a real relationship exists (e.g.
HTMLPluginon the plugins whose output it must observe) and consider deriving priority bands from it later.
Delete the field and its JSDoc, and document in plugin-system.md that ordering is
decorationPriority plus array order, deliberately. Smaller, honest, and loses nothing
that is currently used.
Recommendation: Option B unless a concrete ordering bug exists. The priority-band system is working; adding a second ordering mechanism for a hypothetical need is complexity without a driver. Option A becomes right the moment a plugin genuinely cannot function without another.
editor/plugin.ts— the fieldeditor/draftly.ts— validation/sort, if Option Aartifacts/architecture/plugin-system.md— the metadata section either wayREADME.md— ifdependenciesappears in public plugin docs
-
dependencieseither does what it says or no longer exists -
plugin-system.mdstates the actual ordering rules with no "declared but inert" note - Memory Q3 closed
- Whichever option wins, the reason belongs in
memory.md— a future agent will otherwise re-propose the discarded one.