Skip to content

Commit b1bef55

Browse files
authored
Merge pull request #407 from OfficeDev/merge-shared-changes-shared-runtime
Merge shared changes shared runtime
2 parents 4e9127d + eb08b61 commit b1bef55

File tree

9 files changed

+35
-141
lines changed

9 files changed

+35
-141
lines changed

.vscode/launch.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@
3939
"internalConsoleOptions": "openOnSessionStart",
4040
"runtimeArgs": ["--preserve-symlinks"]
4141
},
42-
{
43-
"name": "Excel Desktop (Custom Functions)",
44-
"type": "node",
45-
"request": "attach",
46-
"port": 9223,
47-
"timeout": 600000,
48-
"preLaunchTask": "Debug: Excel Desktop",
49-
"postDebugTask": "Stop Debug",
50-
"resolveSourceMapLocations": null
51-
},
5242
{
5343
"name": "Excel Desktop (Edge Chromium)",
5444
"type": "msedge",

manifest.xml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
55
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
6-
<Id>ca968be6-628b-4f14-ba3c-3e614effa9bd</Id>
6+
<Id>19791936-c8fa-48c9-a354-e347c71ae827</Id>
77
<Version>1.0.0.0</Version>
88
<ProviderName>Contoso</ProviderName>
99
<DefaultLocale>en-US</DefaultLocale>
10-
<DisplayName DefaultValue="Excel Custom Functions" />
10+
<DisplayName DefaultValue="Excel Custom Functions Shared Runtime" />
1111
<Description DefaultValue="Write your own Excel functions in TypeScript." />
1212
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
1313
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
@@ -19,9 +19,9 @@
1919
<Host Name="Workbook"/>
2020
</Hosts>
2121
<Requirements>
22-
<Sets DefaultMinVersion="1.1">
23-
<Set Name="CustomFunctionsRuntime" MinVersion="1.1"/>
24-
</Sets>
22+
<Sets DefaultMinVersion="1.1">
23+
<Set Name="SharedRuntime" MinVersion="1.1"/>
24+
</Sets>
2525
</Requirements>
2626
<DefaultSettings>
2727
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
@@ -30,13 +30,16 @@
3030
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
3131
<Hosts>
3232
<Host xsi:type="Workbook">
33+
<Runtimes>
34+
<Runtime resid="Taskpane.Url" lifetime="long" />
35+
</Runtimes>
3336
<AllFormFactors>
3437
<ExtensionPoint xsi:type="CustomFunctions">
3538
<Script>
3639
<SourceLocation resid="Functions.Script.Url" />
3740
</Script>
3841
<Page>
39-
<SourceLocation resid="Functions.Page.Url"/>
42+
<SourceLocation resid="Taskpane.Url"/>
4043
</Page>
4144
<Metadata>
4245
<SourceLocation resid="Functions.Metadata.Url" />
@@ -50,7 +53,7 @@
5053
<Description resid="GetStarted.Description"/>
5154
<LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
5255
</GetStarted>
53-
<FunctionFile resid="Commands.Url" />
56+
<FunctionFile resid="Taskpane.Url"/>
5457
<ExtensionPoint xsi:type="PrimaryCommandSurface">
5558
<OfficeTab id="TabHome">
5659
<Group id="CommandsGroup">
@@ -89,12 +92,10 @@
8992
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
9093
</bt:Images>
9194
<bt:Urls>
92-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/public/functions.js" />
93-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/public/functions.json" />
94-
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/public/functions.html" />
95+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/functions.js" />
96+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/functions.json" />
9597
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
96-
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html" />
97-
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html" />
98+
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
9899
</bt:Urls>
99100
<bt:ShortStrings>
100101
<bt:String id="Functions.Namespace" DefaultValue="CONTOSO" />
@@ -108,4 +109,4 @@
108109
</bt:LongStrings>
109110
</Resources>
110111
</VersionOverrides>
111-
</OfficeApp>
112+
</OfficeApp>

src/commands/commands.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/functions/functions.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

test/end-to-end/src/debugger-websocket.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ export async function connectToWebsocket(reconnectTry: number = 1): Promise<WebS
2424
let jsonUrl = reconnectTry % 2 == 0 ? "http://127.0.0.1:9223/json" : "http://127.0.0.1:9229/json";
2525

2626
while (!wsUrl && reconnectTry < limitOfReconnectTries) {
27-
console.log("Attaching debugger...");
27+
console.log(`Attaching debugger to '${jsonUrl}'...`);
2828
findUrl(jsonUrl);
2929
reconnectTry++;
3030
await sleep(1000);
3131
}
3232

3333
return new Promise((resolve) => {
34-
console.log("Connecting to websocket...");
34+
console.log(`Connecting to websocket '${wsUrl}'...`);
3535
const ws = new WebSocket(wsUrl);
3636

3737
ws.onopen = () => {

test/end-to-end/test-manifest-debugging.xml

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Version>1.0.0.0</Version>
88
<ProviderName>Contoso</ProviderName>
99
<DefaultLocale>en-US</DefaultLocale>
10-
<DisplayName DefaultValue="Excel Custom Functions"/>
10+
<DisplayName DefaultValue="Excel Custom Functions Shared Runtime"/>
1111
<Description DefaultValue="Write your own Excel functions in TypeScript."/>
1212
<IconUrl DefaultValue="https://localhost:3001/assets/icon-32.png"/>
1313
<HighResolutionIconUrl DefaultValue="https://localhost:3001/assets/icon-64.png"/>
@@ -20,7 +20,7 @@
2020
</Hosts>
2121
<Requirements>
2222
<Sets DefaultMinVersion="1.1">
23-
<Set Name="CustomFunctionsRuntime" MinVersion="1.1"/>
23+
<Set Name="SharedRuntime" MinVersion="1.1"/>
2424
</Sets>
2525
</Requirements>
2626
<DefaultSettings>
@@ -30,6 +30,9 @@
3030
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
3131
<Hosts>
3232
<Host xsi:type="Workbook">
33+
<Runtimes>
34+
<Runtime resid="Taskpane.Url" lifetime="long" />
35+
</Runtimes>
3336
<AllFormFactors>
3437
<ExtensionPoint xsi:type="CustomFunctions">
3538
<Script>
@@ -44,42 +47,6 @@
4447
<Namespace resid="Functions.Namespace"/>
4548
</ExtensionPoint>
4649
</AllFormFactors>
47-
<DesktopFormFactor>
48-
<GetStarted>
49-
<Title resid="GetStarted.Title"/>
50-
<Description resid="GetStarted.Description"/>
51-
<LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
52-
</GetStarted>
53-
<FunctionFile resid="Commands.Url" />
54-
<ExtensionPoint xsi:type="PrimaryCommandSurface">
55-
<OfficeTab id="TabHome">
56-
<Group id="CommandsGroup">
57-
<Label resid="CommandsGroup.Label" />
58-
<Icon>
59-
<bt:Image size="16" resid="Icon.16x16" />
60-
<bt:Image size="32" resid="Icon.32x32" />
61-
<bt:Image size="80" resid="Icon.80x80" />
62-
</Icon>
63-
<Control xsi:type="Button" id="TaskpaneButton">
64-
<Label resid="TaskpaneButton.Label" />
65-
<Supertip>
66-
<Title resid="TaskpaneButton.Label" />
67-
<Description resid="TaskpaneButton.Tooltip" />
68-
</Supertip>
69-
<Icon>
70-
<bt:Image size="16" resid="Icon.16x16" />
71-
<bt:Image size="32" resid="Icon.32x32" />
72-
<bt:Image size="80" resid="Icon.80x80" />
73-
</Icon>
74-
<Action xsi:type="ShowTaskpane">
75-
<TaskpaneId>ButtonId1</TaskpaneId>
76-
<SourceLocation resid="Taskpane.Url" />
77-
</Action>
78-
</Control>
79-
</Group>
80-
</OfficeTab>
81-
</ExtensionPoint>
82-
</DesktopFormFactor>
8350
</Host>
8451
</Hosts>
8552
<Resources>
@@ -89,11 +56,10 @@
8956
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3001/assets/icon-80.png"/>
9057
</bt:Images>
9158
<bt:Urls>
92-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/public/functions.js"/>
93-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/public/functions.json"/>
94-
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3001/public/functions.html"/>
59+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/functions.js"/>
60+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/functions.json"/>
61+
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3001/taskpane.html"/>
9562
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
96-
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3001/commands.html"/>
9763
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3001/taskpane.html"/>
9864
</bt:Urls>
9965
<bt:ShortStrings>

test/end-to-end/test-manifest.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Version>1.0.0.0</Version>
88
<ProviderName>Contoso</ProviderName>
99
<DefaultLocale>en-US</DefaultLocale>
10-
<DisplayName DefaultValue="Excel Custom Functions"/>
10+
<DisplayName DefaultValue="Excel Custom Functions Shared Runtime"/>
1111
<Description DefaultValue="Write your own Excel functions in TypeScript."/>
1212
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
1313
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
@@ -20,7 +20,7 @@
2020
</Hosts>
2121
<Requirements>
2222
<Sets DefaultMinVersion="1.1">
23-
<Set Name="CustomFunctionsRuntime" MinVersion="1.1"/>
23+
<Set Name="SharedRuntime" MinVersion="1.1"/>
2424
</Sets>
2525
</Requirements>
2626
<DefaultSettings>
@@ -30,13 +30,16 @@
3030
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
3131
<Hosts>
3232
<Host xsi:type="Workbook">
33+
<Runtimes>
34+
<Runtime resid="Taskpane.Url" lifetime="long" />
35+
</Runtimes>
3336
<AllFormFactors>
3437
<ExtensionPoint xsi:type="CustomFunctions">
3538
<Script>
3639
<SourceLocation resid="Functions.Script.Url"/>
3740
</Script>
3841
<Page>
39-
<SourceLocation resid="Functions.Page.Url"/>
42+
<SourceLocation resid="Taskpane.Url"/>
4043
</Page>
4144
<Metadata>
4245
<SourceLocation resid="Functions.Metadata.Url"/>
@@ -53,11 +56,9 @@
5356
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
5457
</bt:Images>
5558
<bt:Urls>
56-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/public/functions.js"/>
57-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/public/functions.json"/>
58-
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/public/functions.html"/>
59+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/functions.js"/>
60+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/functions.json"/>
5961
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
60-
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
6162
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
6263
</bt:Urls>
6364
<bt:ShortStrings>

test/end-to-end/webpack.config.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,10 @@ module.exports = async (env, options) => {
7171
output: "functions.json",
7272
input: "./src/functions/functions.ts",
7373
}),
74-
new HtmlWebpackPlugin({
75-
filename: "functions.html",
76-
template: "./src/functions/functions.html",
77-
chunks: ["polyfill", "functions"],
78-
}),
7974
new HtmlWebpackPlugin({
8075
filename: "taskpane.html",
8176
template: "./test/end-to-end/src/test-taskpane.html",
82-
chunks: ["polyfill", "taskpane"],
83-
}),
84-
new HtmlWebpackPlugin({
85-
filename: "commands.html",
86-
template: "./test/end-to-end/src/test-commands.html",
87-
chunks: ["polyfill", "commands"],
77+
chunks: ["polyfill", "taskpane", "functions", "commands"],
8878
}),
8979
new CopyWebpackPlugin({
9080
patterns: [
@@ -96,10 +86,6 @@ module.exports = async (env, options) => {
9686
}),
9787
],
9888
devServer: {
99-
static: {
100-
directory: path.resolve("./", "dist"),
101-
publicPath: "/public",
102-
},
10389
headers: {
10490
"Access-Control-Allow-Origin": "*",
10591
},

webpack.config.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,10 @@ module.exports = async (env, options) => {
6363
output: "functions.json",
6464
input: "./src/functions/functions.ts",
6565
}),
66-
new HtmlWebpackPlugin({
67-
filename: "functions.html",
68-
template: "./src/functions/functions.html",
69-
chunks: ["polyfill", "functions"],
70-
}),
7166
new HtmlWebpackPlugin({
7267
filename: "taskpane.html",
7368
template: "./src/taskpane/taskpane.html",
74-
chunks: ["polyfill", "taskpane"],
69+
chunks: ["polyfill", "taskpane", "functions", "commands"],
7570
}),
7671
new CopyWebpackPlugin({
7772
patterns: [
@@ -86,23 +81,14 @@ module.exports = async (env, options) => {
8681
if (dev) {
8782
return content;
8883
} else {
89-
return content.toString().replace(new RegExp(urlDev + "(?:public/)?", "g"), urlProd);
84+
return content.toString().replace(urlDev, urlProd);
9085
}
9186
},
9287
},
9388
],
9489
}),
95-
new HtmlWebpackPlugin({
96-
filename: "commands.html",
97-
template: "./src/commands/commands.html",
98-
chunks: ["polyfill", "commands"],
99-
}),
10090
],
10191
devServer: {
102-
static: {
103-
directory: path.join(__dirname, "dist"),
104-
publicPath: "/public",
105-
},
10692
headers: {
10793
"Access-Control-Allow-Origin": "*",
10894
},

0 commit comments

Comments
 (0)