Skip to content

chore: vendor streaming-markdown@0.2.15, remove CDN dependency - #924

Closed
bsgdigital wants to merge 1 commit into
nesquena:feat/917-streaming-markdownfrom
bsgdigital:feat/streaming-markdown-vendor
Closed

bsgdigital wants to merge 1 commit into
nesquena:feat/917-streaming-markdownfrom
bsgdigital:feat/streaming-markdown-vendor

Conversation

@bsgdigital

Copy link
Copy Markdown
Contributor

What

Self-hosts streaming-markdown@0.2.15 instead of loading it from jsDelivr CDN.

  • Adds static/vendor/smd.min.js (12.6 KB, committed from npm tarball)
  • Updates index.html import to /static/vendor/smd.min.js

Why

  • No CDN dependency — app works fully offline / air-gapped; no external network call at runtime
  • Version control — the exact bytes are in the repo, not fetched from a third party at page load
  • Eliminates the CDN availability risk (jsDelivr downtime = broken streaming markdown)

SRI note

ES module import cannot carry an integrity= attribute regardless of whether the URL is remote or local (W3C limitation). Self-hosting is the practical alternative — the file is repo-controlled. The sha384 hash is documented in a comment for auditing:

sha384-T6r95ocN9t3W8tUK2Fa6FPaO7bJryyjyW0WCalrUnpgtm2qXr5xcN4vwPYEJ6vHa

This matches the hash already noted in the original PR #923 comment.

Tests

2060 tests pass (no changes to test suite needed).

Self-host smd.min.js (12.6 KB) under static/vendor/ so the app works
fully offline and without any CDN availability requirement.

- Add static/vendor/smd.min.js (npm:streaming-markdown@0.2.15)
- Update index.html to import from /static/vendor/smd.min.js

ES module `import` still cannot carry an integrity= attribute (W3C
limitation applies equally to local paths), but the file is now
committed to the repo and version-controlled rather than fetched from a
third-party CDN at runtime. The sha384 hash is documented in a comment
for auditing:

  sha384-T6r95ocN9t3W8tUK2Fa6FPaO7bJryyjyW0WCalrUnpgtm2qXr5xcN4vwPYEJ6vHa

All 2060 tests pass.
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Triage review — companion to #923

This PR directly addresses the CDN-dependency concern raised in the #923 review:

Self-hosting option: at 12.3 KB the library is trivial to vendor under static/vendor/smd-0.2.15.js. That would eliminate CDN trust entirely.

What it does:

  • Adds static/vendor/smd.min.js (12.6 KB from npm streaming-markdown@0.2.15)
  • Updates index.html to import from /static/vendor/smd.min.js instead of jsDelivr CDN

Merge order note: This PR should be merged after #923, since it updates the same index.html import path that #923 introduces. If merged before #923, the import path won't exist yet. If maintainer prefers to avoid the CDN ever reaching master, these two PRs could be merged together.

Verification:

Clean, focused change. Recommend reviewing alongside #923.

@nesquena-hermes
nesquena-hermes deleted the branch nesquena:feat/917-streaming-markdown April 24, 2026 00:43
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