Skip to content

Feature: Adding plugins declaration in layout files #759

@spacemaison

Description

@spacemaison

Rigt now, the only way to specify headless plugins is in the configuration file. Given that layout files are meant to be freely shared, this can limit their usefulness. To fix this we can add a plugins field to the layout file. An example might help here:

---
plugins:
  # Http urls don't actually work yet... but in the future
  - path: "https://a-headless-plugin.com/plugin.wasm"
    run: headless
      
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      body: true

tabs:
  - direction: Vertical

Now that I'm looking at it, the path field from the PluginConfiguration should probably be changed to a location that accepts a fully resolved URL via the RunPluginLocation. This would help bring it in line with what's given as plugin configuration in the layout template.

Aside from that, how the layout files plugins field is merged with the configuration files is also an issue. We've got a some options here:

  1. Overwrite the plugins with the same name
  2. Do a merge of the plugins, partially overwriting the plugins from the configuration file with the layout file plugins
  3. Crash / Ignore one or the other
  4. Just drop the plugins from the configuration file, use only the layout file configuration options.

I think initially I like option #1. Any plugin from the layout file with a matching tag name can just override the configuration plugins. In the future if it's necessary we can add an option that'll merge the configuration options rather than override them.
h

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions