Jump to content

"HTML + JS" vs the "ControllerBase" system


Recommended Posts

HawkXP71
Posted

Not sure what to call each system, but html + JS is what I am calling when you define and return a list of PluginPageInfo in a GetPages method in your plugin.

The "ControllerBase" system is when you return a list of IPluginUIPageController from UIPageControllers.

 

Is there a table or listing to show the advantages and disadvantages of each?

My primary question, is if I modify the c# code that builds the page in the "ControllerBase" system, will I still have to use chrome in debug mode and clear the cache and reload like I have to with the html+js system?


 

 

Posted
6 minutes ago, HawkXP71 said:

My primary question, is if I modify the c# code that builds the page in the "ControllerBase" system, will I still have to use chrome in debug mode and clear the cache and reload like I have to with the html+js system?

Clear answer: No, you won't have to do this.

As for advantages and disadvantages, we don't have such a table.

The new one is called Plugin UIhttps://betadev.emby.media/doc/plugins/ui/index.html
The old htmljs method is still supported and has no specific name.

The general guidance is to always use Plugin UI unless you really need something that cannot be done with Plugin UI - which are things like having full control over the rendered UI, and showing images. Almost everything else - in the context of a settings UI can be done with Plugin UI just well.

The advantages of Plugin UI are

  • It's future proof
    many older plugins have a weird-looking UI these days when they haven't been updated
    whatever you may do today in a htmljs  plugin UI can be broken shortly after due to general UI code changes
  • it's easy and declarative
    You just define your settings as a C# class with appropriate interactions, you don't need to care about presentation
  • You don't have to create your own API service for the htmljs client code to interact with the server
  • You can stick to a single language for development (C#)

For more, see here: https://betadev.emby.media/doc/plugins/ui/index.html

HawkXP71
Posted
9 minutes ago, softworkz said:

Clear answer: No, you won't have to do this.

As for advantages and disadvantages, we don't have such a table.

The new one is called Plugin UIhttps://betadev.emby.media/doc/plugins/ui/index.html
The old htmljs method is still supported and has no specific name.

The general guidance is to always use Plugin UI unless you really need something that cannot be done with Plugin UI - which are things like having full control over the rendered UI, and showing images. Almost everything else - in the context of a settings UI can be done with Plugin UI just well.

The advantages of Plugin UI are

  • It's future proof
    many older plugins have a weird-looking UI these days when they haven't been updated
    whatever you may do today in a htmljs  plugin UI can be broken shortly after due to general UI code changes
  • it's easy and declarative
    You just define your settings as a C# class with appropriate interactions, you don't need to care about presentation
  • You don't have to create your own API service for the htmljs client code to interact with the server
  • You can stick to a single language for development (C#)

For more, see here: https://betadev.emby.media/doc/plugins/ui/index.html

Thanks!  Thats what I "kindof" figured.  As in the old way works, and is still supported.  But the new way is better :)

 

Is there any "this is what you did in js+html, this is the equivilent in the PluginUI" reference material?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...