You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ship highlight.js verbatim from @highlightjs/cdn-assets (#112)
AMO's review of 1.9.4 is blocked on reproducing the minification of
lib/highlight.min.js. That is unwinnable as long as we ship a custom build:
there is no official artifact to checksum against, so the reviewer has to
reproduce a build, and reproducing ours was never possible anyway --
package.json pinned highlight.js to a bare GitHub URL with no ref, the
workflow re-resolved it with `npm install --package-lock-only` before
clean-install, `npm audit fix` ran immediately before the build, and
package-lock.json was stripped from the release archive. Nothing in the
submitted zip identified a fixed version.
Consume the project's own published distribution instead, pinned exactly, and
copy the files without modification. @highlightjs/cdn-assets is highlight.js'
own npm package rather than a third-party CDN rehost, so package-lock.json
records the tarball URL and its SHA-512 integrity hash: a reviewer verifies
the shipped files with `npm ci` and `diff`, with no build to reproduce.
The es/ modules give core plus only the xml, http and properties grammars --
about 24 KB, slightly smaller than the custom build. A first-party shim
registers them and exposes hljs as a global so the page's classic scripts are
unchanged; every hljs call site is event-driven, so the deferred module
script is not a timing hazard.
cdn-assets has no 11.11.1 successor yet, so this pins one patch behind the
11.11.2 the lock-file previously resolved to. A documentable downgrade is
worth more than an unreproducible build.
Refs #109
0 commit comments