Extension Manager

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
mnesarco
Posts: 153
Joined: Thu Mar 26, 2020 8:52 pm

Extension Manager

Postby mnesarco » Wed Sep 16, 2020 2:54 pm

Hi Friends, vocx suggested to create a dedicated thread here for the Extension Manager.

- https://github.com/mnesarco/FreeCAD_ExtMan

This is a work in progress possible replacement for the AddonManager. It requires qt5 and python3.

screenshot_4.png
screenshot_4.png (108.54 KiB) Viewed 347 times
screenshot_5.png
screenshot_5.png (103.58 KiB) Viewed 347 times
screenshot_6.png
screenshot_6.png (168.61 KiB) Viewed 347 times
screenshot_7.png
screenshot_7.png (269.48 KiB) Viewed 347 times
vocx
Posts: 5068
Joined: Thu Oct 18, 2018 9:18 pm

Re: Extension Manager

Postby vocx » Wed Sep 16, 2020 3:35 pm

This project started from the Add ons manager - development and bugs topic thread.

In particular, it is mentioned around pages 10 to 20. To avoid polluting that thread, which refers to the current Addon Manager, this new thread was created.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
vanuan
Posts: 449
Joined: Wed Oct 24, 2018 9:49 pm

Re: Extension Manager

Postby vanuan » Wed Sep 16, 2020 4:06 pm

I'm excited to see more and more stuff using the web technology for UI instead of Qt. This is the only way forward!

A few questions:
1. Are you generating html for each action from python or using dynamic javascript pages?
2. Which protocol do you use for interaction between html and FreeCAD? Some sort of http API?
3. Are you familiar with React and GraphQL (developed by Facebook)?
4. Have you seen my POC?
https://github.com/Vanuan/FreeCADjs
https://forum.freecadweb.org/viewtopic.php?f=34&t=48611
User avatar
mnesarco
Posts: 153
Joined: Thu Mar 26, 2020 8:52 pm

Re: Extension Manager

Postby mnesarco » Wed Sep 16, 2020 9:37 pm

vanuan wrote:
Wed Sep 16, 2020 4:06 pm
1. Are you generating html for each action from python or using dynamic javascript pages?
html is generated dynamically using a python template manager built by me for this project.

vanuan wrote:
Wed Sep 16, 2020 4:06 pm
2. Which protocol do you use for interaction between html and FreeCAD? Some sort of http API?
All communications are done directly using QtWebEngine APIs. Not http involved in that part.

vanuan wrote:
Wed Sep 16, 2020 4:06 pm
3. Are you familiar with React and GraphQL (developed by Facebook)?
Yes I am a ReactJS developer, look at this: https://marzguitars.com/marz-designer/
But I have not used React in this project to keep it simple.

I am also a GraphQL developer, look at this: https://mnesarco.github.io/blog/2020/02 ... s-mutation
but I see no relation with this project.
It looks interesting, but I have had no time to look at it.
User avatar
vanuan
Posts: 449
Joined: Wed Oct 24, 2018 9:49 pm

Re: Extension Manager

Postby vanuan » Wed Sep 16, 2020 10:05 pm

mnesarco wrote:
Wed Sep 16, 2020 9:37 pm
All communications are done directly using QtWebEngine APIs. Not http involved in that part.
Interesting. How does it work exactly? So you don't catch DOM Events, but rather use <a href=""> everywhere?
Or there is a way to handle DOM events directly from Python?
mnesarco wrote:
Wed Sep 16, 2020 9:37 pm
Yes I am a ReactJS developer, look at this: https://marzguitars.com/marz-designer/
But I have not used React in this project to keep it simple.
Nice!
I'd say using React is simpler than developing a custom html template engine :)
mnesarco wrote:
Wed Sep 16, 2020 9:37 pm
I am also a GraphQL developer, look at this: https://mnesarco.github.io/blog/2020/02 ... s-mutation
but I see no relation with this project.
Cool! Do you think it is viable to do the same for FreeCAD API? That is expose it as a GraphQL endpoint?
mnesarco wrote:
Wed Sep 16, 2020 9:37 pm
It looks interesting, but I have had no time to look at it.
Got it. I thought we could join our forces and push Web UI integration into FreeCAD together. It seems that Extension Manager fits into Web UI vision nicely. There are at least 4 people on the forum who are interested in using HTML/JS/CSS for building parts of FreeCAD UI.
User avatar
vanuan
Posts: 449
Joined: Wed Oct 24, 2018 9:49 pm

Re: Extension Manager

Postby vanuan » Wed Sep 16, 2020 10:13 pm

Ah, I see it uses a custom protocol scheme instead of http:

Code: Select all

 extman://...
So it uses a custom protocol. Still, pretty much similar to http. I don't get why you said that no protocol is being used.
User avatar
mnesarco
Posts: 153
Joined: Thu Mar 26, 2020 8:52 pm

Re: Extension Manager

Postby mnesarco » Wed Sep 16, 2020 10:28 pm

vanuan wrote:
Wed Sep 16, 2020 10:13 pm
Ah, I see it uses a custom protocol scheme instead of http:

Code: Select all

 extman://...
So it uses a custom protocol. Still, pretty much similar to http. I don't get why you said that no protocol is being used.
I never said that. I said no http is used.
User avatar
mnesarco
Posts: 153
Joined: Thu Mar 26, 2020 8:52 pm

Re: Extension Manager

Postby mnesarco » Wed Sep 16, 2020 10:34 pm

vanuan wrote:
Wed Sep 16, 2020 10:05 pm
Nice!
I'd say using React is simpler than developing a custom html template engine :)
I decided to not use react because most of the freecad extensions are python centric, and my goal was to make it easy for other freecad developers to participate... You will get a lot of resistance if try to change too many things too fast.
User avatar
vanuan
Posts: 449
Joined: Wed Oct 24, 2018 9:49 pm

Re: Extension Manager

Postby vanuan » Wed Sep 16, 2020 10:46 pm

mnesarco wrote:
Wed Sep 16, 2020 10:34 pm
I decided to not use react because most of the freecad extensions are python centric, and my goal was to make it easy for other freecad developers to participate... You will get a lot of resistance if try to change too many things too fast.
I'd say the main benefit of introducing a well known technology is attracting more developers rather than trying to mimic a workflow of existing developers. With custom html template engine and custom protocol I'd say you limit developer participation even further without any clear benefit.

Do you have any intention on upstreaming QWebEngine-based MDI window into the main FreeCAD repository?
User avatar
mnesarco
Posts: 153
Joined: Thu Mar 26, 2020 8:52 pm

Re: Extension Manager

Postby mnesarco » Wed Sep 16, 2020 10:55 pm

vanuan wrote:
Wed Sep 16, 2020 10:05 pm
Cool! Do you think it is viable to do the same for FreeCAD API? That is expose it as a GraphQL endpoint?
In an ideal world, we could have an extensions portal with graphql endpoint... and indexing, automated quality tests, compliance tests, etc... but in the real freecad world it will not happen any soon. I have learned in this forum that things move very slowly here, small improvements over existing things are more appreciated than big changes. Sometimes it is frustrating but is the way it is. The first step to improve Extension management is to gain consensus about many things like metadata, file format, naming conventions, etc... And even if you gain consensus, you willl have to maintain backwards compatibility with the past and it makes things very hard to maintain, and if you are the proponent of the change, you are the maintainer.

So, my personal approach is to take an easy path, improve things step by step, in slow motion. if you are following the discussions about release 0.19 stable you know that it will be released some day in one or two decades, so we have time :D