{"id":3219,"date":"2019-07-23T08:00:25","date_gmt":"2019-07-23T16:00:25","guid":{"rendered":"https:\/\/developer.microsoft.com\/en-us\/office\/blogs\/?p=3219"},"modified":"2019-07-23T08:00:25","modified_gmt":"2019-07-23T16:00:25","slug":"update-your-customs-functions-project","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/update-your-customs-functions-project\/","title":{"rendered":"Update your custom functions project"},"content":{"rendered":"<h3><span data-contrast=\"none\">Update an old project<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">If you built your custom functions project using the\u00a0<\/span><a href=\"https:\/\/github.com\/OfficeDev\/generator-office\"><span data-contrast=\"none\">Yo<\/span><span data-contrast=\"none\">\u00a0Office Yeoman generator template<\/span><\/a><span data-contrast=\"auto\">\u00a0during the preview period prior to 6 May 2019, you\u2019ll want to update parts of the project ensure it is using the GA version libraries and features.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">To convert a project:\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">Update the CDN location<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">The post-GA\u00a0<\/span><span data-contrast=\"auto\">Yo<\/span><span data-contrast=\"auto\">\u00a0Office template included a change to the\u00a0<\/span><span data-contrast=\"auto\">script file<\/span><span data-contrast=\"auto\">\u00a0that governs the custom functions&#8217; runtime<\/span><span data-contrast=\"auto\">\u00a0and moved from a temporary\u00a0<\/span><span data-contrast=\"auto\">GitHub<\/span><span data-contrast=\"auto\">\u00a0location to a permanent CDN on <a href=\"https:\/\/appsforoffice.microsoft.com\/\">https:\/\/appsforoffice.microsoft.com\/<\/a>.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">In the<\/span><span data-contrast=\"auto\">\u00a0HTML file for your add-in<\/span><span data-contrast=\"auto\">, delete t<\/span><span data-contrast=\"auto\">he<\/span><span data-contrast=\"auto\">\u00a0script reference<\/span><span data-contrast=\"auto\">\u00a0which is used to load custom-function-runtime.js. Because the preview\u00a0<\/span><span data-contrast=\"auto\">Yo<\/span><span data-contrast=\"auto\">\u00a0Office template changed frequently, this might refer to a temporary\u00a0<\/span><span data-contrast=\"auto\">GitHub<\/span><span data-contrast=\"auto\">\u00a0location like the following code snippet, but you may see a different location depending on your project.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang:default decode:true \" title=\"Update the CDN Location\">&lt;script\u00a0src=\"https:\/\/officedev.github.io\/custom-functions\/lib\/custom-functions-runtime.js\"\u00a0type=\"text\/javascript\"&gt;&lt;\/script&gt;<\/pre>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><span data-contrast=\"auto\">And replace it with this script reference instead<\/span><span data-contrast=\"auto\">, which includes the updated CDN location:\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang:default decode:true \" title=\"Replacement script\">&lt;script\u00a0src=\"https:\/\/appsforoffice.microsoft.com\/lib\/1.1\/hosted\/custom-functions-runtime.js\"\u00a0type=\"text\/javascript\"&gt;&lt;\/script&gt;<\/pre>\n<p><span data-contrast=\"auto\">To learn more about this runtime<\/span><span data-contrast=\"auto\">, see<\/span><span data-contrast=\"auto\">\u00a0our docs on the\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/office\/dev\/add-ins\/excel\/custom-functions-architecture\"><span data-contrast=\"none\">custom functions architecture<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">Change any mentions of\u00a0 &#8216;<\/span>AsyncStorage<span data-contrast=\"none\">&#8216; to &#8216;s<\/span><span data-contrast=\"none\">torage&#8217;<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559738&quot;:40,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">The <\/span><strong>AsyncStorage<\/strong><span data-contrast=\"auto\"><strong>\u00a0<\/strong>object\u00a0<\/span><span data-contrast=\"auto\">was<\/span><span data-contrast=\"auto\">\u00a0rewritten with different methods and a new name. You&#8217;ll want to make sure all mentions of <\/span><strong>AsyncStorage<\/strong><span data-contrast=\"auto\"><strong>\u00a0<\/strong>use the new object, <strong>storage<\/strong>. Method changes are listed\u00a0<\/span><span data-contrast=\"auto\">in the following table<\/span><span data-contrast=\"auto\">, although you can also use the built-in IntelliSense in Visual Studio Code to look for correct methods.\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>The following table lists the methods that are changed:<\/p>\n<table data-tablestyle=\"MsoTableGrid\" data-tablelook=\"1696\">\n<tbody>\n<tr>\n<td data-celllook=\"65536\"><strong>Old method\u00a0<\/strong><\/td>\n<td data-celllook=\"65536\"><strong>New replacement\u00a0<\/strong><\/td>\n<\/tr>\n<tr>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">multiGet<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">getItems<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">Multiset<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">setItems<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">multiRemove<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">removeItems<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">getAllKeys<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">getKeys<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Deprecated methods:\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"none\">flushgetRequests<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Methods that have not changed between templates:\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">GetItem<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">setItem<\/span><span data-contrast=\"none\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><span data-contrast=\"none\">removeItem<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">As a reminder<\/span><span data-contrast=\"auto\">, <strong>storage<\/strong>\u00a0is limited to 10 MB of data per domain (which may be shared by multiple add-ins). For more information\u00a0<\/span><span data-contrast=\"auto\">about\u00a0<\/span><span data-contrast=\"auto\">storage, see <a href=\"https:\/\/docs.microsoft.com\/en-us\/office\/dev\/add-ins\/excel\/custom-functions-save-state\">Save and share\u00a0<\/a><\/span><span data-contrast=\"auto\">state<\/span><span data-contrast=\"auto\">\u00a0in custom\u00a0<\/span><span data-contrast=\"auto\">functions.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Happy developing!<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Michelle\u00a0Scharlock<\/span><\/p>\n<p>Office Add-ins Developer Education Team<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you built your custom functions project using the\u00a0Yo\u00a0Office Yeoman generator template\u00a0during the preview period prior to May 6, you\u2019ll want to update parts of the project ensure it is using the GA version libraries and features.\u00a0This blog post covers the methods that have changed.<\/p>\n","protected":false},"author":69076,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[49,18],"class_list":["post-3219","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-custom-functions","tag-excel"],"acf":[],"blog_post_summary":"<p>If you built your custom functions project using the\u00a0Yo\u00a0Office Yeoman generator template\u00a0during the preview period prior to May 6, you\u2019ll want to update parts of the project ensure it is using the GA version libraries and features.\u00a0This blog post covers the methods that have changed.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/3219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69076"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=3219"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/3219\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=3219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=3219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=3219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}