gpui_web: Implement fetch based HTTP client (#50463)

Can only be used in single threaded environments for now due to js
futures being non-send.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth authored and GitHub committed 2026-03-02 16:18:01 +01:00
1 parent 1fac14fcc7
commit dd02a2bb32
10 files changed
+316 -47

No files matched your search

+7 -1
View File
@@ -18,6 +18,12 @@ pub fn headless() -> gpui::Application {
gpui::Application::with_platform(current_platform(true))
}
/// Unlike `application`, this function returns a single-threaded web application.
#[cfg(target_family = "wasm")]
pub fn single_threaded_web() -> gpui::Application {
gpui::Application::with_platform(Rc::new(gpui_web::WebPlatform::new(false)))
}
/// Initializes panic hooks and logging for the web platform.
/// Call this before running the application in a wasm_bindgen entrypoint.
#[cfg(target_family = "wasm")]
@@ -49,7 +55,7 @@ pub fn current_platform(headless: bool) -> Rc<dyn Platform> {
#[cfg(target_family = "wasm")]
{
let _ = headless;
Rc::new(gpui_web::WebPlatform::new())
Rc::new(gpui_web::WebPlatform::new(true))
}
}