Developer story for SharePoint-hosted apps?

Copper Contributor

Hi,

 

I have quite a generic question that hopefully still belongs in this community. What I am saying below comes from genuine curiosity and willingness to learn - no trolling or hate speech intended.

 

My recent experiments with using the "classic" SharePoint UI such as web parts and list views in SharePoint-hosted apps make me think that while technically one can use web part pages and customized list views / list forms in an app, Microsoft seems to have never thought of this as of "first-class citizen" developer experience. Let me give you some examples:

 

  • SharePoint-hosted apps seem to have no out-of-the-box support for navigation. And while it is possible to enable navigation by creating a custom master page and adding necessary controls, it still feels like a half-baked solution because, for example, neither stock list view nor stock list form pages will inherit the custom master page - so, there's no easy way to add navigation across the whole app without creating custom list view and list form pages for every list / document library in the app.
  • According to the official docs, one would need to use remote provisioning to apply a composed look to a SharePoint-hosted app (think additional hosting costs + the complexity of debugging remote event receivers). While I agree that remote provisioning might be the only choice for certain advanced scenarios, but why on Earth one cannot apply custom fonts and colors declaratively?

So my question is - is a JavaScript-based single page app the only "first-class citizen" developer story for creating SharePoint-hosted apps? Not that I have anything against the SPA approach; actually we use it quite extensively, but at the same time it feels a bit stupid that we have to re-implement list views and list forms in React / Redux (or AngularJS for that matter) instead of having an ability to reuse the existing SharePoint implementation - possibly with some CSR bits and pieces?

 

Once again, I'd like to stress that I might as well be missing something important, and I am definitely open to a constructive discussion - the above is just my personal experience so far. Arguments and opinions are very welcome!

4 Replies
Well...maybe not the answer you are looking for, but with the arrival of SPFx I would not recommend to create SharePoint-Hosted Apps anymore

Thanks! I am aware of SPFx, and unfortunately it is not an option for SharePoint 2013 on-premises :(

My take is you are a bit stuck in the middle by the sounds of it. I would completely agree that SPFX is the best route to go for all SP development now but in your case you are left with some decisions. The hosted app model was a flop to most developers. If stuck with 2013 for a while - I would either go with JS embedding on the pages (Script part) or if you need even more power you can still use Server side web parts. At least the JS code would port forward a bit better later on - keep an eye on trying to structure it as close to the SPFX model as possible. 

I might get blasted a bit for Server side web part suggestions but depending on the needs these are generally easy / quick to create with max power in 2013. I wouldnt waste a year on development but for quick hit areas of your site you might consider it.

Then try to develop your stuff always on the client side and avoiding SharePoint-Hosted App in this way you will be able to convert your code to SPFx quite easily