8/2/2018 4:49 AM Understanding the SharePoint Framework and how it affects your JavaScript customizations Mark Rackley / mrackley@paitgroup.com Chief Strategy.

Slides:



Advertisements
Similar presentations
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Advertisements

Mark Rackley – PAIT Group –
Understanding Office MAC: What Windows Admins need to know
Build Client-side web parts for Microsoft SharePoint
How Windows 10 marks the end of Roaming Profiles
Microsoft Ignite /30/2018 9:28 PM BRK3174
Get an Introduction to the SharePoint Framework
Custom Functions in Excel
Microsoft Ignite /16/2018 3:12 PM BRK2119
Microsoft /23/2018 8:20 PM THR3038 Implement dev and test scenarios using Azure and Visual Studio Team Services Alex Mang Azure MVP © 2016 Microsoft.
Providing reliable SMB shares in Microsoft Azure
What's new in the world of SharePoint development and deployment
5/27/ :57 PM Tips & Tricks for Deploying and Managing Microsoft Dynamics 365 for Sales and Service Sean McNellis Shawn Dieken Dynamics 365 Principal.
3 Essential Tips for User Adoption of SharePoint and Office 365
Building Custom Application With Office Add-Ins for OneNote
Microsoft /4/2018 8:21 AM BRK3082 Build solutions and apps with Microsoft OneDrive API and Microsoft Graph API Ryan Gregg Principal Program Manger,
Microsoft Ignite /17/2018 4:41 AM BRK4016
Customizing the Start Menu in Windows 10
Optimizing Microsoft OneDrive for the enterprise
Azure Functions and Automation: The SQL Agent in the Cloud
Examine common architectures for hybrid identity
Upgrading from Full Trust Code to Add-in Model and SharePoint Framework Paolo Pialorsi Senior Consultant - PiaSys.com Track: DEV | Level:
Microsoft Ignite /6/2018 3:11 PM THR3055
Customizing the Start Menu in Windows 10
ASP.NET in Linux and Windows containers
Customize Office 365 Search and create result sources
Serverless Architecture in Azure
Working with the SharePoint Framework
Group Policy in MDM: Dealing with ADMX backed policies
Microsoft Ignite /13/2018 7:38 PM BRK2247
Troubleshooting Windows 10 Deployment: Top 10 Tips and Tricks
9/14/2018 2:22 AM THR2026 Set up secure and efficient collaboration for your organization with Office 365 Joe Davies Senior Content Developer Brenda Carter.
Advancing the SharePoint Developer Community (PnP)
How to run a successful user group
Monitor your Microservices with Application Insights
Introduction to SharePoint Framework (SPFx)
Understanding SharePoint Framework and Modern Development
Drive productivity with OneDrive and SharePoint file collaboration
Deploy Windows 10 Mobile for the mobile workforce
Microsoft Ignite /9/2018 5:03 AM BRK1010
Master Windows 10 Deployments - Expert Level
The Future of SharePoint Development - Vision, Strategy, and Roadmap
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Protect your OneDrive and SharePoint files on mobile devices
Meetup: Use Microsoft Technologies to Real World IoT Scenario
F5 WAF in Azure Security Center
Learn about PnP initiative and the new SharePoint Framework
Microsoft Ignite /20/2018 2:21 PM
Introduction to SharePoint Framework (SPFx)
Improve Office 365 Adoption: Top 10 Ways
Working with different JavaScript frameworks and libraries
Discover what’s new and what’s coming to SharePoint Modern Team sites
Introduction to SharePoint Framework
Learn how to make SharePoint Accessible and Inclusive
Office 365 Secure Score: Actionable Security Analytics
Can I get a side of OneDrive for Business with my SharePoint?
Meetup: Office 365 Developers
What query folding means to self-service BI projects
The SharePoint framework
Meetup User Experience Design for SharePoint
Ask the Experts: Windows 10 deployment, servicing, and provisioning
Microsoft Connect /28/2019 2:20 AM
Learn how to leverage the Microsoft Store for Education in your school
Choosing between Microsoft PowerPoint & Sway
Explore PnP Partner Pack for IT pros, admins and architects
4/16/2019 4:15 PM How Microsoft does IT: How Microsoft IT is embracing modern to build SharePoint experiences Sam Crewdson Senior Program Manager Rene.
Discussion Panel: Windows Server MVP Panel
Learn from MVPs: Panel Discussion on all Things SharePoint
Understand the impact of the future of SharePoint
OneDrive Unplugged A panel discussion on all things OneDrive
Presentation transcript:

8/2/2018 4:49 AM Understanding the SharePoint Framework and how it affects your JavaScript customizations Mark Rackley / mrackley@paitgroup.com Chief Strategy Office / PAIT Group © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Mark Rackley / Partner & CSO 20+ years software architecture and development experience Office 365 MVP, SharePoint Junkie since 2007 SharePoint Client Side Developer since 2009 Event Organizer of The North American Collaboration Summit (collabsummit.org) Blogger, Writer, Speaker Podcaster - Techsplaining www.paitgroup.com mrackley@paitgroup.com @mrackley

The Problem We’ve been creating awesome functionality using Content Editor and Script Editor Web Parts since SharePoint 2007. How can we reuse our scripts in the new SharePoint Framework without having to rewrite them all in TypeScript and without having to have a deep understanding of the SharePoint Framework?

Why is it a Problem? There is no native Content Editor Web Part or Script Editor Web Part for Modern Pages and Sites. End Users are altering scripts causing support nightmares. There’s not a good management and deployment story

The Solution! Convert your JavaScript solutions to the SharePoint Framework using the steps outlined in this session without having to be a SharePoint Framework guru.

The Benefits to using the SPFx! Use Properties for customizing solutions instead of changing the script (Keep power users out of the code) Better management and deployment story Works on both Classing and Modern Pages

Demo – Converting your CEWP Solution to the SharePoint Framework Mark Rackley © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

The Steps we walked through in the demo Copy script and css files to your SPFx project Add references to external scripts to Config.json Import and add appropriate changes to the main .ts file Take advantage of Properties to make your solution configurable by the users Package and deploy your solution

1. Copy script files to your SPFx project Copy your .js and your .css files to /src/webparts/webPartName folder (Optional) Copy our third party files to the same location if you do not wish to reference them via CDN.

2. Add references to Config.json Add to externals section of Config.json Add path to library Add globalName if other libraries are dependent Indicate globalDependies

2. Add references to Config.json "jquery": { "path": "https://code.jquery.com/jquery-1.12.4.min.js", "globalName": "jQuery" }, "flip": { "path": "https://cdn.rawgit.com/nnattawat/flip/master/dist/jquery.flip.min.js", "globalName": "jQuery", "globalDependencies": ["jquery"] }

3. Make changes to main.ts Import externals Add external css Add local .js and .css files Use the pageContext object instead of _spPageContextInfo

Import externals import 'jquery'; import 'flip'; declare var $;

Add external css import {SPComponentLoader} from '@microsoft/sp-loader'; SPComponentLoader.loadCss("<url to css file>");

Add local .js and .css files require('./PAITGroup.PromotedLinks.js'); require('./PAITGroup.PromotedLinks.css'); require('./masonry.pkgd.min.js');

Use the pageContext object this.context.pageContext.site.absoluteUrl

4. Take advantage of properties For the interface /src/webparts/<project>/<project>WebPartPartProps.ts For the labels in the property panel /src/webparts/<project>/loc/en-us.js /src/webparts/<projct>/mystrings.d.ts For default values /src/webparts/<project>/<project>WebPart.manifest.json To create the property panel /src/webparts/<project>/<project>WebPart.ts

A Couple of other gotchas

Use REST to get the Form Digest if needed var getDigestCall = $.ajax({              url: <site url> + '/_api/contextinfo',              method: "POST",              headers: { "Accept": "application/json; odata=verbose" }      })   data.d.GetContextWebInformation.FormDigestValue

Disable reactive property changes protected get disableReactivePropertyChanges(): boolean { return true; }

5. Package and deploy your solution Update “cdnBasePath” in writes-manifest.json gulp bundle –ship gulp package-solution –ship Upload files in /temp/deploy to CDN location Upload app package at /sharepoint/solution to app catalog Deploy your SharePoint client-side web part to a Azure Storage account https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/deploy-web-part-to-cdn

Source code https://github.com/mrackley/ignite2017

https://github.com/SharePoint 8/2/2018 4:49 AM https://github.com/SharePoint Mastering the SharePoint Framework http://www.voitanos.io © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Please evaluate this session Your feedback is important to us! 8/2/2018 4:49 AM Please evaluate this session Your feedback is important to us! The slide will be replaced onsite through Silver Fox Productions with an updated QR code. This slide is required. Do NOT delete or alter the slide. From your PC or Tablet visit MyIgnite at http://myignite.microsoft.com From your phone download and use the Ignite Mobile App by scanning the QR code above or visiting https://aka.ms/ignite.mobileapp © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8/2/2018 4:49 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.