Repository navigation
feat: play packages from the library pack's parts, not the whole bundle - #11
Merged
Merged
Conversation
/h5p handed startEmbed() the whole libraries.h5p, so the first package that lacked a library downloaded all of it: 15.5 MB since pack 1.1.0, 1.8 MB of it libraries an H5P site's upload check wants and the player never reads. It now passes the pack export, one part per library, as sites written by h5p-embed have done since 0.8: - A package downloads only the parts it needs, each checked against the pack's SHA-256 and kept for every package that uses it. The build page reads the same parts, and dist/ drops libraries.h5p: 23 MB in all. - A package that carries older libraries plays the pack's newer versions (player 0.10), as the website says it does. The report names them in libraryBundle.refreshed; &refresh-libraries=off plays them as exported. The local declaration of startEmbed() goes: h5p-embed ships its own since 1.1.0, and only that one knows the pack option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
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.
/h5phandedstartEmbed()the wholelibraries.h5p(librariesPack). So the first package a visitor opened that lacked a library downloaded all of it. Since pack 1.1.0, which came in with #10, that is 15.5 MB, and 1.8 MB of it is libraries an H5P site's upload check wants, which the player never reads.This passes
startEmbed()the pack export of@missing-elements/h5p-libraries, one part per library, as sites written byh5p-embedhave done since 0.8.What changes
/buildalready reads these same parts, sodist/dropslibraries.h5pand is 23 MB in all.pack). The website already says the player does this.&refresh-libraries=offon the address plays them as exported.resume.report'slibraryBundleis now{ url, origin, fromCache, refreshed }instead ofnull.src/h5p-embed.d.tsis removed.h5p-embedships its own declarations since 1.1.0, and only those know thepackoption.Testing
pnpm typecheckandpnpm buildpass.pnpm e2e: 10 passed. The changed tests check:librariesispack;refreshedand an emptydowngradedLibraries.VITE_PLAYER_URL).Order
Merge embed-my/website#6 first. Its preview reads
refreshed. Without it, the live site would describe every package that carries older libraries as "exported without its libraries".🤖 Generated with Claude Code
Summary by cubic
/h5pnow passesstartEmbed()the library pack's parts, one per library, instead of the wholelibraries.h5pbundle, so a package exported without its libraries downloads only the parts it needs — a handful instead of 15.5 MB.What changes
dist/dropslibraries.h5p(23 MB in all).&refresh-libraries=offplays them as exported, and the report'slibraryBundleis now{ url, origin, fromCache, refreshed }instead ofnull.src/h5p-embed.d.tsis removed;h5p-embedships its own declarations since 1.1.0.refreshed; without it, the live site would describe every such package as "exported without its libraries".Written for commit c680ca9. Summary will update on new commits.