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

Avoid precompiling assets unnecessarily #11847

Merged
merged 3 commits into from
Nov 23, 2023

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Nov 23, 2023

What? Why?

We had two calls to pre-compile assets. One for all specs and one for system specs only. So assets got compiled for lib specs which don't need it and they were compiled twice for system specs.

I removed the duplication and added some logic to compile assets only for specs that need it.

What should we test?

  • Specs only.
  • I checked that only controller, mailer, request, system and view specs compile assets.
  • All other specs pass without compilation even after public/packs-test/ was deleted.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@mkllnk mkllnk self-assigned this Nov 23, 2023
This helper file is only loaded when system specs are loaded. So we
don't need to check for the absence of system specs because this file
wouldn't be loaded if there were not system specs to be run.
We had two calls to precompile assets, one for all specs and then a
second one just for system specs. The one for system specs is better
because it checks for the webpack dev server before compiling assets. So
let's use just that one.
@mkllnk mkllnk changed the title Avoid precompiling assets unnecessary Avoid precompiling assets unnecessarily Nov 23, 2023
@mkllnk mkllnk added the technical changes only These pull requests do not contain user facing changes and are grouped in release notes label Nov 23, 2023
@mkllnk mkllnk marked this pull request as ready for review November 23, 2023 06:40
Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Perfect! 👌

@dacook dacook merged commit 907d559 into openfoodfoundation:master Nov 23, 2023
50 checks passed
@mkllnk mkllnk deleted the spec-opt branch November 24, 2023 04:24
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
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants