During summer there were two great PnP Summer Camps. In the second edition, I had the opportunity to demonstrate a cool looking web part. A web part that allows the user to edit the content directly on the page. Similar to the out of the box web parts but with a big difference. All the edit capability don’t use any fancy third party library.
[Read more]
Tips and Tricks working with SPFx library components
Following the instruction on how to create a library component, get you pretty easy up and running to try out this new feature.
To make it production-ready you have to do some manual steps and tweaks. Here are some suggestions.
Optimize your SPFx projects with React.lazy
SharePoint Framework offers you a pretty solid project setup, but on the other hand, it doesn’t give you options to optimise the gulp, build or the webpack configuration.
The more web parts exist in a single project, the slower the build task become and all the code in the project will be compiled at once, instead of smaller incremental builds. Technical possible but not yet supported.
The good thing is that there are some options you can directly trigger from your web part code. Some of these options affect webpack others can be applied in ReactJS. Not only in case of build times but also case of user experience and web part performance.
SPFx – Reference Webpack configuration – Web Part
The following configuration shows the webpack.js generated during the build process of a SPFx Hello World
wep part. References to fixed path in the generated webpack config were replaced with the default way of resolving path. ( path.resolve(__dir
).