1.6.4 (2023-02-03)
Bug Fixes
- only hoists localized values if localization is enabled (8c65f6a)
Tag Name: v1.6.4
Release Date: 2/3/2023
Payload CMSPayload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.
This release significantly improves file upload capabilities by adding support for the express-fileupload middleware's useTempFiles and tempFileDir options, allowing for more efficient handling of large file uploads. It also fixes a bug where localized values were being hoisted even when localization was disabled. This update is particularly valuable for developers working with media-heavy Payload CMS implementations.
express-fileupload middleware's useTempFiles and tempFileDir optionsNo migration is required for this release. The new file upload features are opt-in through configuration options.
If you want to take advantage of the improved large file upload support:
export default buildConfig({
// ... other config
upload: {
useTempFiles: true,
tempFileDir: '/path/to/temp/directory', // Optional, defaults to os.tmpdir()
}
})
Note that if you were relying on the previous behavior where localized values were being hoisted even when localization was disabled, you may need to update your code to account for the fixed behavior.
This is a recommended upgrade for all Payload CMS users, especially those who:
The upgrade should be straightforward with no breaking changes. Simply update your package with:
npm install [email protected]
# or
yarn add [email protected]
If you're experiencing memory issues with large file uploads, consider enabling the new useTempFiles option in your configuration after upgrading.
The primary feature in this release is the improved support for large file uploads:
express-fileupload Options: Added support for the useTempFiles and tempFileDir options from the express-fileupload middleware.useTempFiles option, allowing large files to be stored temporarily on disk rather than in memory.These improvements allow Payload to handle much larger file uploads without running into memory limitations, which is particularly useful for media-heavy applications.
No specific security fixes were mentioned in this release.
useTempFiles option, this release significantly reduces memory usage when handling large file uploads. Instead of loading entire files into memory, they can now be processed from temporary files on disk.This release primarily impacts file upload functionality in Payload CMS, making it more robust and efficient for handling large files. The addition of support for useTempFiles and tempFileDir options from express-fileupload allows developers to process large files without loading them entirely into memory, which can prevent out-of-memory errors on servers with limited resources.
The fix for localization value hoisting ensures that the system behaves correctly when localization is disabled, which improves the predictability of the CMS behavior.
Overall, this release enhances Payload's capabilities for media-heavy applications while maintaining backward compatibility. The changes are particularly beneficial for sites that handle large media files like high-resolution images, videos, or documents.