Presentation is loading. Please wait.

Presentation is loading. Please wait.

SharePoint-Hosted Apps and JavaScript

Similar presentations


Presentation on theme: "SharePoint-Hosted Apps and JavaScript"— Presentation transcript:

1 SharePoint-Hosted Apps and JavaScript
Developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, developers, …

2 Introduction Wesley Bakker Principal Consultant at motion10
Principal Consultant at motion10

3 Agenda SharePoint-Hosted Apps JavaScript Demo Questions
The good, the bad and the ugly JavaScript The good, the bad and the… etc. Demo Questions

4 SharePoint Hosted Apps
The good, the bad and the ugly

5 What Microsoft says about SharePoint-hosted apps
“SharePoint-hosted apps: SharePoint-hosted apps contain only declarative content, such as HTML and JavaScript, and don’t have any server-side code that is packaged with them. These types of apps store the HTML and other content in SharePoint and simply present the declarative content to the browser. SharePoint-hosted apps interact with SharePoint via the JavaScript object model or Representational State Transfer (REST) end- points and are client-side based. The design and interaction of these types of apps are similar to client-side design patterns used with sandboxed solutions.” * *

6 The good Solves many problems for Microsoft JavaScript only
Apps run in their own app web which is a sub web of the host web SharePoint-hosted apps solve many problems for Microsoft in a sense that not a single line of code runs in the app pool process. This protects the core processes of SharePoint. It is actually a good thing that you can use JavaScript only. Sandboxed solutions should be built in a way that they use JavaScript as much as possible to prevent from being shutdown because of resource usage. A lot of solutions however simply required to up the available resource points instead of switching to extend the use of JSOM. Apps must be running in their own app web to ensure that no actions can be performed while circumventing the use of a proxy which checks permissions. It also ensures that nothing is added to the SharePoint site that cannot be upgraded. In a worse case scenario, your app stops working on upgrade, with which you’ll only loose app functionality. Your default SharePoint functionality remains untouched.

7 The bad Solves many problems for Microsoft JavaScript only
Apps run in their own app web which is a sub web of the host web Even though SharePoint-hosted apps solves many problems for Microsoft, they do introduce a lot of challenges for developers. Such as how to cope with cross-site script access, how to integrate with the SharePoint UI. The fact that it is JavaScript only, limits the possibilities. You cannot perform any server side custom tasks. Such as resizing an image, combine files and download them as zip. Apps run in their own app web, which by default creates an app web for each web the SharePoint-hosted apps get added. You can deploy an app from the app catalog management page which creates a single app web for all webs, unfortunately this doesn’t work for all sorts of features. CustomAction elements for example cannot be deployed like this. The fact that the SharePoint-hosted apps gets its own App Web isn’t that big a deal, except when you use a lot of JavaScript libraries. These libraries need to be downloaded for each web where your app is added, since they are hosted under a different URL, the client cannot cache these libraries

8 The ugly SharePoint-hosted apps do not always work well with SAML authentication if the identity provider supports wildcard return uniform resource locator (URL) registration and honors the wreply parameter it works Active Directory Federation Services (AD FS) 2.0 version does not support wildcard for return URL registration. SharePoint-hosted apps do not work with SAML and FBA sites. A good explanation on why can be found here:

9 The good, the bad and the… etc.
JavaScript The good, the bad and the… etc.

10 The good Dynamic programming language
Extensible Can be written in an Object-oriented fashion JavaScript has a lot of well known pro’s and con’s. And the fact that it’s a dynamic language is both great and “dangerous”.

11 The bad Dynamic programming language
Extensible Can be written in an Object-oriented fashion JavaScript has a lot of well known pro’s and con’s. And the fact that it’s a dynamic language is both great and dangerous.

12 The ugly The ugly doesn’t come from JavaScript itself, but from the code samples found on the Microsoft sites… This sample code mixes jQuery usage and standard JavaScript Uses string concatenation to generate html output Creates variables in the global scope with a very common name.. Code source: Beside that, documentation of the JSOM libraries is very poor

13 Real development shortcomings
No type checking No refactoring No compile-time validation IntelliSense is not that good

14 Script#, TypeScript, Angular, Web Essentials
Demo Script#, TypeScript, Angular, Web Essentials

15 Conclusion TypeScript is pretty cool T4 templating is pretty cool
No buts… it is pretty cool! T4 templating is pretty cool T4 templating could use some TLC… no intellisense is pretty much a deal breaker though AngularJS is pretty cool Web Essentials is pretty cool The tool does have some bugs, it is open source though and you can submit your changes  Writing SharePoint-hosted Apps can be pretty cool… Nobody said it would be easy though..


Download ppt "SharePoint-Hosted Apps and JavaScript"

Similar presentations


Ads by Google