I’d like to use Web Components for this. Polymer looked like a good starting point. But I got stuck early with two problems:
- The Polymer code expects me to deploy dozens of static files on the HTTP server. That feels like a bad solution. I can wire my components using RPC and PubSub but when it comes to deliver CSS, I have to become root, copy files around, … I need a solution where an application component can talk to the static HTTP server and register additional resources.
So I need a HTTP server which I can configure via RPC to publish additional resources.
To sum it up, I want to create a plugin system for web applications where each plugin does a specific job without imposing itself on any other plugin. An application would discover the existing plugins from a plugin manager (via RPC). One such plugin could be a chat service. This plugin would offer connectors for an authentication plugin. A “chat UI” plugin would connect to the chat service to discover users, channels and subscribe to topics. It would use the authentication plugin to login a user.
A log service could collect log messages from any number of plugins in a central NoSQL database. A text indexing plugin could make this data searchable. A log UI would use both to show log data in real time or to analyze historical events. A monitor UI would use certain indicators to discover the system’s health from the log service’s data.
The goal is that each such plugin would only contain the minimum part of the UI. The log UI doesn’t know about menus. It can just display the log data in a table. The app would load the plugin, create a menu bar and attach menu items which would do RPC calls to the log UI.
As a first step, it won’t be possible to style all the plugins consistently. This is more a proof-of-concept right now. But I think with a dynamic HTTP server, it might be possible to chain CSS files. The plugin brings one, then the app can append it’s special rules and a theme plugin can modify that further. LESS might help, too, by defining variables and hooks for themes to quickly create a common look and feel.