Fission 0.11.0 replaces TextInput::on_change with TextInput::on_input.
The bound action stays yours: the text runtime no longer rewrites its payload.
Instead, the reducer reads the complete edit—including the text, widget ID,
caret, and selection anchor—from ReducerContext::input.
This is a breaking change. The old API worked for a simple SetText(String),
but it used the action payload for two different things: first the context the
app bound, then the edited text. That falls apart for a dynamic form where the
reducer needs both the field ID and the new value. With on_input, the action
keeps its meaning and the edit arrives as separate runtime input.
The migration snippets below describe 0.11.0. For a new app, the current
Compose binding syntax generates simple field-update reducers;
the input guide shows the current
dynamic-field pattern without treating a borrowed view snapshot as retained
state. Bind an action that contains only stable application context:
TextInput {
value: draft.metadata.get(&field).cloned().unwrap_or_default(),
on_input: Some(ctx.bind_local(
UpdateIntegrationField(field.clone()),
draft.clone(),
reduce!(update_integration_field),
)),
..Default::default()
}
Read the transient edit in the reducer:
#[fission_reducer(UpdateIntegrationField)]
fn update_integration_field(
draft: &mut IntegrationDraft,
field: FieldId,
ctx: &mut ReducerContext<IntegrationDraft>,
) {
let Some(change) = ctx.input.text_change() else {
return;
};
draft.metadata.insert(field, change.new_text.clone());
}
text_change() returns an UpdateTextInput with node_id, new_text,
new_caret, and new_anchor. Offsets are UTF-8 byte offsets. Fission does not
inspect application JSON, replace the last string in a tuple, or synthesize a
different action at dispatch time.
UpdateTextInput is runtime event data, not an Action. Bind your own unit or
contextual action to on_input and read the edit from the reducer context;
there is no need to dispatch UpdateTextInput yourself.
A field that updates a single string uses the same contract: bind a unit action
and read change.new_text. There is no separate legacy mode.
Declarative bindings install one reducer handler for each effective action ID
during a build. That means repeated fields can use the same action type with
different payloads without running the reducer once for every mounted field.
Put the field-specific context in the action value, as above. If you do want to
run every registered handler, use register(...) for intentional multicast
dispatch.
NumberInput::on_input sends the same text-edit event. Parse it in your reducer
so the app decides what empty input, a minus sign, decimal separators, invalid
text, clamping, and formatting should mean:
#[fission_reducer(SetQuantity)]
fn set_quantity(state: &mut OrderState, ctx: &mut ReducerContext<OrderState>) {
let Some(change) = ctx.input.text_change() else {
return;
};
if let Ok(quantity) = change.new_text.parse::<f32>() {
state.quantity = quantity.clamp(1.0, 100.0);
}
}
Combobox and Editable also use on_input for typed edits, forwarding the
event from their inner TextInput.
One event across interactive shells
Keyboard and input-method edits, winit accessibility changes, native desktop
and mobile input, Web input, and interactive SSR browser islands all dispatch
ActionInput::TextChanged(UpdateTextInput). Core IR identifies the binding
with ActionTrigger::TextChanged. Browser islands keep the runtime and local
widget state between edits instead of rebuilding an action from DOM data.
Static site output and ordinary SSR HTML are intentionally inert. They render
controls but do not run Rust reducers for each keystroke. If an SSR page needs
this input behaviour in the browser, use an interactive island. Islands do not
yet run general client-side effects: input reducers work, while queued effects
and callbacks are rejected.
If Fission cannot deserialize a reducer action, it now returns an error and
emits a sanitised diagnostic instead of silently dropping the input. The
diagnostic names the action and target without logging form payloads or raw
errors that could contain credentials.
Breaking surface
Update your app to:
rename TextInput::on_change to TextInput::on_input;
replace direct UpdateTextInput action dispatch with an application action
bound to on_input;
update text reducers to read ctx.input.text_change() instead of an action
string or number;
rename Combobox, Editable, and NumberInput typed-edit hooks to
on_input;
parse NumberInput text in the reducer;
move per-widget context captured by distinct reducer closures into the bound
action payload when several widgets use the same action type;
add TextChanged arms to exhaustive matches over public ActionInput and
ActionTrigger enums;
and add an ActionDispatchFailed arm to exhaustive matches over the public
DiagEventKind enum.
Update the Fission dependency used by the application:
fission = { version = "0.11.0", default-features = false, features = ["desktop"] }
This is a clean break, so the version is 0.11.0 rather than a patch to the
payload-replacement behaviour.