As you might have in the previous blog post I'm a huge fan of the Focal Point Cropping of Rob Habraken. Earlier this year, he released the new React version of the tool. I've done some groundwork to help Rob get started.
Last month he released his latest version of the tool. Here's a summary of what he has changed:
- Compatibility and Security: The new release is tested and compatible with the latest version of Content Hub, which now auto-updates. It also addresses security concerns by eliminating vulnerabilities and updating outdated dependencies in the npm setup.
- Improved Focal Point Management: A new feature has been added that allows users to identify who set the current focal point on an asset. This is particularly useful for larger content teams, enabling them to optimize focal points for specific uses. Information about the user who set the focal point is now stored in the Asset schema, along with a label displaying this information below the focal point editor. The 'modified by' field is also updated when the focal point is removed.
- Dependency Updates: The npm packages used in the module were behind on updates. The developer has addressed this by updating packages, handling deprecated properties, and addressing breaking changes. Notably, the module now works with Node.js 18. Several package updates have been made, including transitioning from Material UI 4 to MUI 5, React 17 to React 18, TypeScript 4.9 to 5.1, and HTTP Server 0.12.3 to 14.1.1.
- Webpack Configuration: The webpack.config has been refactored to remove the esm-webpack-plugin, following guidance from Sitecore documentation. Additionally, optimization settings have been adjusted to minimize the build output, making certain packages like css-loader and style-loader redundant.
- Material UI Upgrade: The Material UI hierarchy has been restructured, adhering to migration instructions for moving from MUI v4 to v5. This simplifies the output of React components and ensures a smoother transition, even though the original module referenced two versions of MUI.
Overall Clean-Up: The developer has successfully addressed version discrepancies, dependencies, and code structure issues, resulting in a clean and efficient project. The module now runs on Node 18 LTS, is free of vulnerabilities (at present), and is optimized for performance.
These updates enhance both the functionality and security of the Focal Point Cropping module, making it a more robust and reliable tool for marketers and developers working with Sitecore Content Hub. You can find the new release on the developer's GitHub account for further details and implementation.
Be sure to check out Rob's blog with more Sitecore topics.