[Excel] (hello world) Add unified manifest#979
Conversation
…ub.com/OfficeDev/Office-Add-in-samples into alison-mk-unified-manifest-hello-world
…ub.com/OfficeDev/Office-Add-in-samples into alison-mk-unified-manifest-hello-world
There was a problem hiding this comment.
Pull request overview
This PR converts the Excel Hello World sample from XML manifests to the unified manifest for Microsoft 365 (JSON) and adds the supporting webpack + npm tooling to build/sideload it.
Changes:
- Replaces
manifest.xml/manifest-localhost.xmlwith a unifiedmanifest.json(v1.25). - Adds webpack build configuration to generate a production-ready
dist/manifest.jsonand copy assets. - Updates the README to reflect new prerequisites and run instructions; adds sample-local
.gitignoreand a newpackage.json.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Samples/hello-world/excel-hello-world/webpack.config.js | Adds webpack build/dev-server config and manifest URL rewriting for prod builds. |
| Samples/hello-world/excel-hello-world/README.md | Updates documentation for unified manifest usage and new run flows. |
| Samples/hello-world/excel-hello-world/package.json | Introduces scripts and dependencies for building, debugging, and validating the unified manifest. |
| Samples/hello-world/excel-hello-world/manifest.json | Adds the unified manifest (v1.25) describing the add-in commands/runtime. |
| Samples/hello-world/excel-hello-world/.gitignore | Adds local ignores for node/TeamsFx/build artifacts. |
| Samples/hello-world/excel-hello-world/manifest.xml | Removes legacy XML manifest (GitHub-hosted variant). |
| Samples/hello-world/excel-hello-world/manifest-localhost.xml | Removes legacy XML manifest (localhost variant). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from: "manifest*.json", | ||
| to: "[name]" + "[ext]", | ||
| transform(content) { | ||
| if (dev) { | ||
| return content; | ||
| } else { | ||
| return content.toString().replace(new RegExp(urlDev, "g"), urlProd); | ||
| } |
There was a problem hiding this comment.
The production manifest URL replacement only replaces the exact urlDev string (https://localhost:3000/). In manifest.json, validDomains uses https://localhost:3000 (no trailing slash), so the dev host will remain in dist/manifest.json after a production build. This can cause the prod manifest to reference officedev.github.io URLs while still only allowing localhost in validDomains. Update the transform to also replace the no-trailing-slash form (or replace just the origin/host in a URL-aware way) so validDomains and all URLs are updated consistently.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| Choose the **Hello world** button on the **Home** tab to display the task pane of the add-in. Choose the **Say hello** button to insert "Hello world!" in cell A1. | ||
| When you're finished working with the add-in, close Excel, and then in the window where you ran the three npm commands, run `npm run stop:prod`. | ||
|
|
||
| ## Run the sample on Excel on Windows or Mac |
There was a problem hiding this comment.
Delete this section. The package.json and unified manifest are configured to automatically sideload on desktop anyway. This sample doesn't give the option of testing on the web.
There was a problem hiding this comment.
@Rick-Kirkham Thank you for the review! I adjusted the PR to retain the XML manifest options, so that the sample is still cross-platform (unified manifest is only supported on Windows). Could you review again?
| - [Sideload Office Add-ins on Mac for testing](https://learn.microsoft.com/office/dev/add-ins/testing/sideload-an-office-add-in-on-mac) | ||
| - [Sideload Office Add-ins on iPad for testing](https://learn.microsoft.com/office/dev/add-ins/testing/sideload-an-office-add-in-on-ipad) | ||
|
|
||
| ## Configure a localhost web server and run the sample from localhost |
There was a problem hiding this comment.
Delete this section. There's only one unified manifest and it uses local host, not the github hosting, so users are taking this "option" already.
| ## Applies to | ||
|
|
||
| - Excel on Windows, Mac, and in a browser. | ||
| - Excel on Windows, Mac, and the web. |
There was a problem hiding this comment.
I thought we were keeping the .xml manifest because unified manifest doesn't currently support Mac?
There was a problem hiding this comment.
If this sample remains without XML, then you may need to remove Mac from the support list for now
There was a problem hiding this comment.
Thank you! I adjusted the PR to retain the XML manifest.
Rick-Kirkham
left a comment
There was a problem hiding this comment.
Approving with an exception that will reduce the steps for the developer.
Co-authored-by: Rick Kirkham <Rick-Kirkham@users.noreply.github.com>
What's in this Pull Request?
Converts to the unified manifest for Microsoft 365.