Files
zed/crates/gpui_web/Cargo.toml
T
Cameron Mcloughlin d1074238d6 gpui: Web text input improvements (#63201)
GPUI's keyboard handling on the web was previously managed with a hidden
`<input>`, and raw key events from this element were forwarded to GPUI's
key handling code.

However, this approach had some issues:
- it's not sufficient for key handling on android - gboard (the default
keyboard) does not produce raw key events, and instead presents as an
IME. The existing code did handle IMEs, but the implementation was
minimal, and didn't support gboard
- there was a bug relating to how state mapped between GPUI elements and
the underlying `<input>` that allowed for edits to be applied to stale
element text
- gboard seems to be picky about exactly how events are reported back,
and would lose state if we naively pass events back as soon as they are
ready. Now, we coalesce edits to the underlying `<textinput>` to at most
1 per JS event loop cycle

---

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-08-25 15:23:50 +00:00

93 lines
2.2 KiB
TOML

[package]
name = "gpui_web"
version = "0.1.0"
publish.workspace = true
edition.workspace = true
license = "Apache-2.0"
autoexamples = false
[lints]
workspace = true
[features]
default = ["multithreaded"]
multithreaded = ["dep:wasm_thread", "scheduler/wasm-threads"]
[lib]
path = "src/gpui_web.rs"
[target.'cfg(target_family = "wasm")'.dependencies]
gpui.workspace = true
scheduler.workspace = true
parking_lot = { workspace = true, features = ["nightly"] }
gpui_wgpu.workspace = true
http_client.workspace = true
anyhow.workspace = true
futures.workspace = true
log.workspace = true
uuid.workspace = true
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
web-time.workspace = true
console_error_panic_hook.workspace = true
js-sys.workspace = true
raw-window-handle.workspace = true
# Forked because upstream is unmaintained and its worker bootstrap still calls
# the wasm-bindgen init function with the positional arguments deprecated in 0.2.93.
wasm_thread = { git = "https://github.com/zed-industries/wasm_thread", rev = "0cf96c7708dfb97ccf3da50347e25edcf75d6937", version = "0.3", features = [
"es_modules",
], optional = true }
web-sys = { version = "0.3", features = [
"console",
"Blob",
"Clipboard",
"ClipboardEvent",
"ClipboardItem",
"CompositionEvent",
"CssStyleDeclaration",
"DataTransfer",
"DataTransferItem",
"DataTransferItemList",
"Document",
"DomRect",
"DragEvent",
"Element",
"EventTarget",
"File",
"HtmlCanvasElement",
"HtmlElement",
"HtmlTextAreaElement",
"IdleDeadline",
"IdleRequestOptions",
"InputEvent",
"KeyboardEvent",
"Location",
"MediaQueryList",
"MediaQueryListEvent",
"MouseEvent",
"Navigator",
"PointerEvent",
"ReadableStream",
"ReadableStreamDefaultReader",
"ReadableStreamReadResult",
"ResizeObserver",
"ResizeObserverBoxOptions",
"ResizeObserverEntry",
"ResizeObserverSize",
"ResizeObserverOptions",
"Screen",
"Storage",
"VisualViewport",
"Headers",
"Request",
"RequestCredentials",
"RequestInit",
"RequestRedirect",
"Response",
"WheelEvent",
"Window",
] }
[package.metadata.cargo-shear]
ignored = ["scheduler"]