[wp-trac] [WordPress Trac] #55513: Allow registration of blocks containing scripts / styles that need to get enqueued from within a Theme

WordPress Trac noreply at wordpress.org
Mon May 9 10:23:10 UTC 2022


#55513: Allow registration of blocks containing scripts / styles that need to get
enqueued from within a Theme
-------------------------------------------------+---------------------
 Reporter:  fabiankaegy                          |       Owner:  gziolo
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.0
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-docs  |     Focuses:
-------------------------------------------------+---------------------

Comment (by fabiankaegy):

 @matveb I've elaborated a bit more here in the DEV Note:
 https://make.wordpress.org/core/2022/05/03/block-editor-miscellaneous-dev-
 notes-for-wordpress-6-0/#blocks-in-themes and in the original discussion
 during the developer hours.

 Essentially it comes down to two things:

 - When building completely custom solutions that don't use custom layout
 systems that don't use the core columns block for example but instead
 custom grid systems that are very deeply engrained with the themes custom
 CSS the markup is so deeply engrained with the styling that the content
 does not make sense without the theme.

 - In these instances there are additional overheads that come from
 building and deploying them in custom plugins.


 As the DEV Note hopefully brings across I very firmly believe the the best
 practice should always be to build blocks in plugins and that it is the
 best option for the vast majority of options. However through talking with
 the wider community we found several instances of the hacky solutions to
 allow for the registration of blocks from within themes which are error
 prone. Therefore this patch was added to make it easier for these valid
 use cases whilst not changing the best practice.

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


More information about the wp-trac mailing list