Repository navigation
Short targets, event dropping, EventSink (0.10.0) - #9
Merged
Merged
Conversation
….10.0 - Generate short target builders (own param only) alongside full ones - Drop events with missing payloads or stale sources instead of crashing - Add strictEventDropping and ServiceExtensionPoint.onEventDropped - Add EventSink with per-path generations; LocalEventSink in way-compose
…t schemas - Strict mode throws only for MissingPayload; StaleSource is an expected race - Assign generations before onEntry so sinks obtained there are live - Pass plain events to the enqueued-event scheduler, keep sink source on resend - Resolve missing payloads before onPreTransition; drops fire no pre/post hooks - Restore parameterized nodes from history with their recorded payloads - Rebuild an alive node re-targeted with a different argument - Generate one target per parent path for multi-parent imported schemas (Schema.targets), with per-path node building and finish routing - Codegen: escape keyword parameter names, skip nullable imported roots - Compose: key sink on service and generation, reset state per service, include generations in NavigationState equality - Add way-compose Robolectric tests and many runtime/codegen corner-case tests
A node's EventSink now resolves events the way sendEvent does, scoped to that node: a screen's sink starts at the screen, a flow's or parallel's sink starts at the active leaves under it, then bubbles up through the node and every enclosing parallel. The root sink is equivalent to sendEvent, so UI can always use LocalEventSink. Back stays in the node's region. resolveSourcedTransition is merged into resolveTransition. Sample app screens use LocalEventSink instead of an injected FlowEventSink.
NavigationService implements EventSink: sendEvent is removed, service.send(event) is the root sink (whole tree, never stale); the queue/dispatch is private. BaseScreenNode and BaseFlowNode get a public eventSink, attached by the service right before every onEntry and never cleared, so a send after exit is dropped as StaleSource. LocalEventSink falls back to LocalNavigationService outside any node. Migrate call sites, tests and docs.
…s, extend sink tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
details(id)) keep alive ancestors' payloads; full builders (packageDetails(detailsId, id)) remain for cold start /initial/ jumps into non-alive branches.DropReason.MissingPayloadandDropReason.StaleSource.onEventDroppedalways fires;strictEventDroppingthrowsEventDroppedExceptionforMissingPayloadonly.EventSink: source path + generation checked at dequeue;LocalEventSinkin way-compose. A sink resolves likesendEventscoped to its node: a screen starts at itself, a flow/parallel at the active leaves under it, then bubbles through the node and enclosing parallels; Back stays in the node's region. Root sink ≡sendEvent, so UI always usesLocalEventSink.onPreTransition/onPostTransition(except the hand-rolled-schema builder backstop).HistoryTargetrestores parameterized nodes with their recorded payloads.<node>Via<Parent>), newSchema.targets(). Rejected at build time: shared schema with children, parallel parent, parents in different parallel regions.NavigationStateequality includes generations.Test plan
./gradlew spotlessCheck build :way:allTests :way-compose:testDebugUnitTest --rerun-tasksgreen: way 278, way-gradle-plugin 98, way-compose 9 (new, Robolectric), sample-compose 4.🤖 Generated with Claude Code