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

RFC: Initial version of HTML app builder #83

Merged
merged 7 commits into from
Sep 9, 2017

Conversation

jeremypoulter
Copy link
Collaborator

This is an initial version of code to combine and minify the HTML, CSS and JS.

The idea is that, when minified and combined, there will be less resources used on the ESP and lower memory usage.

This will also allow config.js to be split up in to multiple files and maybe allow conditional building to merge the code base with EmonESP, etc.

On the downside the HTML now has to be 'compiled' which can slow down development.

The minifying is done mostly in pure Python and intergrated in to the PlatformIO build process so no additional instilation steps are required.

The exception to this is the JS minification which is done using a web service (the Python minifyer is broken) so you need to be online when building.

This is an initial version of code to combine and minify the HTML, CSS and JS.

The idea is that, when minified and combined, there will be less resources used on the ESP and lower memory usage.

This will also allow config.js to be split up in to multiple files and maybe allow conditional building to merge the code base with EmonESP, etc.

On the downside the HTML now has to be 'compiled' which can slow down development.

The minifying is done mostly in pure Python and intergrated in to the PlatformIO build process so no additional instilation steps are required.

The exception to this is the JS minification which is done using a web service (the Python minifyer is broken) so you need to be online when building.
@glynhudson
Copy link
Contributor

glynhudson commented Aug 29, 2017

Fantastic, I've just tested and it seems to work ok for me. I'll report back regarding performance.

Is there any way to un-minify the html / css for dev?

Do you want me to leave this PR open? Is it a WIP?

Have you noticed or been able to quantify any performance changes?

@jeremypoulter
Copy link
Collaborator Author

jeremypoulter commented Aug 29, 2017 via email

@glynhudson
Copy link
Contributor

glynhudson commented Aug 30, 2017

Would it be possible to keep the working copy in the git repo as un-minified then the minification process takes place on platformio compile / upload and stored in a special folder.

This is how Jekyll static html generator from markdown works, the markdown files is committed to the repo then Jekyll is ran to generate the static HTML which is stored in a _deploy folder ready to be deployed via a web server. We've got Travis CI setup to automatically run Jekyll whenever a change is committed to the markdown files in the git repo.

I'm worried we might miss out on any community contributions / fixes if the code on github is un-human readable!

This stops the files being built if nothing has changed.
@glynhudson
Copy link
Contributor

I've been doing some testing today and noticed this PR seems have created some layout issues when the page is viewed on desktop:

selection_103

I'm also still experiencing the page hanging issues, especially if the unit has been left running for a while e.g. overnight. The following morning it seems to take a number of refreshes to load the page. I'm not sure if this is related, but opening the Chrome dev console seems to help as I believe this clears the page cache. Once the dev console is open the page seems to load much more reliably. Which is annoying sine I was trying to capture the network activity when the page hangs!

@jeremypoulter
Copy link
Collaborator Author

Would it be possible to keep the working copy in the git repo as un-minified then the minification process takes place on platformio compile / upload and stored in a special folder.

The unminified version is in src/html, I kept the minified files in src/data to maintain Arduino IDE compatibility, however I am not worried about breaking that if need be.

I've been doing some testing today and noticed this PR seems have created some layout issues when the page is viewed on desktop:

Thanks, I will look in to those issues

I'm also still experiencing the page hanging issues

That is expected, this is only part of the fixes I am working on.

@glynhudson
Copy link
Contributor

The unminified version is in src/html

Ah, that's great. Sorry I had not notices this.

@glynhudson
Copy link
Contributor

closed since these commits are included in #87

@glynhudson glynhudson merged commit 65c9b34 into OpenEVSE:master Sep 9, 2017
@jeremypoulter jeremypoulter deleted the html_builder branch May 15, 2018 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants