Skip to content

WASM/JS external ingestion API - #179

Draft
abkfenris wants to merge 2 commits into
phase-2a-feature-gate-embedded-datafrom
phase-2b-wasm-js-ingestion-api
Draft

WASM/JS external ingestion API#179
abkfenris wants to merge 2 commits into
phase-2a-feature-gate-embedded-datafrom
phase-2b-wasm-js-ingestion-api

Conversation

@abkfenris

@abkfenris abkfenris commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Remove embedded data from the default WASM binary (462 KB, down from
1.0 MB). The JS crate now builds with default-features = false on core,
so the compressed 4 MB vocabulary blobs are excluded.

New JS methods: loadCfStandardsFromYaml, loadCfStandardsFromJson,
loadStandards (JsValue), loadKnowledgeFromYaml, loadKnowledgeFromJson,
loadKnowledgeObjects (JsValue). Old loadCfStandards/loadKnowledge are
kept but gated behind the embedded-data feature.

gen-data.mjs combines the 41 per-standard YAML files into
public/knowledge.json and copies _cf_standards.yaml to public/, so
Vite can serve them during dev/test without embedding them.

Vitest, Playwright e2e, and pack smoke tests all updated to use the
fetch-based ingestion path. Full nox suite (rust_test, rust_test_no_embedded,
js_test) passes: 19+11 Rust tests, 12 Vitest, 5 Playwright, 1 pack smoke.


This is part 3 of 6 in a stack made with GitButler:

This was referenced Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Javascript size report

Size
Base (phase-2a-feature-gate-embedded-data) 1065.3 KB
PR 462.3 KB
Delta -603.0 KB (-56.6%)

✅ Size decreased -56.6%.

Remove embedded data from the default WASM binary (462 KB, down from
1.0 MB). The JS crate now builds with default-features = false on core,
so the compressed 4 MB vocabulary blobs are excluded.

New JS methods: loadCfStandardsFromYaml, loadCfStandardsFromJson,
loadStandards (JsValue), loadKnowledgeFromYaml, loadKnowledgeFromJson,
loadKnowledgeObjects (JsValue). Old loadCfStandards/loadKnowledge are
kept but gated behind the embedded-data feature.

gen-data.mjs combines the 41 per-standard YAML files into
public/knowledge.json and copies _cf_standards.yaml to public/, so
Vite can serve them during dev/test without embedding them.

Vitest, Playwright e2e, and pack smoke tests all updated to use the
fetch-based ingestion path. Full nox suite (rust_test, rust_test_no_embedded,
js_test) passes: 19+11 Rust tests, 12 Vitest, 5 Playwright, 1 pack smoke.
Replace load_cf_standards() / load_knowledge() (which are gated behind
the embedded-data feature and absent in the default build) with the new
external-ingestion API:
  - load_cf_standards_from_yaml: source YAML embedded via include_str!
    so the test binary is self-contained without a dev server
  - load_knowledge_from_json: minimal inline JSON with the one entry
    exercised by the metadata / filter tests
@abkfenris
abkfenris force-pushed the phase-2a-feature-gate-embedded-data branch from 2fb2382 to 65273d0 Compare June 25, 2026 20:36
@abkfenris
abkfenris force-pushed the phase-2b-wasm-js-ingestion-api branch from f4285cd to 5caceff Compare June 25, 2026 20:36
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.

1 participant