Introduction to SharePoint Framework: The Nuts and Bolts


What is SharePoint Framework?

SharePoint Framework is a new page and web part model that provides full support for client-side SharePoint development with easy integration of SharePoint data and Microsoft Graph through open source tooling which enables the building of SharePoint customizations for mobile, on-prem, online and OneDrive for Business. With SharePoint Framework, modern web technologies and tools provide a development environment to build experiences and apps that are ready and mobile-ready from the start.

In the next 3 blog articles, I will be shedding some lights on the new Framework and how you can start preparing to adopt the new development platform.

SharePoint Framework is written in JavaScript which allows developers, both inside and outside of Microsoft, to use their preferred web developer tools to develop SharePoint and customized solutions. This is an incredible leap as this allows developers on any platform to extend SharePoint’s standard capabilities. In addition, SharePoint Framework accompanies the new SharePoint UX, which is designed for the world’s mobile-first, cloud-first communication era. By moving towards open source resources, not only has a new door for developers has been opened, but it is also creating a new relationship between developers and SharePoint, resulting in a complete win for the client.

By moving to open source, will SharePoint Framework solutions work on classic sites? The answer is simply this: eventually, on existing team sites, it will and on new modern team sites, yes it will. However, classic solutions will not work on the new modern team sites. Moving forward, it is highly advisable to become familiar with SharePoint Framework and the tools to prepare yourself when SharePoint Framework is released.

Let's talk Framework, Development and Scaffolding tools in my next article!

SharePoint Framework: Prepare Yourself!


The shift from Microsoft’s proprietary framework to the open source SharePoint Framework will require learning and adopting of new technologies on the part of developers. Luckily, what knowledge the developer has gained will still be useful since the new API will not replace any of the existing models. In my previous installment SharePoint Framework: The Nuts and Bolts, an overview of what SharePoint Framework consists of and how it works was explained. In this installment, the focus is on how to prepare for the release of SharePoint Framework.

Understanding how SharePoint Framework is built is the key to determining which new technologies to learn. For each Microsoft tool, there is an equivalent web stack. The following table outlines the comparable of each web stack for each Microsoft tool:

Web Stack

Microsoft Tool

Node.js

.NET framework

npm

NuGet

Yeoman

Visual Studio Project

TypeScript

C#

Gulp.js

MSBuild

Each webstack, just like each Microsoft tool, has a specific role in SharePoint Framework. We can break the web stack down into frameworks and user and application interfaces. Each tool can be found in the open source community, and in the community, many developers have contributed their own customized tools that are made available for others to use. The open source community is very collaborative, supportive and innovative.

Frameworks for Developing Web Apps:

Node.js is a runtime environment used for cross-platform development of applications and it uses the Google Chrome V8 JavaScript engine to interpret JavaScript. It uses an event driven, non-blocking I/O model rendering it lightweight and efficient for data-intensive, real-time applications that run across multiple devices.

npm is a node package manager developed for Node.js and is used to install node programs. It also simplifies the process of specifying and linking dependencies. npm is the largest ecosystem of open source libraries in the world. Developers can either build their own packages or use ones that are already available in the community.

Yeoman is the SharePoint Framework template engine which runs on top of Node.js. The templates used by the framework are downloaded from GitHub. The project structure with all the files and folders are created in Yeoman.

TypeScript is an open source language which was created by Microsoft and it is maintained by Microsoft. TypeScript is a typed superset of JavaScript. In Node.js, it compiles to plain JavaScript on any browser, host, operating system and in any JavaScript engine that supports ECMAScript 3 or newer. TypeScript is suitable for either client side or server side applications. For developers coming from C#, concepts like classes and objects are available in TypeScript, which makes it the easiest way to start developing with script languages. Other JavaScript libraries like jQuery will also work with the SharePoint framework, but importing them into the project is required.

Gulp is a task runner to automate processes built on Node.js. It keeps complex tasks manageable and simple and can be used to compile TypeScript or Less files, build web parts or uploading to the CDN.

User and Application Interfaces

React is a JavaScript library. It is used for creating user interfaces and expresses how your app, at any given point in time, should look. It automatically manages all UI updates when underlying data changes. As data changes, React conceptually hits the "refresh" button and updates the changed parts. React is about building reusable components and these components make code re-use, testing and separation of concerns simpler and streamlined.

ReST API (Representational State Transfer) is an interface that is provided by SharePoint. ReST API allows the performance of basic operations including creating, deleting, reading and updating through the exposure of all of the SharePoint entities and operations that are available in other SharePoint client APIs.

Office UI Fabric is the front-end toolkit that blends add-ins or apps seamlessly into Office including all web components, icons, fonts and styles used by Microsoft SharePoint and other Office applications. It is important to note that Office UI Fabric is not directly related to the SharePoint framework and it is not mandatory to use this to build the web parts. The advantage of implementing Office UI Fabric is the provision of familiarity to the end user – the Microsoft style of layout and application components.

As SharePoint continues to move in the direction of mobile, cloud based collaborative communication, the move to open source JavaScript in SharePoint Framework enables developers to extend SharePoint capabilities with creative, innovative and customizable solutions on the client side that is mobile ready and readily available across various devices and operating systems. In this position, SharePoint has created the opportunities for developers to share, create, innovate and sculpt the look and feel of SharePoint Framework.

SharePoint Framework: Developer and Scaffolding Tools


SharePoint Framework leverages commonly used developer tools and it does not dictate which JavaScript framework should be used to build the solutions. In the past, development of solutions was reserved to Visual Studio on Windows and developers primarily used C#. Communicating with SharePoint was done using SharePoint’s server API, or most recently, CSOM, JSOM or REST. The shift from a proprietary model requiring a significant amount of knowledge to a flexible and highly customizable framework was driven by huge customer demand for the need to customize SharePoint on-prem, online and in the Cloud. In addition, traditional farm based solution is incompatible with cloud based tools and technology. In order to continue moving forward with cloud based applications, a major change had to take place.

SharePoint Framework is highly customizable as it is entirely based on open source JavaScript. Its framework was developed in React as Microsoft chose to develop Delve and the new document library in React. Design and build is executed in the superset of JavaScript – TypeScript. TypeScript is then transpiled into JavaScript making development work more routine-based thus reducing coding errors. Though it is not mandatory that developers use TypeScript, though the investment of learning it will pay off in the long run, it should be noted that it is highly recommended that development of solutions should be done with TypeScript to ensure that customized solutions will be mobile friendly and looking great across all platforms during build and final release.

SharePoint Framework allows you to extend your existing tools and solutions while taking full advantage of exciting open source tools such as Yeoman, Gulp, Workbench, Node.js, GitHub and Angular while still maintaining the option to use Visual Studio, Visual Studio Code and Visual Studio Team Services.

Many open source tools have been available in the open source community for a number of years, but these tools are "new" in SharePoint Framework. Most notably are three products that are an integral part of SharePoint Framework and they each support the framework in the following capacities:

Yeoman is the scaffolding tool for web applications. With Yeoman, developers can create project structures that facilitate the use of custom functionality. This in turn allows developers to work faster.

Gulp makes development efficient through the leveraging of a wide variety of plug-ins to perform repetitive development tasks, automate minification and perform compression.

Workbench allows the developer to test new web parts and apps before migrating them to production environments by replicating SharePoint as a local and offline environment.

SharePoint Page Experience

As a core component, the modern SharePoint Page has a notably developer friendly page structure. Pages can be constructed by using any client-side JavaScript templating framework and can be technologically independent. This page structure provides the ability to host web parts, add-ins and new opportunities.

The framework provides a page layout that is responsive and mobile-ready. Each page has a "Chrome" structure that surrounds the page body. This section contains the out of the box logic supplied by Microsoft plus additional developer logic that has been built on top of it. Simply put, it contains your business context. This Chrome layer manages the presentation of the page so that it displays appropriately on the device whether it be desktop, tablet or smartphone.

The Page Body becomes the canvas where web parts, apps, files, Delve components and other elements can be placed and arranged according to business needs. By layering this on top of the Chrome layer, there is no need to worry about proper display presentation on different devices. The Page Body is where the developer mostly lives, interacting with anything that has been built and placed here. The developer, regardless of skill level, is able to customize SharePoint pages by adding any build that has been placed on the canvas by clicking on a plus sign, selecting and placing the components.

Through this process, developers will be able to extend the capabilities of SharePoint more efficiently, reliably and quickly, and best of all, if you follow the rules, it will be mobile ready and responsive right from the start.

As SharePoint Framework has not yet been released, the question of how do we prepare for it begs to be asked. Stay tuned as I answer this question in the second installment of The New SharePoint Framework: Prepare Yourself!