[wp-trac] [WordPress Trac] #58517: HTML API: Introduce HTML Processor, a higher-level partner to the Tag Processor

WordPress Trac noreply at wordpress.org
Fri Sep 22 21:43:16 UTC 2023


#58517: HTML API: Introduce HTML Processor, a higher-level partner to the Tag
Processor
----------------------------------------+------------------------------
 Reporter:  dmsnell                     |       Owner:  Bernhard Reiter
     Type:  enhancement                 |      Status:  reopened
 Priority:  normal                      |   Milestone:  6.4
Component:  HTML API                    |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-unit-tests 2nd-opinion  |     Focuses:
----------------------------------------+------------------------------

Comment (by azaozz):

 Replying to [comment:16 westonruter]:

 > How is JavaScript faster? By doing HTML manipulation via PHP on the
 server, there would be no need to ship any JS, meaning much faster client-
 side performance in all the CWV metrics. And when using page caching, no
 difference in terms of TTFB.

 Thinking you're perhaps considering only very simple examples here. The
 PHP manipulations of a long(er) HTML strings would likely slow down
 significantly. Perhaps try testing with 10KB, 100KB and 500KB strings.
 Comparing that with (native) browser DOM manipulations, it would be slower
 in most cases, with some exceptions (low memory in PHP will likely result
 in a fatal error, low browser memory will likely result in excessively
 sluggish performance, etc.).

 > I definitely think WP does need this, because the server-side
 alternatives are much worse in terms of performance or
 security/reliability: DOMDocument and RegEx.

 Uh, not talking about these at all. I believe all "HTML manipulations"
 should be done using the browser's DOM, see above. This is by far the
 better way, and also the most future-proof and bugs/edge cases free.

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


More information about the wp-trac mailing list