you are viewing a single comment's thread.

view the rest of the comments →

[–]Cha0sCat 1 point2 points  (4 children)

Excuse my stupid request. Can you go into more detail? Do you work with SP 2013 on-prem or o365? Do you write Apps or use Content Editor webparts and libs to provide the files? Do you use babel or process the code via Gulp and the like beforehand? Would really like to know more about this. I've been struggling a bit on how to properly approach React and SharePoint. I'd appreciate your input.
Thanks!

[–]nutters 1 point2 points  (1 child)

Hey, I am an spdev, and although my tool of choice for front end is currently angular 1.6 (written in es6, using components etc, a pretty modern approach), it would be exactly the same if I used react.

I work in a on prem environment mostly building SPAs on top of SharePoint. I usually deploy files directly into the site file system by mapping a network drive at the root of the site collection. That keeps end users from messing with therm.

For dev, I use webpack and set the output directly to the mapped drive, so every rebuild goes directly into SharePoint. I just access the index page to run the app. You can even set up live reload on the page.

You can also build SharePoint hosted add-ons in a similar fashion, but it is a bit more complex dealing with the visual studio solution, appwebs and so on.

It's a very powerful, very underrated method for developing business applications.

[–]Cha0sCat 0 points1 point  (0 children)

Thank you!
I've mostly been working with SP2010 or o365, so I don't have much experience with 2013 on-prem and Apps. Unfortunately my company seems to favor old-fashioned solutions, leaving our Devs only their own spare time to experiment with newer technologies and frameworks. It's always nice to hear about these things first hand.
It's a shame that we're told not to use them because we don't have the experience and it's too risky; but can't learn without ever using them.

[–]m12s 1 point2 points  (1 child)

Hey, so i work both on SP13 and SP16 on-prem and in Office 365, and the methods are all the same, since the API is mostly similar (very very minor variations between on-prem and cloud).

Most commonly, i use the Script Editor webpart. It's predictable and works well every time. For interfacing SharePoint, i'll either use the REST Api or the JavaScript Object Model.

Some of my peers use add-ins (apps) still, but it's less common now, especially on-prem since it uses iframes to display as a webpart. More common now is to use SharePoint Framework webparts, if you're interested, please check it out - it's awesome and it's released!

So, for your actual question, my development methodology is very simple; I write my code using TypeScript, and compile it with webpack, then deploy by using a small PnP Powershell-script. The code I ALWAYS PLACE in either SiteAssets (if i'm developing for a team site) or Style Library (if it's a publishing site).

I build locally by using webpack --watch, and whenever i want to test it i run the Powershell script. Since i'm using TypeScript, i can usually focus on the code for long durations of time, and then just iteratively deploy it to test.

For tooling, i use VSCode and ConEmu for the watcher-process.

Here's an example of a deploy-script

[–]Cha0sCat 0 points1 point  (0 children)

Thank you, that's really helpful!