[wp-trac] [WordPress Trac] #48654: Consider a solution/endpoint to lazy-load scripts and styles

WordPress Trac noreply at wordpress.org
Mon Apr 6 01:53:09 UTC 2020


#48654: Consider a solution/endpoint to lazy-load scripts and styles
-------------------------------------------------+-------------------------
 Reporter:  youknowriad                          |       Owner:  (none)
     Type:  feature request                      |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-unit-   |     Focuses:
  tests                                          |  javascript, rest-api
-------------------------------------------------+-------------------------

Comment (by dufresnesteven):

 With regards to lazy-loading, it won't change much in terms of the Block
 Directory Package seeing that assets are only loaded after user
 interaction and therefore technically only loaded when necessary. However,
 this will definitely be useful as we are looking for a better way to
 retrieve new block assets.

 I don't quite understand what the plan is for 'lazy-loading' the assets
 (maybe the discussion hasn't happened yet).

 Do we plan on using this for all installed blocks maybe?

 Case A:
 1. Page is loaded ( with critical dependencies )
 2. Block assets are lazily loaded with Priority
  - Priority 1:
   - Blocks used in post/page
  - Priority 2:
   - All the other blocks?

 Case B:
 1. Page is loaded  ( with critical dependencies )
 2. Loads assets for blocks used in post/page
 3. On Inserter open, load remain block assets.

 Case C:
 1. Page is loaded  ( with critical dependencies )
 2. Loads assets for blocks used in post/page
 3. Inserter opened
 4. On Inserter interaction (Maybe hovering on icon, viewing category,
 etc...), load block assets.

 ... many other strategies..

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


More information about the wp-trac mailing list