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

UHF-10752 Farewell chunks #1136

Merged
merged 7 commits into from
Dec 12, 2024
Merged

UHF-10752 Farewell chunks #1136

merged 7 commits into from
Dec 12, 2024

Conversation

khalima
Copy link
Contributor

@khalima khalima commented Dec 11, 2024

UHF-10752

What was done

  • Use splitChunks: false for npm run build
    • This won't actually do anything unless we explicitly try to use chunking
  • Converted async imports to static imports in nav-toggle.js.
    • If there are dynamic imports in any of the ./src/js/ files, Webpack will always create chunks, even if the splitChunks is set false. Dynamic imports are designed to create separate chunks by definition.
    • This should fix the chunk load errors, like: Loading chunk 305 failed. (error: hdbt/dist/js/async/toggleWidgets.chunk.js)

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-10752
  • Run make drush-cr

How to test

  • Check that the following functionalities still work in mobile and desktop.
    • Click on the search button, "other languages" button and menu button. Also test that the menu works as before. (notice that when the code works as it should, url does not change when clicking these buttons, url change is the fallback option)
      Keep the console open, so you'll see possible errors.
      image
  • Check that code follows our standards

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/1136/html_report/

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/1136/html_report/

Copy link
Contributor

@annadruid annadruid left a comment

Choose a reason for hiding this comment

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

Everything works as before and no errors in console!

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