chrisblakley / Nebula

Nebula is a WordPress theme framework that focuses on enhancing development. The core features of Nebula make it a powerful tool for designing, developing, and analyzing WordPress websites consistently, yet its deliberately uncomplicated code syntax also serves as a learning resource for programmers themselves.
https://nebula.gearside.com
GNU General Public License v2.0
139 stars 36 forks source link

Use the new WP core method of adding defer/async to JavaScript assets #2268

Open chrisblakley opened 7 months ago

chrisblakley commented 7 months ago

Nebula has a Rube Goldberg machine of a way to async/defer JavaScript assets, but now as of WP core 6.3 they are no longer needed. This will reduce the complexity of registering Nebula assets. However, some of the functionality will still be needed for module scripts and crossorigin assets, so we'll need to surgically remove the vestigial functionality.

Documentation for the new wp_register_script() function: https://make.wordpress.org/core/2023/07/14/registering-scripts-with-async-and-defer-attributes-in-wordpress-6-3/

Screen Shot 2023-11-13 at 4 33 01 PM

Screen Shot 2023-11-13 at 4 32 58 PM