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

Account for block styles with relative CSS URLs #119

Merged
merged 6 commits into from
Sep 10, 2024
Merged

Conversation

kasparsd
Copy link
Owner

  • Remove async JS script loader for external scripts because we can't reliably determine if the script is external.
  • Update the asset file path extractor to support paths relative to ABSPATH as used by block assets, for example.

return false;
}
// Inline block scripts are sometimes relative URLs.
if ( 0 === strpos( $item_url, '/' ) ) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will return false positives for URLs without protocol, though such as //example.com/....


$script_relative_path = $this->get_asset_relative_path( $handle );

if ( ! $script_relative_path ) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't correctly determining if the asset has URL and is not part of the generated bundles. Need to make it more deterministic if we want to add it back.

@kasparsd kasparsd merged commit 504c39d into master Sep 10, 2024
@kasparsd kasparsd deleted the fix-fse-use branch September 10, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant