Skip to content

React admin scoping, WordPress Interactivity API, full WooCommerce integration + 14 audit fixes - #1

Merged
akshat009 merged 1 commit into
mainfrom
feat/react-interactivity-woocommerce
Aug 17, 2026
Merged

React admin scoping, WordPress Interactivity API, full WooCommerce integration + 14 audit fixes#1
akshat009 merged 1 commit into
mainfrom
feat/react-interactivity-woocommerce

Conversation

@akshat009

@akshat009 akshat009 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Three rounds of work on this branch, all verified end-to-end (not just unit-tested):

1. Fixed 14 findings from a detailed audit

  • React build pipeline silently failed (missing --webpack-src-dir)
  • CI's npm ci had no lockfile to consume → npm install
  • composer.json's version field failed composer validate --strict
  • PHP 8.4 implicit-nullable deprecation in Plugin.php
  • Elementor add_action hooks moved from build_services() to boot() so a DI-injected $services array still registers them
  • get_instance() now threads its $services param through (was dead code)
  • validateNamespace allows Vendor\Plugin namespaces
  • validatePrefix rejects reserved words (wp, php, wordpress)
  • validateOutputDir allows paths outside cwd (e.g. ../sibling-plugin)
  • phpcs.xml prefix/VIP-exclude rules are now real template placeholders instead of fragile exact-string runtime patching
  • dead ternaries removed; runGenerator throws instead of process.exit
  • added .distignore template

2. React rescoped to wp-admin + new Interactivity API module

  • React admin app pipeline now targets wp-admin only (Assets.php on admin_enqueue_scripts, auto-scoped to the settings page hook suffix when admin_settings is also selected), mounting a real interactive component instead of a no-op console.log
  • New interactivity module: WordPress's native Interactivity API (data-wp-interactive directives, Script Modules) for real frontend interactivity without shipping a React runtime to visitors
  • Requires at least auto-bumps to 6.5 when this module is selected

3. WooCommerce module now scaffolds a full, working integration

  • Payment gateway (classic checkout and WooCommerce Blocks payment method registration — without this a gateway is invisible in the block-based checkout)
  • Shipping method, custom order email (with its own template files), custom product type, HPOS compatibility
  • Cart & Checkout Blocks content integration via ExperimentalOrderMeta
  • A real native Gutenberg block (assets/src/blocks/cart-summary) showing a live cart summary, auto-discovered by wp-scripts
  • webpack.config.js now correctly merges wp-scripts' lazily-computed entry function with our own explicit entries — spreading it as a plain object ({ ...defaultConfig.entry }) silently drops every auto-discovered block entry. Found and fixed during testing.
  • Requires at least auto-bumps to 6.4 (block.json render field)

Verification

  • 20 regression tests (up from 7) — all passing
  • Real php -l, composer validate --strict, composer lint (WPCS, zero errors), composer test against multiple generated fixtures
  • Real npm install && npm run build confirming the admin app, Interactivity view script, WooCommerce gateway block, Blocks integration script, and native Cart Summary block all compile together correctly

…dd Interactivity API + full WooCommerce integration

Bug fixes (all verified with real composer install/lint/test):
- React build pipeline silently failed (missing --webpack-src-dir)
- CI's npm ci had no lockfile to consume -> npm install
- composer.json version field failed composer validate --strict
- PHP 8.4 implicit-nullable deprecation in Plugin.php constructor
- Elementor add_action hooks moved from build_services() to boot() so
  DI-injected  still registers them
- get_instance() now threads its  param through (was dead code)
- validateNamespace allows Vendor\Plugin namespaces
- validatePrefix rejects reserved words (wp, php, wordpress)
- validateOutputDir allows paths outside cwd (e.g. ../sibling-plugin)
- phpcs.xml prefix/VIP-exclude rules are now real template placeholders
  instead of fragile exact-string runtime patching
- dead ternaries removed; runGenerator throws instead of process.exit
- added .distignore template

React scope correction:
- React admin app pipeline now targets wp-admin only (Assets.php on
  admin_enqueue_scripts, auto-scoped to the settings page hook suffix
  when admin_settings is also selected), mounting a real interactive
  component instead of a no-op console.log
- new 'interactivity' module: WordPress's native Interactivity API
  (data-wp-interactive directives, Script Modules) for real frontend
  interactivity without shipping a React runtime to visitors

WooCommerce module now scaffolds a full, working integration:
- Payment gateway (classic checkout + WooCommerce Blocks payment method
  registration, so it isn't invisible in the block-based checkout)
- Shipping method, custom order email (with its own template files),
  custom product type, HPOS compatibility
- Cart & Checkout Blocks content integration via ExperimentalOrderMeta
- a real native Gutenberg block (assets/src/blocks/cart-summary) showing
  a live cart summary, auto-discovered by wp-scripts
- webpack.config.js now correctly merges wp-scripts' lazily-computed
  entry *function* with our own explicit entries -- spreading it as a
  plain object ({ ...defaultConfig.entry }) silently drops every
  auto-discovered block entry, which was caught and fixed during testing

Requires-at-least bumps automatically: 6.4 for the block.json render
field (WooCommerce module), 6.5 for the Interactivity API.

20 regression tests (up from 7), plus manual end-to-end verification:
php -l, composer validate --strict, composer lint, composer test, and
real npm install && npm run build against multiple fixture combinations.
@akshat009
akshat009 merged commit 6c0ba4a into main Aug 17, 2026
2 checks passed
@akshat009
akshat009 deleted the feat/react-interactivity-woocommerce branch August 17, 2026 14:35
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