[wp-trac] [WordPress Trac] #59168: Block API: Unnecessary JSON decoding in block parser

WordPress Trac noreply at wordpress.org
Fri Sep 15 14:55:59 UTC 2023


#59168: Block API: Unnecessary JSON decoding in block parser
--------------------------+--------------------------
 Reporter:  dlh           |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.4
Component:  Editor        |     Version:  5.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------

Comment (by dlh):

 Thanks for the review, @dmsnell!

 I wondered the same thing about the use of `true` as I went through the
 old PRs. Given that the current code has been in place since the merge
 into core, I figured the ship had sailed.

 I'm happy to try to update the spec parser, but I'm not familiar with it.
 Can you provide a little more guidance about what needs to be updated?

 Removing the use of `$empty_attrs` seems a little more questionable to me.
 It's a public property on a non-final class, and the `block_parser_class`
 filter makes it possible to use an extended version of that class that
 depends on the property. Arguably, both removing the use of the property
 within the class and removing the property itself are backwards-
 incompatible changes. If nothing else, the property still provides the
 code a bit of a semantic boost.

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


More information about the wp-trac mailing list