As was noted on the plugin page, this was on the roadmap, but not yet supported. I’ve added support now thanks to a prod from @wthit56 so you can treat it just like you would a normal ‘static’ import.

One nice use case that this properly/robustly unlocks is the situation where you e.g. have a plugin that you’ve made, and you want to import the comments plugin so people can chat about your plugin and ask questions, but you don’t want to cause all importers of your plugin to automatically get the comments plugin as a dependency.

If you just dynamically import the plugin in your HTML panel, then importers of your plugin won’t get the comments plugin as a dependency. Example:

https://perchance.org/import-only-in-html-panel-no-dependency-example#edit

(Reminder that, as mentioned on the dynamic import plugin page, you should only use the dynamic import plugin in very particular scenarios, like this one, or e.g. when you have hundreds of imports but only a subset of those imports tend to get used by any particular user of your generator. Regular imports will generally allow for much faster generator loading, since all the data is preloaded.)

  • perchance@lemmy.worldOPM
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 months ago

    @[email protected] @[email protected] I can’t recall exactly who had this problem (wanting to use comments plugin on plugin page, but not wanting to cause it as an import for users of your plugin). I’m sure a lot of people have had this issue, but pinging the two of you because I think you might have mentioned it before.

    • allo@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 months ago

      i know I did for sure. sounds great. will look at this next i get in to plugins tho first need to get solar working on the 10 acres i just bought :) . Love the progress you are making