refactoring of html templates and javascript code #471
WolfgangFahl
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently justpy creates a html page for startup that is 2405 lines long.
Unfortunately this verbosity leads to hiding the clean structure behind the code which is shown below:
the core Vue component 'app1'
The html is a mixture of css and javascript imports and declarations. A separation of concern is not visible and would IMHO be the core task of refactoring making sure that only a few lines of clean html are left that are commented to show what the parts do.
To get this new clean result i suggest to get rid of the Jinja templates and instead write the generator for the code as a pure python code with an object oriented structure. The logic to be used for version handling and other configuration task can then be implemented much clean and be tested and debugged. Jinja templates are executed out of the standard python debugging context and are a nightmare for testing and debugging. The extra value the templates seem to bring at first look does IMHO evaporate as soon as maintainance work as we need to do is to be done.
First step - replace %include
The explosion of html lines in the code is mostly from the use of the %include% option of the Jinja templates:
Beta Was this translation helpful? Give feedback.
All reactions