alleyinteractive / alleyinteractive/wp-asset-manager
Remove the `'async-defer'` load method
- Vorherrschende Sprache
- PHP
- Sterne
- 30
- Forks
- 5
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### Description
The `'async-defer'` load method adds both `async` and `defer` attributes to the script tag.
When both attributes are set, `async` takes precedence.
> For classic scripts, if the `async` attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available (potentially before parsing completes). **If the `async` attribute is not present** but the `defer` attribute is present, then the classic script will be fetched in parallel and evaluated when the page has finished parsing. If neither attribute is present, then the script is fetched and evaluated immediately, blocking parsing until these are both complete. [emphasis mine]
> The `defer` attribute may be specified even if the `async` attribute is specified, to cause legacy web browsers that only support `defer` (and not `async`) to fall back to the `defer` behavior instead of the blocking behavior that is the default.
[source](https://html.spec.whatwg.org/multipage/scripting.html#attr-script-defer)
Both of these attributes have > 98% global browser support
* [async attribute](https://caniuse.com/script-async)
* [defer attribute](https://caniuse.com/script-defer)
Based on global browser support, there doesn't appear to be a use-case for setting both attributes on any given script tag and we can safely deprecate/remove the `async-defer` load method option.
# Acceptance Criteria
- Remove support for the `async-defer` method.
- Bump the plugin version to v2.0.0 since this is a breaking change.
- Add to the release notes that support for this method has been removed, and that users should use `async` instead.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.