Make WordPress Core

Opened 5 weeks ago

Last modified 24 hours ago

#61044 assigned enhancement

Interactivity API: Debug - Warning about Server Directives Processing errors.

Reported by: cbravobernal's profile cbravobernal Owned by: cbravobernal's profile cbravobernal
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.5
Component: Interactivity API Keywords: has-patch
Focuses: Cc:

Description (last modified by cbravobernal)

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.

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

https://github.com/WordPress/wordpress-develop/assets/37012961/1d8e3d17-0696-4ad6-abb5-fcad059e8562

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

Change History (7)

This ticket was mentioned in PR #6413 on WordPress/wordpress-develop by @cbravobernal.


5 weeks ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/61044

Draft PR. Is still work in progress.

#2 @cbravobernal
3 weeks ago

  • Milestone changed from Awaiting Review to 6.6
  • Type changed from defect (bug) to enhancement

#3 @jonsurrell
3 weeks ago

  • Component changed from General to Interactivity API

#4 @gziolo
2 weeks ago

  • Version set to 6.5

@cbravobernal commented on PR #6413:


2 weeks ago
#5

I think the messages could be a bit more brief (#6413 (review)) but this is working well generally. Thanks!

Done in https://github.com/WordPress/wordpress-develop/pull/6413/commits/4b78690b19728bab8cf9b69c6eca0178bb0c3987

@cbravobernal commented on PR #6413:


34 hours ago
#6

I'm adding more checks to the SSR processing. Now it will also check that the namespace is not {}, "" "empty string", or null written as a string.
That way it won't cause weird behaviors in the runtime.

#7 @cbravobernal
24 hours ago

  • Description modified (diff)
  • Owner set to cbravobernal
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.