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

Footer Js libraries should not have dependencies to header libraries #1049

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

hyrsky
Copy link
Contributor

@hyrsky hyrsky commented Sep 19, 2024

UHF-0000

What was done

  • Js libraries are broken in etusivu test for anonymous users. I believe this should fix the issue.

Core moves dependencies of header library to header. However, this does not appear to happen the other way, dependencies of footer libraries are not moved to the footer. JsAssetController loads only the libraries in current scope (header or footer). If some dependencies are missing, the asset hashes do not match, and the asset controller triggers a redirect response. Redirect response paths do not go through hook_file_url, so our proxy settings don't get triggered.

How to install

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the HDBT theme
    • composer require drupal/hdbt:dev-UHF-X-footer-js-libraries
  • Run make drush-cr

How to test

  • Check that all Js loads correctly
  • Check that code follows our standards

Continuous documentation

  • This feature has been documented/the documentation has been updated
  • This change doesn't require updates to the documentation

Translations

  • Translations have been added to .po -files and included in this PR

Other PRs

  • Link to other PR

Copy link

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/1049/html_report/

Copy link
Contributor

@khalima khalima left a comment

Choose a reason for hiding this comment

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

Mental note was written of this, thanks! And good catch 🦜 !

@hyrsky hyrsky merged commit fc44128 into main Sep 19, 2024
2 checks passed
@hyrsky hyrsky deleted the UHF-X-footer-js-libraries branch September 19, 2024 13:24
hyrsky added a commit to City-of-Helsinki/drupal-helfi-etusivu that referenced this pull request Oct 3, 2024
While debugging
City-of-Helsinki/drupal-hdbt#1049, I had a
breakpoint on hook_file_url_alter(), and noticed that paragraph
rendering causes a lot of invocations. I don't think this is a real
issue, but it is still not best practice.
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.

2 participants