This builds on D188681 and adds a new
quickSuggestRustEnabled is true,
UrlbarProviderQuickSuggest will use
SuggestBackendRust to fetch remote settings suggestions; otherwise it will use
The Rust component is already integrated into desktop Firefox (bug 1851256, bug
1851845), and it's exposed to JS via
RustSuggest.sys.mjs. Currently it only
supports AMP (sponsored, a.k.a. adM) and Wikipedia (non-sponsored) suggestions,
so that's all that
SuggestBackendRust supports too.
It's possible to configure the path of the Sqlite file created by the Rust
component. This path uses
suggest.sqlite in the user's profile directory.
This is only the initial integration. I can think of a few follow-ups:
- Handle icons. In this patch, results from
SuggestBackendRust don't have
icons at all. I have a WIP.
- Handle ingestion better. "Ingest" here means Firefox must tell the Rust
component to re-fetch suggestions from remote settings and rebuild its Sqlite
database. Unfortunately the Rust component doesn't keep the data updated by
itself, so we'll need to periodically tell the component to ingest. This patch
performs ingestion every time
SuggestBackendRust is (re)enabled, which is a
good enough start.
- Maybe handle tests better. For now I modified the main quick suggest unit
test, test_quicksuggest.js, so it tests both backends. Other tests should
maybe be updated too, I'm not sure yet.
- Handle priority sponsored suggestions.
Depends on D188681