Conversation
In the CLI, we don't b64 encode the web-c script and it is not needed, so make the Offline HTML smaller by not encoding the script.
bundle html: - put the parameters to <read-along one per line for better readability Offline HTML: - Add more newlines so that all programmer-legible stuff is at the beginning of the line, not after a long base64-encoded blob. This way, looking at the file with line-wrapping off, you can see all the relevant stuff easily. - consistent 2 indent everywhere, including in font and js bundles - like in the CLI, put the web-c script inside the <script> tag instead of in its src attribute, for better legibility now that it's not b64 encoded anymore.
Changed Files
|
Contributor
|
This file contains hidden or 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
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.
PR Goal?
This work was triggered by noticing that a .html file someone just sent us was hard to analyse by hand, in terms of what versions of things were used. So I decided to add newlines so that the text part of stuff is still visible when you disable line-wrapping, and add more versioning information to the generated files.
Also, the web-component script does not need to be base64-encoded, that's just bloat: include it directly as is instead.
And in the script tag, add a
name="@readalongs/web-component"attribute to better document where the script came from.See also ReadAlongs/Studio#265 for related changes to the CLI.
Feedback sought?
General validation.
Question: is there a way to apply my indent in the pipe and switchmap business in b64.service.ts, instead of at download time, so that it could happen in the background earlier?
Priority?
normal
Tests added?
How to test?
Generate a readalong, download the offline HTML, open it and choose view source to inspect it.
Confidence?
good
Version change?
no