Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Adding plugins declaration in layout files #759

Closed
spacemaison opened this issue Oct 2, 2021 · 0 comments · Fixed by #866
Closed

Feature: Adding plugins declaration in layout files #759

spacemaison opened this issue Oct 2, 2021 · 0 comments · Fixed by #866
Assignees

Comments

@spacemaison
Copy link
Contributor

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

@a-kenji a-kenji self-assigned this Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants