-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Webextension refactoring #130
Comments
My thoughts about modularity and independence: UIController I have faced with communicating with UIController several times from outstanding repos - lexical-tests (browser and node versions), inflection games, safari application front script. And everytime I had a problem that UIController is specified for a current set of tasks:
So it is not a tool for controlling the data retrieving from several sources and updating it somewhere - it is a part of whole extension and it couldn't be used (and partly used) with any other tools. So for integrating it with something - I had two ways - copy everything I need and exclude everything I don't need (lexical-tests) and become a part of it (inflection games) webextension and embedded-lib As for embedded-lib it used on your own pages where you could have some specific tags, alignment - it is for your own embedded process and it seems to me - here we are going to give some opportunity for customizing and tuning. It could have some specefic events and some behaviour and we could extend it with the help of embedded-lib code. As for PWA - I think you are more experienced with it. So I think that events could have some prototypes (as you made for MouseDouble click) in components repo and UIController, but events should be initialized in extension or embedded-lib. My opinion that we could have some base classes in some repo - for example components for all these browser, embeedded targets. And we could define some required behaviour there. So we could use such base classes in any application, UIController could be used as a central main controller for working with data and vizualizing using our components or some other components. Your questions But as I wrote before I am not against your approach as it is a step to something better in future. |
I think we have mostly implemented the refactoring we plan to do here now. |
Ideas behind webextension refactoring (#128) were to implement the following architecture:
2.1 Starts a messenger service so that it can listen to messages from a background script (for webextension) or from a Safari app extension (for Safari)
2.2 (optional) Notify a background that a messenger service is started and a content script is ready to listen to commands from a background.
2.3 Depending on commands received, a content script creates, initializes, activates, or deactivates a UI controller (see https://github.com/alpheios-project/documentation/blob/master/development/app-architecture.md#state-control-methods). For other commands from background it might also run other methods of UI controller to open or close a panel or do other more specific actions.
That's it. We should keep it simple if possible, I think. We can think of a UI controller as a black box that a content script knows nothing about except how to create it properly and run a method that will correspond a command from a background (activate/deactivate/open/close panel etc.)
Do you agree with the approach proposed?
Does the content script in #128 matches this approach?
The text was updated successfully, but these errors were encountered: