In order to enable modernizing main.js, this PR suggests to split the rendering-part of the main App-component into smaller parts and files. In total, all proposed changes reduce the size of main.js by about 33% (1736 loc to 1165 loc).
In more detail:
moves all Panes to a dedicated folder named js/panes/
moves Poller-class to js/Legacy.js (as it is not required in most cases)
moves potential user-settings to dedicated file js/settings.js
moves renderViewModal() to the new component js/modals/ViewModal
moves renderEnvModal() to the new component js/modals/EnvModal
moves renderViewControls() to the new component js/topbar/ViewControls
moves renderEnvControls() to the new component js/topbar/EnvControls
moves renderFilterControls() to the new component js/topbar/FilterControls
moves the "Online/Offline"-Button in the top right corner to the new component js/topbar/ConnectionIndicator
Motivation and Context
The main goal is to improve the maintainability of the webclient's core.
As a side-product this PR splits the rendering-function into a disjoint set of components that can be more easily improved or altered in the future.
How Has This Been Tested?
As the env & view modals are refactored here, this PR requires #886 to be merged in order to ensure functionality across the changed implementation.
Note: The Linter Check will fail here. As I have only adapted parts of js/main.js and the file did not yet match linter specs, the github-action that checks all changed files will show some errors for the older code parts. I did not adapted those as the changes required would go beyond the scope of this PR.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] Code refactor or cleanup (changes to existing code for improved readability or performance)
Checklist:
[ ] I adapted the version number under py/visdom/VERSION according to Semantic Versioning
I have not adapted the version number here; While this PR should not require a new version as no function should have been altered, we could still increase the MINOR release in case some bug has been introduced during refactoring.
[ ] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
In order to enable modernizing
main.js
, this PR suggests to split the rendering-part of the mainApp
-component into smaller parts and files. In total, all proposed changes reduce the size ofmain.js
by about33%
(1736 loc
to1165 loc
).In more detail:
js/panes/
js/Legacy.js
(as it is not required in most cases)js/settings.js
renderViewModal()
to the new componentjs/modals/ViewModal
renderEnvModal()
to the new componentjs/modals/EnvModal
renderViewControls()
to the new componentjs/topbar/ViewControls
renderEnvControls()
to the new componentjs/topbar/EnvControls
renderFilterControls()
to the new componentjs/topbar/FilterControls
js/topbar/ConnectionIndicator
Motivation and Context
The main goal is to improve the maintainability of the webclient's core. As a side-product this PR splits the rendering-function into a disjoint set of components that can be more easily improved or altered in the future.
How Has This Been Tested?
As the env & view modals are refactored here, this PR requires #886 to be merged in order to ensure functionality across the changed implementation.
Note: The Linter Check will fail here. As I have only adapted parts of
js/main.js
and the file did not yet match linter specs, the github-action that checks all changed files will show some errors for the older code parts. I did not adapted those as the changes required would go beyond the scope of this PR.Types of changes
Checklist:
py/visdom/VERSION
according to Semantic Versioning I have not adapted the version number here; While this PR should not require a new version as no function should have been altered, we could still increase the MINOR release in case some bug has been introduced during refactoring.