WordPress.org

Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #12009, comment 75


Ignore:
Timestamp:
04/12/2020 12:11:59 AM (12 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12009, comment 75

    v2 v3  
    27272. Scripts with `defer` can be added to Script Loader but will need some additional logic when processing the dependencies.
    2828 - It doesn't make sense to add `defer` to the default scripts that may be used as dependencies (that's most of them). The reason is that in production where scripts are concatenated `defer` can only be used when all concatenated scripts have it.
    29  - Default scripts that are not used as dependencies can have `defer`. However they cannot be concatenated, will have to be outputted separately.
     29 - Default scripts that are not used as dependencies can have `defer`. However they either have to be concatenated separately, or outputted individually.
    3030 - Scripts added by plugins can have `defer` if they are not used as dependencies, or when all of their dependencies also have `defer`.
    3131 - The inline scripts that are outputted "after" will also need the `defer` attribute. It would be nice to also add `defer` to the "before" scripts but that's not critical.