跪拜 Guibai
← All articles
Frontend · Vue.js

A Plugin Protocol That Stops Admin Panels from Turning into Monoliths

By 知航驿站 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Admin panels in mid-to-large orgs accumulate modules until the codebase becomes a tangled monolith. A plugin protocol with explicit boundaries, dependency checks, and runtime toggles keeps the host lean and makes adding a new business domain a stable, repeatable operation instead of a risky surgery.

Summary

Large admin panels tend to collapse under their own weight when every business domain gets stuffed into a single host. This framework pulls the host back to startup, layout, and global guards, then splits domains like shops, settings, and reports into separate `plugin-*` packages. Each plugin declares its identity, version, dependencies, routes, menus, and language packs through a single TypeScript interface, so the host never needs to know internal details. The system also enforces ordering, dependency validation, and conflict detection at registration time, catching duplicate IDs or route paths before they cause runtime chaos. A runtime manifest and start/stop controls with localStorage persistence let operators toggle plugins on or off and survive page refreshes without losing state.

Takeaways
Each plugin is a self-contained package that declares its routes, menus, language packs, and an install hook through a single TypeScript interface.
The host application is reduced to startup, layout, and global guards; it no longer owns any business logic.
Plugin registration respects an `order` field and validates `dependsOn` declarations, blocking a plugin from loading if its prerequisites are missing.
Conflict detection prevents duplicate plugin IDs, route paths, route names, and menu paths at registration time.
Runtime start/stop controls persist to localStorage, so toggling a plugin off survives a page refresh.
A runtime manifest exposes all registered plugins, giving the host visibility into what is currently active.
Conclusions

The core idea is boundary enforcement, not just modularity. The protocol forces a plugin to ship everything the host needs in one declaration, which prevents the common failure mode where a 'module' still reaches into the host to patch global state.

Persisting plugin enable/disable state to localStorage is a pragmatic choice for admin tools where operators may need to hide entire domains without a deploy, but it also introduces a state synchronization problem if multiple tabs or users share the same browser profile.

The dependency and conflict detection logic shifts failure from runtime to registration time. Catching a duplicate route path when the plugin loads is far cheaper than debugging a broken navigation tree after deployment.

Concepts & terms
Plugin Protocol
A TypeScript interface that defines the contract a plugin must fulfill: identity fields, routes, menus, language packs, dependencies, and an initialization hook. The host reads this contract to integrate the plugin without knowing its internals.
Host Application
In this architecture, the shell application that owns only startup, layout, and global route guards. All business features live in plugins, so the host stays thin and stable.
Runtime Manifest
A live registry of all loaded plugins that the host can query. It enables features like an admin panel that shows which business modules are currently active.
From the discussion

The conversation revolves around the project's availability and its practical trade-offs. Interest in studying the code is met with a claim that it is open-source, which is immediately contradicted by a specific observation that the core repository remains closed. A separate line of criticism argues the plugin protocol adds unnecessary complexity and hampers extensibility.

The core repository (pm-web-admin-next) is not publicly available, despite a claim that the project is open-source.
Packaging the plugins as npm packages is a viable approach.
The plugin protocol risks overcomplicating simple work and is difficult to extend.
Featured comments
用户545784512369

I'd like to ask, will this project be open-sourced? I've been free lately and happened to come across your blog, and I'd like to learn from it [rose][rose][rose]

知航驿站

It's already open-sourced, wow

用户545784512369  → 知航驿站

The pm-web-admin-next repository isn't open-sourced

围的围

It's not easy to extend, and it tends to overcomplicate simple tasks.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗