-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Conversation
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ashy-bay-09f36a803-18915.westeurope.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://ambitious-stone-0033b3603-18915.westeurope.1.azurestaticapps.net |
There was a problem hiding this 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.
{
There was a problem hiding this 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' },
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-18915.westeurope.6.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-18915.westeurope.6.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-18915.westeurope.6.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-18915.westeurope.6.azurestaticapps.net |
There was a problem hiding this 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! 🚀
Descriptions
src/mocks/*
from the production outputHow to test
npm run dev:mock
worksnpm run dev:server
worksnpm run build:for:cms
works, and you can browse the backoffice on the backendnpm run storybook
worksnpm run storybook:build
works and you can serve the filesnpx serve storybook-static
npm run build:for:static
works, and you can serve the filesnpx serve dist