[wp-trac] [WordPress Trac] #61044: Interactivity API: Debug - Warning about Server Directives Processing errors.

WordPress Trac noreply at wordpress.org
Wed May 22 20:12:25 UTC 2024


#61044: Interactivity API: Debug - Warning about Server Directives Processing
errors.
-------------------------------+---------------------------
 Reporter:  cbravobernal       |       Owner:  cbravobernal
     Type:  enhancement        |      Status:  assigned
 Priority:  normal             |   Milestone:  6.6
Component:  Interactivity API  |     Version:  6.5
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:
-------------------------------+---------------------------
Changes (by cbravobernal):

 * owner:  (none) => cbravobernal
 * status:  new => assigned


Old description:

> == What problem does this address?
>
> Right now, if there is an error during the server directives processing,
> there is no way to determine that the error occurred. There is only a
> layout shift (a brief screen flash) when loading the website, and if the
> developer has a fast connection or a fast local environment, it is really
> hard to notice.
>

> == What is your proposed solution?
> If debugging is enabled, the client could send a console error if the
> source differs from the virtual DOM, or the server could send a PHP
> warning notice if the server directive processing is aborted (due to
> malformed HTML or unsupported tags).

New description:

 This PR aims to improve the developer experience of the Interactivity API
 server directives processing.
 Right now, the SSR won't work if there is any directive inside a SVG or
 MATHML tag. Or the HTML is unbalanced (there is some closer tag missing).

 This PR adds a warning in those cases, if the developer is in debug mode.

 I added also notices for cases where the directive is empty, or the
 namespace is an empty string, an empty object or null.

 [[Image(https://github.com/WordPress/wordpress-develop/assets/37012961
 /1eb1adec-d99f-42ed-a0d1-5a635cf4001a)]]

 [[Image(https://github.com/WordPress/wordpress-
 develop/assets/37012961/1d8e3d17-0696-4ad6-abb5-fcad059e8562)]]

 [[Image(https://github.com/WordPress/wordpress-develop/assets/37012961
 /c5b0f34a-47b3-40f9-8ced-68ee3702b062)]]

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61044#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list