Skip to content

Build: Avoids rebuilding Backoffice unless it is required#19189

Merged
iOvergaard merged 1 commit intocontribfrom
feature/build-staticassets-on-demand
Apr 29, 2025
Merged

Build: Avoids rebuilding Backoffice unless it is required#19189
iOvergaard merged 1 commit intocontribfrom
feature/build-staticassets-on-demand

Conversation

@iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Apr 29, 2025

Description

Some people have noticed how the Backoffice seems to build even though no files are changed. Our theory is that this happens simply because there are too many input files to consider for the MSBuild target.

In v13, the StaticAssets build was only triggered by the existence of either the output folder or a preserve.* marker file. Here, we also check for the node_modules/.package-lock.json file before reinstalling npm dependencies. Additionally, we now only run npm install rather than npm ci to optimise the build.

As an aide, you can check how it was done in V13 here: https://github.com/umbraco/Umbraco-CMS/blob/v13/dev/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj

How to test

  1. Check out this branch
  2. Run dotnet clean or Clean Solution
  3. Run dotnet run
  4. Check that both the Login as well as the Backoffice UI are shown and working
  5. Shut down the server and run it again
  6. Verify that none of the client builds are running (e.g., it will be fast to start up again)
  7. Run dotnet clean again
  8. Verify that the output folders disappear (staticassets/wwwroot/backoffice and login)
  9. Run dotnet run again
  10. Verify that the output folders once again are built and work

Hint: You can CD into the Umbraco.Cms.StaticAssets directory and run dotnet build -v diag --no-dependencies and check the logged messages. It should say that the builds were skipped:

image

…sets

In v13, the StaticAssets build was only triggered based on the existence of either the output folder or a preserve.* marker file. Here, we also additionally check for the node_modules/.package-lock.json file before reinstalling npm dependencies. We also now only run `npm install` rather than `npm ci` to optimise the build.
Copilot AI review requested due to automatic review settings April 29, 2025 09:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj: Language not supported

@iOvergaard iOvergaard changed the title build: restores some of the behavior from V13 in relation to StaticAssets Build: Avoids rebuilding Backoffice unless it is required Apr 29, 2025
Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

I've tested this out as per the instructions and looks to work as described. I get a quick restart between the dotnet clean operations, and the login and backoffice are built and run as expected.

@iOvergaard iOvergaard merged commit 38e9781 into contrib Apr 29, 2025
22 checks passed
@iOvergaard iOvergaard deleted the feature/build-staticassets-on-demand branch April 29, 2025 11:04
iOvergaard added a commit that referenced this pull request Apr 29, 2025
…sets (#19189)

In v13, the StaticAssets build was only triggered based on the existence of either the output folder or a preserve.* marker file. Here, we also additionally check for the node_modules/.package-lock.json file before reinstalling npm dependencies. We also now only run `npm install` rather than `npm ci` to optimise the build.
iOvergaard added a commit that referenced this pull request Apr 29, 2025
…sets (#19189)

In v13, the StaticAssets build was only triggered based on the existence of either the output folder or a preserve.* marker file. Here, we also additionally check for the node_modules/.package-lock.json file before reinstalling npm dependencies. We also now only run `npm install` rather than `npm ci` to optimise the build.
madsrasmussen added a commit that referenced this pull request May 1, 2025
…#19201)

* Incorrect forum and security urls when raising issue (#19080)

* Add 'ManifestWithDynamicConditions' to ManifestHeaderApp so Header Apps can be conditionally shown/loaded (#19124)

* V15 QA Added acceptance tests for bulk trash dialog (#19125)

* Added tests for bulk trash content dialog

* Updated tests for trash content dialog

* Added tests for trash and bulk trash media dialog

* Moved trash content tests into a folder

* Bumped version

* Make trash tests run in the pipeline

* Make trash tests run in the pipeline

* Fixed comments

* Reverted npm command

* readme shield for forum

* Allow deselection of color picker property. (#19174)

* V15 Added acceptance tests for tiptap statusbar (#19131)

* Updated tests for tiptap RTE

* Moved tests for titptap toolbar to another class

* Added tests for titptap toolbar

* Added tests for tiptap statusbar

* Bumped version

* Make tiptap tests run in the pipeline

* Bumped version

* Reverted npm command

* build: restores some of the behavior from V13 in relation to StaticAssets (#19189)

In v13, the StaticAssets build was only triggered based on the existence of either the output folder or a preserve.* marker file. Here, we also additionally check for the node_modules/.package-lock.json file before reinstalling npm dependencies. We also now only run `npm install` rather than `npm ci` to optimise the build.

* filter search to only include element types

* V16 QA update failing nightly tests (#19190)

* Fixed tests

* More updates for tests

* Bumped version of testhelpers

* Fixed notifications in tests

* Last fixes

* Revert "Merge branch 'v16/dev' into v16/hotfix/filter-element-type-search-for-block-types"

This reverts commit 7b8b5c2, reversing
changes made to 6d4ddb7.

* disable not pickable search results

* correct use of pickable filter

---------

Co-authored-by: Lotte Pitcher <[email protected]>
Co-authored-by: Warren Buckley <[email protected]>
Co-authored-by: Nhu Dinh <[email protected]>
Co-authored-by: Sebastiaan Janssen <[email protected]>
Co-authored-by: Lotte Pitcher <[email protected]>
Co-authored-by: Andy Butland <[email protected]>
Co-authored-by: Jacob Overgaard <[email protected]>
Co-authored-by: Andreas Zerbst <[email protected]>
Co-authored-by: mole <[email protected]>
Co-authored-by: Niels Lyngsø <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants