1.5 KiB
1.5 KiB
QuickJS Binary Source Update
1. Context
The current quickjs-ng runtime is proving too slow for our needs. We need to switch to the original QuickJS runtime provided by Bellard.
2. Source Details
- Base URL:
https://bellard.org/quickjs/binary_releases/ - Versioning: Use
LATEST.jsonat the base URL to find the latest version and filename.- Format:
{"version":"2024-01-13","files":{"quickjs-win-x86_64.zip":"quickjs-win-x86_64-2024-01-13.zip", ...}}
- Format:
- Target Files:
- Windows: Look for key
quickjs-win-x86_64.zip. - macOS: Look for key
quickjs-cosmo-x86_64.zip(Cosmo builds are generally portable). Wait, need to confirm if macos specific builds exist or if cosmo is the intended one for unix-like. - Correction: Bellard's page lists
quickjs-macos-x86_64.zip? Let's check LATEST.json first. Assumingquickjs-cosmomight be Linux/Universal. Let's fetchLATEST.jsonto be sure.
- Windows: Look for key
3. Implementation Changes
src-tauri/src/binary_manager.rs:- Update
QJS_REPO_URLtohttps://bellard.org/quickjs/binary_releases. - Add logic to fetch
LATEST.jsonfirst. - Parse the JSON to get the actual filename for the current OS.
- Download the ZIP file.
- Extract the binary (
qjs.exeorqjs) from the ZIP. - Rename it to our internal standard (
quickjs.exe/quickjs).
- Update
4. Verification
- Re-run tests.
- Ensure
update_quickjsflows correctly with the new logic.