-
Notifications
You must be signed in to change notification settings - Fork 145
Update Cache Busting Key for Core Merge #8294
Description
Is your feature request related to a problem? Please describe.
Presently, the WooCommerce Admin version number is used as the key when cache busting assets. However, with the upcoming merge to Core, WooCommerce Admin will no longer have a version number.
Describe the solution you'd like
Switch to using the Core version number for cache busting by using the WC_VERSION constant instead of WC_ADMIN_VERSION_NUMBER.
Describe alternatives you've considered
n/a
Should this be prioritized? Why?
Yes, merge is happening soon.
Additional context
I'm aware of the following areas of code needing to be updated:
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Products.php
Lines 107 to 113 in f841292
| wp_enqueue_script( | |
| 'onboarding-product-notice', | |
| Loader::get_url( 'wp-admin-scripts/onboarding-product-notice', 'js' ), | |
| array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ), | |
| WC_ADMIN_VERSION_NUMBER, | |
| true | |
| ); |
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Products.php
Lines 135 to 141 in f841292
| wp_enqueue_script( | |
| 'onboarding-product-import-notice', | |
| Loader::get_url( 'wp-admin-scripts/onboarding-product-import-notice', 'js' ), | |
| array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ), | |
| WC_ADMIN_VERSION_NUMBER, | |
| true | |
| ); |
woocommerce-admin/src/Features/OnboardingTasks/Tasks/Appearance.php
Lines 114 to 121 in f841292
| wp_enqueue_script( | |
| 'onboarding-homepage-notice', | |
| Loader::get_url( 'wp-admin-scripts/onboarding-homepage-notice', 'js' ), | |
| array_merge( array( WC_ADMIN_APP ), $script_assets ['dependencies'] ), | |
| WC_ADMIN_VERSION_NUMBER, | |
| true | |
| ); | |
| } |
woocommerce-admin/src/Loader.php
Lines 290 to 295 in 28621d2
| public static function get_file_version( $ext ) { | |
| if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { | |
| return filemtime( WC_ADMIN_ABSPATH . self::get_path( $ext ) ); | |
| } | |
| return WC_ADMIN_VERSION_NUMBER; | |
| } |