Sep 15 2016 12:10 AM
Sep 15 2016 12:10 AM
Hi,
can someone from the Microsoft team confirm that side loading of Core.EmbedJavaScript is best practice even if side loading in general is not recommended for production. I have a really hard time convincing IT operations to enable this feature temporarily on my SPO Site Collection.
Thanks!
Gitte Dreyer
Sep 15 2016 05:21 AM
SolutionI would never call anything as a "best practice", since it depends on some many factors. Core.EmbedJavaScript is PnP scenario sample to show how to use embed JavaScript pattern on the existing sites. Key objective of this sample is to show the APIs on adding userCustomAction with custom JavaScript to your tenant.
Sample does use provider hosted add-in/app only for the demo purposes - in real production, I'd never personally implement this as a functionality where you'd need to explicitly go and click a button in app/add-in to make things happen.
"ok - so how then?" - Typically these kind of customizations are pushed to site using remote provisioning pattern. You could use PnP PowerShell or even console application to call the needed operation, if you'd like to get the sites modified. This would only require needed permissions to the site, but would not require any app/add-in side loading steps.
So in simplicity, you have pretty much following options for automating this
So - you do not need to have side-loading enabled for the production sites, since in practice you'd not actually deploy the add-in to the sites, since APIs are exposed using CSOM for accessing them with alternative models.
Makes sense?
Sep 15 2016 09:19 AM
Thank you and yes indeed. Not sure why I got obsessed with side loading and stopped to think.. From a console application I've just managed what I wanted, which was to add scripts to my site collection. However, I'm excited to dive into the PnP Pwershell cmdlets 🙂
Sep 15 2016 01:47 PM
@VesaJuvonen When I access the workbench.aspx page that is loaded into my Dev Tenant, it takes me to the GitHub Page? Works ok locally, when trying to use SP Online though I get that behaviour....Have you seen this?
Sep 16 2016 12:14 AM
Sep 16 2016 12:14 AM
I saw this behaviour when I accidentally downloaded the entire aspx page. You should right-click Raw and download that file.
Sep 15 2016 05:21 AM
SolutionI would never call anything as a "best practice", since it depends on some many factors. Core.EmbedJavaScript is PnP scenario sample to show how to use embed JavaScript pattern on the existing sites. Key objective of this sample is to show the APIs on adding userCustomAction with custom JavaScript to your tenant.
Sample does use provider hosted add-in/app only for the demo purposes - in real production, I'd never personally implement this as a functionality where you'd need to explicitly go and click a button in app/add-in to make things happen.
"ok - so how then?" - Typically these kind of customizations are pushed to site using remote provisioning pattern. You could use PnP PowerShell or even console application to call the needed operation, if you'd like to get the sites modified. This would only require needed permissions to the site, but would not require any app/add-in side loading steps.
So in simplicity, you have pretty much following options for automating this
So - you do not need to have side-loading enabled for the production sites, since in practice you'd not actually deploy the add-in to the sites, since APIs are exposed using CSOM for accessing them with alternative models.
Makes sense?