# 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.json` at 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", ...}}` * **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. Assuming `quickjs-cosmo` might be Linux/Universal. Let's fetch `LATEST.json` to be sure. ## 3. Implementation Changes * **`src-tauri/src/binary_manager.rs`**: * Update `QJS_REPO_URL` to `https://bellard.org/quickjs/binary_releases`. * Add logic to fetch `LATEST.json` first. * Parse the JSON to get the actual filename for the current OS. * Download the ZIP file. * Extract the binary (`qjs.exe` or `qjs`) from the ZIP. * Rename it to our internal standard (`quickjs.exe` / `quickjs`). ## 4. Verification * Re-run tests. * Ensure `update_quickjs` flows correctly with the new logic.