WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #48154, comment 23


Ignore:
Timestamp:
01/22/2020 10:58:57 PM (23 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #48154, comment 23

    initial v1  
    33As this changes script-loader there are few more considerations:
    44- It's not a good idea to have a bunch of (around 80) files be included on each WP run. It's true, `include()` is pretty fast in PHP, but what's the purpose of including these files separately in production? What is fixed or enhanced by that? These files can be present in /src if need be, but should not exist in /build.
    5 - In script-loader the version string is only used to "bust cache" when a js or css file changes between different WP versions. Having separate "cache-busting" strings for `*.js` and *.min.js` doesn't make sense. In addition the current "cache-busting" strings seem needlessly long. Ideally the current WP version would be used when adding or changing a js or css file. This also removes the expectation that a particular file's version can be retrieved by looking at script-loader (that is incorrect in many cases). Alternatively the "cache-busting" (version) should be set to `false` which will use the current WP version.
     5- In script-loader the version string is only used to "bust cache" when a js or css file changes between different WP versions. Having separate "cache-busting" strings for `*.js` and `*.min.js` doesn't make sense. In addition the current "cache-busting" strings seem needlessly long. Ideally the current WP version would be used when adding or changing a js or css file. This also removes the expectation that a particular file's version can be retrieved by looking at script-loader (that is incorrect in many cases). Alternatively the "cache-busting" (version) should be set to `false` which will use the current WP version.
    66- The addition of `assets` sub-directory in `wp-includes` seems a bit misleading/confusing. The name `assets` is widely used on the web, with different context. Best to rename it imho.
    77