[patch]: fix web sideload with manifest preview#980
[patch]: fix web sideload with manifest preview#980aminya wants to merge 1 commit intoOfficeDev:masterfrom
Conversation
To side load on the web, the sourceLocation is required, however, the dev manifest preview fails if you add it in the manifest file. This adds a default location, so that web side load works with the manifest preview
millerds
left a comment
There was a problem hiding this comment.
What do you mean by "dev manifest preview fails if you add it in the manifest"? Can you explain some more what you are seeing happen.
I also noticed you are using the json manifest and I don't think that has a default location property. It existed in the xml schema but doesn't appear to have been translated over to the json schema (that I can see). I think you have found a legitimate flaw in the sideloading code because that value will always be empty for json manifests (only gets set in manifestHandlerXml.ts), but I think the better fix would be to set that value in manifestHandlerJson.ts with a legitimate value from the json manifest (from the runtimes section?) or maybe see if a sideloading URL can be crafted that works without that value.
| } | ||
|
|
||
| manifest.defaultSettings = manifest.defaultSettings ?? {}; | ||
| manifest.defaultSettings.sourceLocation = manifest.defaultSettings.sourceLocation ?? "https://localhost:4000"; |
There was a problem hiding this comment.
I'm not sure this is the right default. It assumes that people are deploying their test add-in code to localhost:4000 which isn't even the location used in the add-in projects we generate from templates using 'yo office' (which is port 3000) and in those it is written that way into the manifest.
Change Description:
To side load on the web, the sourceLocation is required, however, the dev manifest preview fails if you add it in the manifest file. This adds a default location, so that web side load works with the manifest preview
Do these changes impact command syntax of any of the packages? No
Do these changes impact documentation? No
Validation/testing performed:
bunx -b office-addin-debugging start --dev-tools manifest.json web --document <some_doc>