Skip to content

Add captured-data React hydration and browser helpers - #26

Merged
dnnsjsk merged 8 commits into
mainfrom
feat/react-hydration
Oct 25, 2026
Merged

dnnsjsk merged 8 commits into
mainfrom
feat/react-hydration

Conversation

@dnnsjsk

@dnnsjsk dnnsjsk commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

@dnnsjsk
dnnsjsk merged commit 48bee84 into main Oct 25, 2026
@dnnsjsk
dnnsjsk deleted the feat/react-hydration branch October 25, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant