Skip to content

Dev.ej/streamline bundle#395

Merged
joanise merged 3 commits intomainfrom
dev.ej/streamline-bundle
Apr 10, 2025
Merged

Dev.ej/streamline bundle#395
joanise merged 3 commits intomainfrom
dev.ej/streamline-bundle

Conversation

@joanise
Copy link
Member

@joanise joanise commented Apr 7, 2025

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

joanise added 2 commits April 7, 2025 16:45
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.
@semanticdiff-com
Copy link

semanticdiff-com bot commented Apr 7, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  packages/studio-web/src/app/shared/download/download.service.ts  72% smaller
  packages/studio-web/src/app/b64.service.ts  45% smaller

@joanise joanise requested a review from deltork April 7, 2025 21:48
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-04-10 17:16 UTC

Copy link
Collaborator

@deltork deltork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@joanise joanise merged commit 68abb9b into main Apr 10, 2025
6 checks passed
@joanise joanise deleted the dev.ej/streamline-bundle branch April 10, 2025 17:16
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