Add native component lifecycle foundations - #342
Closed
shanerbaner82 wants to merge 4 commits into
Closed
Conversation
shanerbaner82
force-pushed
the
agent/native-component-features
branch
from
August 16, 2026 05:26
61122cd to
ce63d6f
Compare
Member
|
@shanerbaner82 if this is ready for review, it should move out of Draft |
Contributor
Author
|
Closing in favor of #343 — same lifecycle foundations, without That flag is still a screen-wide one-shot boolean: it can eat the first mount frame, skip every poll in a tick, and let a child skip the root. Not safe to ship on this branch. skipRender can come back as a small follow-up once it has per-invocation provenance. Don't merge both. @simonhamp this was the one you pinged; #343 is the review target. |
shanerbaner82
added a commit
that referenced
this pull request
Aug 25, 2026
Component features split out of #342, excluding render suppression. Included: - ComponentMethodInvoker: a single DI-backed invocation path for component interactions, with implicit binding for routable models and backed enums, and lifecycle hooks protected from direct invocation. - ComponentRouteBinder: implicit route-model binding for components, matching Laravel's ImplicitRouteBinding including soft-deletable and child bindings. - ComponentEvent: dispatch()/emit() with #[On] listeners, self-targeting and class-targeted delivery. - ComponentState: shared property-sync pipeline with #[Locked] support and updated*/updating* hooks. - NativeRouter: match/resolve split so isNativeRoute() cannot throw, route-binding failures contained in the screen error lifecycle, and compiled route patterns retained across calls. - Mount dependency injection. - NativeTagPrecompiler: native:model resolves against view data, fixing bindings inside nested partials. - NativeServiceProvider: the HTTP fallback resolves the normalized request path. Excluded, and left on #342: - The #[Renderless] attribute and skipRender(). Both are new in #342 and have no counterpart on main, so nothing here restores or preserves prior behavior. They are held back because the one-shot, screen-wide render-suppression flag has no owner or scope, which produced repeated frame-suppression defects across four review rounds. That design is being resolved separately. Co-Authored-By: Claude Opus 5 (1M context) <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
This change gives native components one consistent path for method invocation, route binding, state mutation, render suppression, and component events.
It adds:
skipRender()and#[Renderless]native:modelcompilation through view data, including nested Blade partialsThis change intentionally does not introduce a form or data-validation API.
Public API examples
Route-bound mount dependencies
NativeComponentdeliberately does not declare a fixedmount()signature, so application components can define the parameters they need.Action dependencies
Protected poll callbacks with dependencies
Poll callbacks use the internal lifecycle invocation path, so they may remain protected while still receiving container dependencies.
Nested state hooks
Render suppression and component events
Safety and compatibility
navigate(),replace(),back(),exitToWeb(), andemit()remain accepted for existing applications; new navigation bindings should use@navigateTypeErrorcontractskipRender()remains authoritative#[Renderless]behaviorVerification
a54533e: PHP 8.4 tests, static analysis, and code style passedScope
The branch contains the feature foundation followed by three focused compatibility and regression-hardening commits. The scratch application and its Composer lockfile are intentionally not part of this repository diff.