Mobile v4 docs: validation + durable native callbacks - #465
Open
shanerbaner82 wants to merge 1 commit into
Open
Conversation
New the-basics/validation.md (order 158): validate()/validateOnly() semantics (abort handler, keep state, render with $errors — identical on device and web), the repeatable #[Validate] attribute with eager per-sync validation and rule merging, rules()/messages(), inline rule scoping, FormRequest sharing (method injection, props-only data scope, authorize() never called), the explicit-only error-display contract (@error, @nativeError, input error/supporting attributes), manual bag control, and per-component child scoping. the-basics/events.md additions: both #[On] spellings (idempotent native: prefix), the fluent Pending* outcome callbacks and onSuccess() sugar, callback durability (two-tier storage; $this-closures survive a process kill via serialize-and-rebind, with the serializable-captures / no-eval / persistent-cache constraints; method-name strings as the most robust form), and per-listener validation isolation, cross-linked to the new validation page. Every documented fact verified against the live core source and its test suites (26 validation + 8 durable-callback tests). Prose Blade directives are @@-escaped per site convention — docs .md pages compile through Blade, and an unescaped bare @error in prose is an unclosed if. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Documents the two feature PRs landing in core (NativePHP/mobile-air#301 and #302) for the v4 mobile docs.
New page —
the-basics/validation.md(order 158, between Nested Components and Dialogs):validate()/validateOnly()in handlers: failure aborts the handler, keeps state, and the next frame renders with$errors— identical on device and web#[Validate]attribute, eager per-sync validation (thenative:modelmodifier is the cadence), rule merging, and the constant-expression limitation for Rule objectsrules()/messages()/validationAttributes(), inline rule scoping, wildcardvalidateOnlyrules(),authorize()never called, props-only data scope@error,@nativeError, and inputerror/supportingattributes — a failed validation never changes an element's appearance on its ownUpdated —
the-basics/events.md:#[On]spellings (thenative:prefix is applied idempotently)Pending*outcome callbacks and the newonSuccess()sugar$this-bound closures surviving a process kill (serialize + rebind), constraints (serializable captures, no eval'd closures, persistent cache store), method-name strings as the most robust formVerification
Every documented fact was verified against the live core source and its test suites (26 validation tests + 8 durable-callback tests) rather than written from memory. Both pages render 200 on nativephp.test; prose Blade directives are
@@-escaped per site convention (the docs pipeline compiles.mdthrough Blade — a bare@errorin prose is an unclosedif).Note for reviewers: the feature PRs are not merged yet — this shouldn't ship before they do. One known naming inconsistency left alone per scope rules:
text-input.mddocuments the error attribute asis-errorwhile this page uses the:erroralias (both are accepted byBaseTextInput).🤖 Generated with Claude Code