10

We have a SharePoint hosted app. This app require some scripts from SharePoint; MicrosoftAjax.js, init.js, sp.runtime.js, sp.js, sp.taxonomy.js and sp.workflowservices.js.
We load all these from /_layouts/15/, except for MicrosoftAjax which we load from ajax.aspnetcdn.com.

What we are thinking about is to bundle all these files into our app.js. We use gulp to build our app, so we only have one file, except for the files above.
Problems I can think of:

  1. How can we detect changes in the built in scripts?
  2. Are there differences between on-premise and SharePoint online?
  3. Are any parts of the scripts dynamic (variables set when requesting the scritps)?

We had problems with MicrosoftAjax.js, once it was removed from 15 hive, and once the DNS did not resolve.

  • So you are trying to replace SharePoints SOD with your own? – Danny '365CSI' Engelman Nov 17 '15 at 10:59
  • 1
    @DannyEngelman We simply don't use any dynamic loading. Our app has a very light weight index.html page, and we don't need to load anything on demand or asynchronously. – eirikb Nov 17 '15 at 11:03
  • 1
    From a Governance point of view I would not accept any add-ins that replaces default Microsoft scripts with their own. Your add-in is payload and if it changes anything in the trucks engine I can imagine Microsoft won't give support either. – Danny '365CSI' Engelman Nov 17 '15 at 11:54
  • @DannyEngelman The scripts are only client side scripts, libraries that can be changed externally in any case, be it be re-evaluating or overriding the prototype. The app.js-file is in any case bundled with the app, so it can not be changed after deploy, which in theory makes it safer than pointing to built in scripts which can be changed, even by third party be it on-premise. – eirikb Nov 17 '15 at 12:30
  • OnPrem could vary iguess, depending on patch/service pack they run. Some function in the init.js on O365 uses _spPageContextInfo.userId etc, that is not available onprem (on my version of 2013). – Anders Aune Nov 17 '15 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.