In this week’s newsletter, I’ll dive into the challenge many SharePoint Framework (SPFx) developers when it comes to code sharing across multiple projects. Duplicating code can lead to maintenance and performance issues, making it crucial to find the right solution.

Discover two options for externalizing code and sharing it across projects, each with its own advantages and disadvantages. I provide an in-depth analysis of the unique aspects related to SPFx solutions and explore the challenge of code reuse across projects.

Explore the benefits and drawbacks of SPFx Library Components, introduced in SPFx v1.9.1. These components allow for independent versioning and seamless consumption by any SPFx component. I’ll share their advantages, such as a simplified development process and no extra deployment steps.

But that’s not the whole sharing story, as you should also consider the alternative (and my preferred) option of leveraging NPM packages, a standardized approach for code sharing in JavaScript-based projects. Uncover the advantages of using NPM packages, including reusability, independent versioning, and automated testing capabilities.

Gain insights into how to use NPM packages effectively in SPFx solutions. Discover the process of externalizing a common package's bundle and hosting it in a CDN. I’ll include the steps to configure your project to externalize referenced packages in your SPFx projects, ensuring optimal performance and code management.

Use NPM Packages, not SPFx Libraries
I’ve never used or found a need for an SPFx library components. There's simply no need for a SPFx-specific solution to a problem that has already been solved with NPM packages.

Learn more about using NPM packages instead of library components in your projects from this week's article! 👇

My Mastering the SPFx course was nominated as a finalist for the best online course by ESPC!

The European SharePoint Conference, held in Amsterdam at the end of November, has nominated my Mastering the SPFx course for their best online course award!

🍿 Click Worthy Things

💬 Visually build Microsoft Graph webhook notification subscriptions. Tom Morgan, Microsoft 365 Developer MVP, created this web app to build a Microsoft Graph notification webhook subscription generator, simplifying the process of creating webhook subscriptions.

🏃‍♂️Handle long-running ops with Microsoft Graph’s support for middleware. In this article, Microsoft’s Waldek Mastykarz shows how you can use the Microsoft Graph’s support for middleware to handle long-running operations to keep your main code flow clean and make the logic available throughout your app without repeating the code.

Would you be interested in working with me to learn Microsoft Teams app development faster to be the irreplaceable expert delivering more to your customers?

I'm looking for 10-15 full stack developers to join me in a new interactive course and coaching program on Microsoft Teams app dev... interested?

I'm half-way through teaching the first pilot of the course and in the next few weeks I'll have a lot more to share about it, but I wanted to give my newsletter subscribers the first chance at the limited seats. So here's your chance!

Just reply or email andrew@voitanos.io that you're interested to learn more about my Microsoft Teams app dev group coaching program and I'll follow up with you!

The Full Stack Dev's Microsoft 365 Playbook

Andrew, a 19-year recipient of Microsoft's MVP award, helps full-stack developers efficiently build Microsoft 365 apps through pragmatic mentoring and self-paced courses. Join 8,000+ developers and receive his bi-weekly newsletter filled with insights on Microsoft 365 and Azure topics.

Read more from The Full Stack Dev's Microsoft 365 Playbook