-
Notifications
You must be signed in to change notification settings - Fork 47
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: Embedded resources #87
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 stops the files being built if nothing has changed.
Initially this was intended to enable directly straming data from flash, however depending on lowwere levels of the TCP stack to to perform unaligned reads is not practical. It also offers some other benefits; - Should be a bit faster, no file system to navigate - Uses less memory - All web server resources are in the firmware so no separate SPIFFS partition to update - SPIFFS requires a large chunk of memory, which is not needed
This is very clever. So do the web files in |
The images (and potentially other files that are not to be minified) are in
src/data and this is handy still for running the files locally when
developing the HTML/JS so although it is not best practice to keep the
autogenerated files in Git there is probably cause to in this case.
Jeremy
…On Sep 10, 2017 12:02 AM, "Glyn Hudson" ***@***.***> wrote:
This is very clever. So do the web files in src/html get converted to .h
files on platformio compile? Can src/data be removed now it's not used?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF1WgL7_vT1NGE4czpuvnhH5Xx97BXJSks5sgxkIgaJpZM4PQStY>
.
|
This was referenced Sep 18, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an extension to #83 to embed the web app resources into the firmware instead of SPIFFS.
Initially this was intended to enable directly streaming data from flash, however depending on lower levels of the TCP stack to to perform unaligned reads is not practical.
It however also offers some other benefits;