Category: Presentations

Developing ReactJS Single Page Apps for SharePoint

By , November 8, 2016 9:32 pm

reactonsharepointLast year, I decided that I wanted to learn different ways to create web applications.  The two major candidates were Angular 1.x and ReactJS.  I went through some courses on Pluralsight and other training sites for both.  After “playing” around with both, I can honestly say that I prefer ReactJS over Angular.  Angular 2.0 looks promising, but I think some of the same reasons I choose React over Angular still exist:

  1. Angular supplements HTML with its own attributes and puts javascript in HTML.  React is straight Javascript.
  2. You have to learn a whole framework with Angular.  With React, I can choose my own ecosystem.
  3. One thing I read, is that because React is just javascript, it teaches you to be a better JavaScript programmer.
  4. React is focused on doing one thing and being the best at it.  It makes UI’s fast!  The virtual DOM just makes sense to me.
  5. Data flow in React is one way.  It flows down from the top and state is passed back up.  That makes sense to me.

I’ve been developing React apps on NodeJS but I’m a SharePoint Developer.  I kept wondering if I could write Single Page Apps (SPA) for SharePoint.

Basically, my requirements were:

  1. Write a ReactJS app that would compile down to a static JavaScript file that I could embed in a Content Editor Web Part.
  2. Use SharePoint’s REST interfaces to access the SharePoint objects.
  3. Since this would be hosted on SharePoint, I didn’t need to worry about cross-domain authentication.
  4. Use React Router to control app routing.
  5. Create a workflow that would allow me to easily develop and deploy these apps to SharePoint.

With the recent guidance from Microsoft about the SharePoint Framework, I thought this was the perfect time to attempt to write a React app on SharePoint.

After a lot of research, I found a couple of things.

There is a project called ReactJS.NET that makes using React with .NET easier.  It focuses on the .NET MVC pattern.  I looked at that, created some demos but it didn’t fit my requirements.  I didn’t want to have to deploy compiled C# code to a SharePoint server.

I decided to start rolling my own solution.  I chose

  • ReactJS
  • NodeJS
  • Babel (to transpile JSX)
  • npm (to load the node packages and run scripts
  • Webpack to bundle them into static files

I was trying to put this all together when someone recommended that I check out the team at Facebook Incubator’s create-react-app bootstrapper.  After looking through the demos. Installing it myself and creating some quick (albeit small) apps and getting them to run on SharePoint, I think I have found my solution.

A couple of challenges.

  1.  How do I develop on NodeJS without connecting to the SharePoint REST interfaces?
  2. How do I deploy the created app to SharePoint.

The answer to the first question was to create a “dummy” REST interface for development.  I created the lists that I needed in SharePoint and then used Postman to call the REST interfaces and grab the data that was returned.  I copied that data object into my React App as the data source and then created an API module that would use the local data instead of calling SharePoint.  Since we can request a JSON object from SharePoint using the Accept header, it was easy to recreate the API necessary using array methods.  Once the app was developed using my dummy API, I substituted my real API that actually called the SharePoint REST endpoints.

The second question posed more of a problem.  I planned to put my app on a web part page by referencing it in a content editor web part.  For years I have been storing custom code in the Site Assets library.  You could also create a CDN to host your app code.  Either way, your development workflow needs to be able to copy the static files from your production build, to SharePoint.  My original solution was to upload them via the web interface.  This worked but it was too cumbersome.  My next solution was to map a drive to Site Assets folder in SharePoint.  This works some of the time, but this also is cumbersome.  I recently read about an npm module called spsave.  I’m going to try to work it into my workflow.  This should allow me to automatically deploy my files to SharePoint when I run the build command.

I put together a presentation about my work to get React to work in SharePoint.  It’s still a work in progress.  I delivered the presentation at SharePoint Saturday – Kansas City on October 1 and then again in Minneapolis for SharePoint Saturday – Twin Cities.  My slides are linked below but the best thing to do would be to look at the code of the Contacts app I created for the presentation.  It’s a simple app but demostrates the use of a dummy API to develop with.  The github link to the code is below also.

I plan on continuing to improve my demo and adding to it.  I think I’m going to add some tests and I still need to add a delete function.  If you are interested, go ahead and star my repository.  If you find an error in the code, or a better way of doing something – I’d love to hear about it!  Remember, I’m still learning so be kind!

ReactJs SPA’s on SharePoint

https://github.com/dipetersen/ReactOnSharePoint

spstc2016-reactjs-on-sharepoint

 

Updated Presentation Slides

By , October 7, 2016 3:46 pm

I just uploaded the slides to the two presentations I did at SPS-KC on October 1, 2016.  You can find them on the SPSKC site under Sessions, or you can get the links on my Presentation Notes page.

Phoenix here I come!

By , October 31, 2013 3:54 pm

SharePointSaturdayI’m very excited to be speaking at SharePoint Saturday – Phoenix on November 23, 2013.  This is the furthest WEST I have presented and I am excited.  I love Phoenix and I have visited and worked here a few times over my career.  I think HDR even has an office or two here.  For this conference, I will be presenting BI: From the desktop and beyond… and my presentation on an Org Chart Mashup using jQuery, SharePoint, web services and the Google Charting API.  This should be fun and I’m looking forward to it!

Speaking at SharePoint Saturday – Twin Cities

By , October 10, 2013 9:01 am

MinneapolisSharePoint Saturday-Twin Cities has to be my favorite conference to speak at.  The group that runs it is always professional and they really demonstrate how to run a SharePoint Saturday.  I used them as a resource when I started planning SharePoint Saturday – Omaha.  The lessons I learned from attending SPSTC and from their leaders helped make SPSOmaha a success.

So, what will I be speaking about this time?  My presentation is, “Microsoft BI: From the desktop and beyond…”.  I’m really excited about this presentation because I am really excited about the Microsoft BI platform.  When I first saw a demo of PowerPivot, PowerQuery, PowerMap and PowerView, I saw the possibilities that this could mean for BI at my company.  No longer would my users have to wait 6 months to get a BI report.  The people that knew the data could be the same ones analysing the data.  My users could create rich dashboards and reports on their own, limited only by their imaginations.

But, do you know what the best thing that turned me on about this platform?  We already owned it – we just didn’t know it!  In fact, I’m sure there were users already using PowerPivot on their desktops without even realizing that they could extend their expertise to the team or enterprise.  The more I thought about it, I realized that anyone who had an Enterprise license of SharePoint had access to the same great technology, and maybe didn’t even know about it.  So that’s what prompted me to start creating this presentation.  I read a lot.  I attended many BI presentations, both in person and online.  Then, I got access to the PowerBI preview.  There it was – a website that I could test and demo what I was so excited about.

If you are going to SPSTC and want to learn more about the Microsoft BI platform, come to my session at 3pm.

Client side Application Development in SharePoint – July Omaha SharePoint User Group Presentation References

By , July 23, 2012 4:04 pm

I promised that I would upload my slide deck from this presentation but after looking at the slides, it appears that the only thing worthwhile are the links that I provided for further study.  So, without further ado, here are the references:

 

Besides the Org Chart demo above, I will try to get the other demos posted on http://sharepoint.dipetersen.com in the near future. Keep checking back.

If there are topics you want to see covered at future user group meetings, leave a comment here and we’ll try to cover it at an upcoming meeting.

Thanks again for coming to the meetings and for reading the blog!

Dave

February 27 – Omaha User Group Presentation – The SharePoint SweetSpot – Links

By , February 27, 2012 4:46 pm

If you attended the February Omaha SharePoint User Group meeting, Thank You!  We had 32 people show up for a great lunch provided by QCI and I hope you also learned something you can bring back to your organization.  Thank you to Bass & Associates, Kerry Dirks and Steve Wright for providing prizes!

Some notes:

Presenters

We’re always looking for presenters.  With our format of alternating between Technical content and then User-centric content, we need all sorts of presenters and all sorts of topics.  For example, in April, you will learn about an Agile Project Tracking site that one of our members created.  If you are interested in presenting at one of our upcoming meetings, please send an email to sharepoint@omahamtg.com, or just leave me a comment on this blog.

Sponsors

We have had great response from our professional community to help sponsor prizes and food for our meetings.  If you would like to sponsor one of our future meetings or would like to sponsor some door prizes, please send an email to sharepoint@omahamtg.com or leave me a comment below!  We truly appreciate our sponsors!

Links

OK – now for the links I know you all came here for:  I didn’t have much in the way of slides but the links at the end of the slides are on my presentation page.  I think I will also start collecting links of no-code or little-code resources for future reference!  Enjoy.

 

SharePoint Roadshow – Omaha

By , February 11, 2012 1:48 am

A friend of mine, Cory VanDyke, works for Ricoh and asked me to spread the word about their SharePoint Roadshow that will be held at the Microsoft Seminar Facilities in Omaha on February 21, 2012. If you want more information on this, you can download the flyer here –  Omaha Flyer 2-12-2012.  Looks like a promising day of SharePoint goodness!

Here’s the agenda for the day:

OPERATIONAL EFFICIENCY BY ADOPTING MICROSOFT SHAREPOINT
10:00 am – 3:00 pm

DOCUMENT MANAGEMENT AND COLLABORATION DEEP DIVE
This presentation will dive into the critical tenets of enterprise content management.
10:30 am – 11:30 am

CHALK TALK – BRING THE PAIN
Luncheon discussion on the challenges you face and how SharePoint can be the solution
11:30 am – 1:00 pm

EXPOSING BUSINESS INTELLIGENCE IN SHAREPOINT
This presentation will dive into capabilities and implementation of business intelligence within SharePoint
1:00 pm – 2:00 pm

HOW TO CREATE INFORMATION WORKERS
This presentation will delve into SharePoint’s workflow engine and show how we can provide a platform for creating our own information workers to carry out tasks.
2:00 pm – 3:00 pm

LOCATION
Microsoft Seminar Facilities
2111 S. 67th St., Ste. 100
Omaha, NE 68106

Map to event

Live Example of my Org Chart/Site Map Mashup

By , December 13, 2011 10:15 am

If you have read my series on creating an Org Chart or Site Map using SharePoint lists, SPServices library, jQuery and the Google Charting API, I now have that solution posted online for you to see.

Go to: http://sharepoint.dipetersen.com/orgchart/default.aspx to see it in action! Try it in different browsers. Let me know what you think!

I’ll be speaking at SharePoint Saturday – Kansas City!

By , October 31, 2011 8:50 pm

I just received the confirmation letter that I will be presenting at SharePoint Saturday – Kansas City on December 10, 2011.  Come see my presentation and say hi!

 

I’m speaking at SharePoint Saturday – Twin Cities on Oct 29, 2011

By , September 20, 2011 10:59 am

I just found out I’ll be presenting my Mashup presentation at SharePoint Saturday – Twin Cities on October 29! Come see me and hopefully I’ll have some books with to sign!

Panorama Theme by Themocracy