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

Move images out of webpack #13118

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

dacook
Copy link
Member

@dacook dacook commented Feb 3, 2025

What? Why?

As Maikel suggested:

I think we shouldn't need images to be loaded by webpack. This will simplify the transition away from webpack.

I also tried to move the fonts but got stuck.

I have to confess I don't think I fully understood how it all hooks together, but it seems to be working!

What should we test?

This reverts some of #7784

So similar to that, test that images load, on some shop and admin screens.

I've checked this on au_staging.

@dacook

This comment was marked as outdated.

Webpacker still needs to know about them in order to build links.
png sprites? That was a flashback..
@sigmundpetersen

This comment was marked as resolved.

@dacook

This comment was marked as resolved.

@dacook dacook force-pushed the 10298-move-images-out-of-webpacker branch from 3c17296 to 4ee35fc Compare February 3, 2025 23:19
@dacook dacook added the pr-staged-au staging.openfoodnetwork.org.au label Feb 3, 2025
@dacook dacook marked this pull request as ready for review February 3, 2025 23:55
@dacook dacook added technical changes only These pull requests do not contain user facing changes and are grouped in release notes and removed pr-staged-au staging.openfoodnetwork.org.au labels Feb 3, 2025
@dacook dacook changed the title 10298 move images out of webpacker Move images out of webpack Feb 4, 2025
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Excellent! I just found one typo.

It would be good to know if it breaks!
I didn't think it worth updating every single settings specs to test for this...
But I've tested on the 'general settings' page because this is the default page when clicking on 'Configuration'.
This code was waiting up to 20 seconds, but only checking every two seconds, which means it could be wasting up to 2s everytime it runs.
Instead, we can use Capybara's waiting mechanism, which by default waits up to 20 seconds (but no doubt is optimised to be much more responsive).
@dacook dacook force-pushed the 10298-move-images-out-of-webpacker branch from b03687f to c29b15d Compare February 12, 2025 04:11
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Nice testing!

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Nice one !

@drummer83 drummer83 self-assigned this Feb 17, 2025
@drummer83 drummer83 added the pr-staged-uk staging.openfoodnetwork.org.uk label Feb 17, 2025
@drummer83
Copy link
Contributor

Hi @dacook,
I've tested this on Staging UK and indeed, there are some images not loading:
grafik

grafik

grafik

Notes for further testing:

  • Icons (front and back end)
  • Fonts (front and back end)
  • Emails

I will move this back to In Progress. Let me know if this is a configuration thing or anything I can do to fix it.

Thanks!

@drummer83 drummer83 removed their assignment Feb 17, 2025
@drummer83 drummer83 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Feb 17, 2025
@drummer83
Copy link
Contributor

The logo in emails also seems to be broken.

@dacook dacook added the pr-staged-au staging.openfoodnetwork.org.au label Feb 18, 2025
@dacook dacook added the pr-staged-fr staging.coopcircuits.fr label Feb 18, 2025
@dacook dacook marked this pull request as draft February 19, 2025 00:13
@dacook
Copy link
Member Author

dacook commented Feb 19, 2025

Thanks Konrad, it turns out my changes only work in a dev environment.

I'm still not fully understanding this, and it looks like perhaps I need to move the fonts and CSS in the same PR..

@dacook dacook added pr-staged-au staging.openfoodnetwork.org.au pr-staged-fr staging.coopcircuits.fr and removed pr-staged-au staging.openfoodnetwork.org.au pr-staged-fr staging.coopcircuits.fr labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical changes only These pull requests do not contain user facing changes and are grouped in release notes
Projects
Status: In Progress ⚙
Development

Successfully merging this pull request may close these issues.

5 participants