First impressions after using the new SPFX 1.22.2 with Heft
Recently new version of SPFX framework was released and I wanted to try it. Luckily a small task came to me, and I decided to test it. I am satisfied with it, and I will write down benefits and disadvantages.
It took me some time to update my dev environment – node, typescript, Yeoman generator.
The required version of NodeJS is v22.15.1
Then updated Yeoman generator for SharePoint:
npm install @microsoft/generator-sharepoint@latest --global
The steps to create the app are almost the same, at least I didn’t notice anything special. For my project I created a new WebPart.
yo @microsoft/sharepoint

After scaffolding I noticed, that package.json contains 4 commands in NPM
"scripts": {
"build": "heft test --clean --production && heft package-solution --production",
"start": "heft start --clean",
"clean": "heft clean",
"eject-webpack": "heft eject-webpack"
},
Finally there’s no Gulp!!
Hot Reload
After adding the packages that I needed to (pnpjs, reactflow) and adding minimal details to the default files, I started it with "npm run start". It started pretty fast and the hot reload worked also pretty fast, but slower than previous versions with spfx-serve (https://markimarta.com/sharepoint/must-have-for-any-sfpx-solution/). It’s not actually good, especially if you must make a lot of work with styles and design.
I also faced a pair of times with an error, that I couldn’t understand and fix at all, but it was fixed after the restarting the “developer” mode (npm run start).
Debug
In the Terminal of VS code (I use only it for FrontEnd) there are very few messages that you have unused variables or methods. You can see only errors if they are. Almost no warnings. Probably you can update it in .eslintrc.js, but I didn’t have enough time to do it.
Build
You can build a solution even with Warnings! There will be written that there are warnings in the solution, but it if there are no errors, then it will be built. I can’t definitely say it it’s good or not, but it is. From my point of view it’s good, especially when you make a preliminary version of the app or may be a quick fix.
Fix the warning 'The value provided to Autocomplete is invalid' for MUI Autocomplete