-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
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.
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? |
Yeah, leave it open for now, there are a few things I want to try and
improve (eg a dev mode as you indicate)
…On Aug 29, 2017 5:35 PM, "Glyn Hudson" ***@***.***> wrote:
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?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF1WgNFUrr1pLjH-uo-pRJh9ZJIqBGzjks5sdD21gaJpZM4PDLbD>
.
|
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 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.
I've been doing some testing today and noticed this PR seems have created some layout issues when the page is viewed on desktop: 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! |
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.
Thanks, I will look in to those issues
That is expected, this is only part of the fixes I am working on. |
Ah, that's great. Sorry I had not notices this. |
closed since these commits are included in #87 |
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.