Skip to content

Commit 764b389

Browse files
committed
Add RFC: Plugin Manager
updated rfc
1 parent 0259688 commit 764b389

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

accepted/0003-plugin-manager.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
- Start Date: 2019-12-30
2+
- RFC PR: #4
3+
- Mantis Issue: N/A
4+
5+
# Summary
6+
Create a plugin manager that is capable of configuring the loading of plugins as
7+
well as providing an easier means of installing plugins. Perhaps - later down
8+
the line - creating a online database that individuals can search and seamlessly
9+
install plugins.
10+
11+
# Motivation
12+
Varying from plugin to plugin, there are a variety of different intallation
13+
methods for each plugin. On top of that, once installed, there is no easy way to
14+
disable, or even configure, each individual plugin. In addition, if one plugin
15+
doesn't behave correctly because of another, it can become difficult to diagnose
16+
which plugins are causing the error. By implementing a plugin manager, it allows
17+
users to seamlessly install plugins and have finer control over the loading of
18+
their plugins. Furthermore, having a plugin manager opens up many more
19+
possibilties for both users and developers.
20+
21+
# Design
22+
## Functionality
23+
### Loading
24+
Currently, when plugins cause issues, the only way to disable them is by
25+
outright uninstalling them. However, this could be mitigated at startup by
26+
having an internal record of which plugins are installed. By keeping a list -
27+
perhaps in the configuration file - of the disabled plugins, they could be
28+
ignored during initilizaiton.
29+
30+
Furthermore, if a plugin causes a major failure while loading or doing use, it
31+
will be automatically disabled on the next startup with a popup warning the
32+
user. The popup will allow the user to re-enable the plugin (perhaps they
33+
knowingly used a experimental feature, etc.) or keep the plugin disabled. It
34+
would also be helpful to show an error code to the user to help them and the
35+
developer debug.
36+
37+
### Installation
38+
To further ease the user with their plugin (once downloaded), installation could be handled in 3
39+
different ways.
40+
- A file explorer in the manager to install a compressed package that contains:
41+
a manifest, locales, the actual plugin, and other needed components.
42+
- A file explorer that installs plugins by themselves - mostly for compatibilty
43+
with previous plugins
44+
- A compressed package that is associated with OBS so when double clicked, it
45+
can be automatically installed in the correct locations.
46+
47+
If the user installs a compressed package, the package would be decompressed and
48+
the contents would be copied to a directory in the plugins folder.
49+
50+
### Manifest
51+
As outlined in installed, a compressed package will contain multiple components
52+
including a manifest. The manifest will be responsible for outlining all
53+
important information about the plugin. An example of a barebones manifest is
54+
shown below:
55+
56+
```json
57+
{
58+
"name": "Plugin Name",
59+
"author": "Author Name",
60+
"description": "Description that would be displayed to user",
61+
"locale": {
62+
"en": "file path"
63+
},
64+
"plugin": {
65+
"64": "file path",
66+
"32": "file path"
67+
},
68+
"categories": ["PRODUCTIVITY", "CLASSIC", "THEMES"], //etc
69+
"version": "^24.0.0"
70+
}
71+
```
72+
73+
The purpose of the metadata in the manifest is for 3 main reasons: 1) Allowing
74+
for easier parsing of the compressed package, 2) allowing more flexibility for
75+
plugin creators, and 3) reducing mental overhead for users organizing their
76+
plugins.
77+
78+
Some notable entries on the manifest are categores and version. Version
79+
numbering allows the plugin creator to specifiy a specific version or range that
80+
the plugin can be loaded in. The categories affects the UX.
81+
82+
Note: The options in the manifest are predefined. A plugin developer can not
83+
have random options that can be searched as outlined in UX.
84+
85+
### UX
86+
To access the plugin manager, it would be under Settings -> Plugins or File ->
87+
Plugins. The plugin manager itself would have a searchbar at the top that allows
88+
searching through the metadata as provided in the manifest file and displays the
89+
results in the list below. Moreover, there would be a simple list view that
90+
outlines all the installed plugins in alphabetical order. The list would show
91+
the name, description, and categories of each plugin. All the way to the right,
92+
would be a button that outlines whether the plugin is disabled or currently
93+
active. Another feature would to allow the plugin to have its own settings menu
94+
which would display a button next to the disable button that opens its settings menu.
95+
96+
When a user disables a plugin, it will add the plugin to a list to prevent
97+
loading during initilization. It will also attempt to unlink the plugin, but a
98+
restart might be necessary. Likewise, when a user re-enables or installs a
99+
plugin, it will attempt to initialize the plugin.
100+
101+
If the plugin has its own settings menu, the information could be stored in its
102+
manifest which would be unpacked and installed.
103+
104+
### Future Considerations
105+
It would also help plugins be discovered if there was a built in browser for
106+
searching through plugins on a server. A user could search by name or other
107+
metadata (again outlined in the manifest) which would be in another list. Then,
108+
they could click on an install button next to the options to automatically
109+
download and install the plugin.
110+
111+
# How We Teach This
112+
It would be provided in the documentation. However, the bare functionality would
113+
hopefully be designed well enough that it can become plainly clear to the user
114+
how it works.

0 commit comments

Comments
 (0)