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

V16: Vite development optimizations #18915

Merged
merged 21 commits into from
Apr 3, 2025
Merged

Conversation

iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Apr 2, 2025

Descriptions

  • Removes src/mocks/* from the production output
  • Adds missing static files for Vite using viteStaticCopy
  • Resolves a TODO in the dev/static build output
  • Adds workflow to publish Backoffice Storybook
  • Adds workflow to publish Backoffice Static app

How to test

  1. Test that npm run dev:mock works
  2. Test that npm run dev:server works
  3. Test that npm run build:for:cms works, and you can browse the backoffice on the backend
  4. Test that npm run storybook works
  5. Test that npm run storybook:build works and you can serve the files npx serve storybook-static
  6. Test that npm run build:for:static works, and you can serve the files npx serve dist

@iOvergaard iOvergaard added the category/ux User experience label Apr 2, 2025
Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net

Copy link

github-actions bot commented Apr 2, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net

@iOvergaard iOvergaard marked this pull request as ready for review April 2, 2025 15:02
@Copilot Copilot bot review requested due to automatic review settings April 2, 2025 15:02
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR optimizes the Vite development workflow by updating static asset configurations, refactoring mock service worker settings, and adding CI/CD workflows for deploying Backoffice Storybook and Static apps.

  • Updated asset paths and copy configurations in production builds
  • Refactored mock service worker initialization
  • Added deployment workflows for Backoffice Storybook and Static apps

Reviewed Changes

Copilot reviewed 7 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Umbraco.Web.UI.Client/vite.config.ts Revised static file copy configuration including relocating asset files from mocks to intended production paths
src/Umbraco.Web.UI.Client/src/mocks/index.ts Removed the VITE_MSW_QUIET configuration from the mock service worker initialization
src/Umbraco.Web.UI.Client/src/mocks/handlers/backoffice/backoffice.handlers.ts Updated asset path references to point to production assets
src/Umbraco.Web.UI.Client/index.ts Adjusted the mock setup logic and updated the import path for UmbAppElement
.github/workflows/azure-storybook.yml Added CI/CD workflow for Backoffice Storybook deployment
.github/workflows/azure-backoffice.yml Added CI/CD workflow for Backoffice Static Web Apps deployment
Files not reviewed (5)
  • src/Umbraco.Web.UI.Client/.env: Language not supported
  • src/Umbraco.Web.UI.Client/index.html: Language not supported
  • src/Umbraco.Web.UI.Client/package.json: Language not supported
  • src/Umbraco.Web.UI.Client/src/tsconfig.build.json: Language not supported
  • src/Umbraco.Web.UI.Client/staticwebapp.config.json: Language not supported
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/vite.config.ts:32

  • [nitpick] The source path 'src/mocks/handlers/backoffice/assets/*' still references 'mocks', which may be misleading for production assets. Consider renaming or relocating these assets to clearly indicate their production usage.
{

@iOvergaard iOvergaard requested a review from Copilot April 2, 2025 15:16
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This pull request introduces Vite development optimizations by reconfiguring static asset management and refining mock service worker handling, along with adding CI/CD workflows for Backoffice Storybook and Static app deployments.

  • Updates Vite configuration to use viteStaticCopy for asset management and adjust asset paths.
  • Adjusts mock service worker initialization and asset URL references via changes in the mocks and backoffice handler files.
  • Adds new GitHub workflows to build and deploy Backoffice Storybook and Static Backoffice app.

Reviewed Changes

Copilot reviewed 7 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Umbraco.Web.UI.Client/vite.config.ts Adds new static asset copy rules for CSS, fonts, and backoffice assets (previously under mocks).
src/Umbraco.Web.UI.Client/src/mocks/index.ts Removes a TODO comment and simplifies the mock service worker configuration.
src/Umbraco.Web.UI.Client/src/mocks/handlers/backoffice/backoffice.handlers.ts Updates asset URLs to point to production asset locations.
src/Umbraco.Web.UI.Client/index.ts Refactors the App element import and mock service worker conditional initialization.
.github/workflows/azure-storybook.yml Introduces a workflow for building and deploying Backoffice Storybook.
.github/workflows/azure-backoffice.yml Introduces a workflow for building and deploying the Backoffice Static app.
Files not reviewed (5)
  • src/Umbraco.Web.UI.Client/.env: Language not supported
  • src/Umbraco.Web.UI.Client/index.html: Language not supported
  • src/Umbraco.Web.UI.Client/package.json: Language not supported
  • src/Umbraco.Web.UI.Client/src/tsconfig.build.json: Language not supported
  • src/Umbraco.Web.UI.Client/staticwebapp.config.json: Language not supported
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/vite.config.ts:32

  • Including assets from the 'src/mocks' folder in the production output seems to contradict the PR description of removing mocks from production. Please confirm if these assets should indeed be copied or if this rule should be adjusted.
{ src: 'src/mocks/handlers/backoffice/assets/*', dest: 'umbraco/backoffice/assets' },

@iOvergaard iOvergaard added category/dx Developer experience type/feature labels Apr 2, 2025
@iOvergaard iOvergaard requested a review from leekelleher April 2, 2025 15:29
@iOvergaard iOvergaard added preview/storybook Pull requests that can be previewed through Storybook preview/backoffice Pull requests that can be previewed in a static version of the Backoffice and removed category/ux User experience labels Apr 3, 2025
Copy link

github-actions bot commented Apr 3, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-18915.westeurope.6.azurestaticapps.net

Copy link

github-actions bot commented Apr 3, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-18915.westeurope.6.azurestaticapps.net

Copy link

github-actions bot commented Apr 3, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-18915.westeurope.6.azurestaticapps.net

Copy link

github-actions bot commented Apr 3, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-18915.westeurope.6.azurestaticapps.net

Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

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

All tested out, looking great! 🚀

@leekelleher leekelleher merged commit 7d7db6b into v16/dev Apr 3, 2025
27 checks passed
@leekelleher leekelleher deleted the v16/feature/vite-dev-setup branch April 3, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/dx Developer experience preview/backoffice Pull requests that can be previewed in a static version of the Backoffice preview/storybook Pull requests that can be previewed through Storybook release/16.0.0 type/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants