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

Change Angular to React #19

Open
geeks-r-us opened this issue Dec 15, 2020 · 5 comments
Open

Change Angular to React #19

geeks-r-us opened this issue Dec 15, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@geeks-r-us
Copy link
Owner

Due to Grafana deprecated Angular in favor of React
The Plugin should change the framework before more graphical extensions are done?
Personally I have never worked with react before so:

Let's check the effort it takes to move to react.

@geeks-r-us geeks-r-us added the enhancement New feature or request label Dec 15, 2020
@geeks-r-us
Copy link
Owner Author

I had a look at the Grafana react plugin capabilities and it seems at the beginning of version 7 there were also statefull react components allowed but more current there are only stateless panels allowed. This prevents maintaining a connection the mqtt server and the subscription to the topics.

Currently there is an emerging Grafana App API which consists of stateless panels and a statefull backend part. But this needs to be written in go.

Pros:

  • When running on the backend beside ws / wss also mqtt / mqtts connections could be established
  • Subscription keep going even no one is connected to the dashboard which allows alarms on changing topics, etc.
  • React panels are much cleaner in their implementation

Cons:

  • Complete rewrite of the plugin
  • Need more experience with react and go
  • Is Grafana App API already stable?
  • Breaks compatibility with running Version 6 ?

I think I'll set this as goal for version 2 of this plugin and maintain version 1 as Angular based plugin.

@s-torneo
Copy link

s-torneo commented May 2, 2021

I'm developing a backend plugin in Go and a panel plugin in React and typescript. The backend makes a mqtt client that you connect to a broker according to the configurations set, receives http internal requests from panel plugin and gives the response to them in order that panel plugin can show the response. At the moment I have developed a first version in which you can configure one or more mqtt clients (Grafana backend datasource) and one or more Grafana panel plugin that send requests to the mqtt client selected. In the panel plugin you can select the Mqtt operation (Connect/Disconnect/Subscribe/Unsubscribe/Publish) in order to show a different interface according to the operation selected. Have you already started to develop something like this?

@bbinet
Copy link

bbinet commented May 4, 2021

Hello @s-torneo, this is very interesting. I was thinking of doing the same in the mid-term future.
Would you like to share your work on the backend plugin in Go and panel plugin in React?

@geeks-r-us
Copy link
Owner Author

I also have a working MQTT connection. I currently struggle with the storage and update of the change topic values. And the identification which panel is requesting the data.

@s-torneo, @bbinet that sound interesting. Maybe we could join forces?

@s-torneo
Copy link

s-torneo commented May 8, 2021

HI @geeks-r-us and @bbinet, yes we can collaborate. I have finished to develop a first version, now it is available to this repository: https://github.com/s-torneo/mqtt-grafana-backend-panel-plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants