Repository navigation
Add captured-data React hydration and browser helpers - #26
Merged
Merged
Conversation
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.
Phasis can render React HTML, but consumers currently assemble hydration data and browser initialization themselves. Add an opt-in captured-data API and a Composer-shipped helper so server rendering and hydration use one immutable props snapshot and matching root/build/React identities.
The new path validates public JSON data before module execution, constructs the same React element on both sides, forwards identifier prefixes, supports named exports and class defaults, and reports transport errors while preserving server HTML. Existing rendering and PHP callable/object interop remain compatible. Element roots are qualified; full-document convenience transport and renderer nonce/CSP options are explicitly documented as unsupported.
Captured objects preserve every public JSON key. Guarded native-slot access keeps keys such as
[[PrimitiveValue]]from branding them as boxed/native values. The mechanical native-reader updates retain existing behavior for existing host objects and preserve proxy/accessor impurity. Runtime environment bindings retain their original accessors.The Composer distribution includes the ESM helper, declarations and usage guide. A real downstream archive install checks development/production React node reuse, connected imports/context/state, data mutation, identity failures, genuine React diagnostics, one React copy, and the declarations on PHP 8.2–8.5. Release download archives now use the same canonical runtime inventory.
The changelog prepares v0.10.0. Validation includes PHPStan, PHPCS, PHP/unit/oracle/JSX/WPT suites, PHP 8.5 tracing-JIT checks, the pinned test262 matrix, dependency audits and portable documentation checks.
Owner decision on 2026-10-25: framework compatibility must NEVER run in CI, including manual dispatches and release gates. Its run is cancelled, its workflow is disabled in GitHub Actions and removed from the repository, and repository/framework documentation records the permanent local-only policy. Merge and release explicitly do not require this cancelled check.