Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the 'async-defer' load method #63

Open
goodguyry opened this issue Apr 30, 2024 · 0 comments
Open

Remove the 'async-defer' load method #63

goodguyry opened this issue Apr 30, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request php Requires understanding PHP

Comments

@goodguyry
Copy link
Member

goodguyry commented Apr 30, 2024

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

Both of these attributes have > 98% global browser support

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.
@kevinfodness kevinfodness changed the title Consider removing the 'async-defer' load method Remove the 'async-defer' load method Aug 21, 2024
@kevinfodness kevinfodness added enhancement New feature or request php Requires understanding PHP labels Aug 21, 2024
@mslinnea mslinnea self-assigned this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

No branches or pull requests

3 participants