Skip to content

fix: improve React diagnostic warning parity - #753

Merged
trueadm merged 2 commits into
octanejs:mainfrom
openai-oss-forks:fix/744-react-diagnostic-warning-parity
Aug 13, 2026
Merged

trueadm merged 2 commits into
octanejs:mainfrom
openai-oss-forks:fix/744-react-diagnostic-warning-parity

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add development-only React-compatible ARIA, CSS, Float resource, controlled-input, and delegated-listener diagnostics across client rendering, server rendering, streaming, and hydration.
  • Fix precedence stylesheet declassification for missing/empty href, loading handlers, and disabled={false}, and preserve both resources when an inline style collides with a stylesheet preload.
  • Move 26 React conformance ledger scenarios to covered, document two intentional kebab-case CSS divergences, and refresh the generated parity coverage and diagnostics inventory.

Refs #744.

Why

  • Unsupported ARIA names, malformed CSS declarations, and invalid Float resource combinations previously failed silently, while invalid stylesheet classifications could hoist or discard authored nodes.
  • The diagnostics must explain Octane's actual contracts, preserve existing DOM/SSR behavior, and disappear completely from optimized production bundles.

Changes

  • Add deduplicated ARIA 1.3/name/casing validation for static, dynamic, spread, SVG, server, streaming, and hydration hosts while preserving custom-element semantics.
  • Validate malformed vendor prefixes, trailing semicolons, NaN, Infinity, and failed CSS coercion, including fully static and mixed declarations; preserve single getter/coercion evaluation and Octane's supported kebab-case/cssText authoring.
  • Declassify conflicting stylesheet resources, diagnose preload/style collisions and whitespace-bearing server style keys, and retain valid resource hoisting and production compiler fast paths.
  • Extend invalid capture/replacement listener coverage and controlled-input falsy-value/read-only/disabled/uncontrolled negative controls.
  • Add an octane patch changeset and production-bundle sentinel coverage for every new warning family.

Validation

  • pnpm format:check (repository-wide formatting not run; all 21 changed files passed scoped formatting)
  • pnpm typecheck (full 276-project workspace check not run; core source, changed-file, and typetest projects passed)
  • pnpm test (all workspace/package projects not run)
  • pnpm --config.verify-deps-before-run=false sync
  • pnpm --config.verify-deps-before-run=false format:files:check <21 changed files>
  • ./node_modules/.bin/tsgo --noEmit -p packages/octane/tsconfig.json
  • ./node_modules/.bin/tsgo --noEmit -p packages/octane/typetests/tsconfig.json
  • pnpm --config.verify-deps-before-run=false typecheck:files <4 changed runtime source files>
  • ./node_modules/.bin/vitest run --project octane --project octane-prod --silent=passed-only — 839 files and 12,610 tests passed
  • node scripts/react-parity/check.mjs --validate-only
  • node --test scripts/react-parity/inventory-lib.test.mjs — 26 tests passed
  • node scripts/check-changesets.js
  • node scripts/error-codes/generate.mjs --check, node scripts/check-test-markers.mjs, and node scripts/check-tsrx-module-decls.mjs
  • Production minified client/server bundles exclude every new ARIA, CSS, and Float warning string; measured total runtime delta: approximately +24 B client and +83 B server.

Risk / follow-ups

  • Invalid values supplied through a dynamic stylesheet href retain the existing static-plan limitation; preserving authored inline position would require a separate dual-path compiler/runtime design.
  • Broader unknown-property, controlled/default-value conflict, nesting/hydration matrix, and preload/preinit conflict audits remain explicitly tracked in docs/react-diagnostics-plan.md.
  • Octane intentionally accepts kebab-case CSS property names and complete CSS strings; those React warning scenarios are documented divergences rather than regressions.

Provenance

  • An agent produced this diff (agent-authored)

Note

Medium Risk
Touches core DOM attribute/style serialization, Float resource hoisting/deduping, and preload coalescing on client and server; behavior is mostly additive dev warnings but invalid precedence links and preload/style identity changes affect head output.

Overview
Adds development-only diagnostics aligned with React for ARIA naming, inline CSS, controlled inputs, invalid event listeners, and Float stylesheet/style resources—wired through client, SSR, streaming, and hydration, with conformance tests and ledger updates. Production builds strip these warning strings.

ARIA (aria-diagnostics.ts): validates recognized ARIA 1.3 names, unknown aria-*, camelCase/miscasing, grouped plural messages, bare aria, and module-level dedupe; custom elements stay exempt. Compiler dev paths validate static ARIA literals instead of baking them away.

CSS (css.ts, runtimes, compiler): warns on miscased vendor prefixes, trailing semicolons in values, NaN/Infinity, and failed coercion—without changing serialization. Static/mixed style literals that need validation bypass compile-time baking in dev. Intentional divergence: no warnings for supported kebab-case keys or full cssText strings.

Float resources: precedence <link rel="stylesheet"> with missing/empty href, load/error handlers, or disabled (including false) stays inline with dev errors instead of hoisting; preload vs inline <style> collisions and whitespace in server style href get diagnostics; inline styles no longer incorrectly consume external stylesheet preloads.

Forms & events: falsy controlled values without onInput; read-only/disabled/uncontrolled negatives stay silent; capture listener and valid↔invalid replacement cases covered.

Docs/changeset refresh the diagnostics plan and move many React conformance cases to covered or documented divergence.

Reviewed by Cursor Bugbot for commit ab11783. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Aug 13, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 8dd61e3. Configure here.

Comment thread packages/octane/src/runtime.ts Resolved
@trueadm
trueadm marked this pull request as ready for review August 13, 2026 20:56
@trueadm
trueadm merged commit 9efd6f4 into octanejs:main Aug 13, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants