Configurate v4.0.0 Release NotesRelease Date: 2020-11-14 // over 2 years ago
🚀 Welcome to a new major release of Configurate! We've taken the time to review a lot of longstanding pain points, so there are a variety of breaking changes in this release. Some of the behaviour changes can be subtle, so please read the changelog carefully.
🚀 To ease upgrading for IntelliJ users, a migration XML file has been attached to this release. This can be imported as IDE settings, or placed in your
🆕 New features
- ➕ Added
- ➕ Added new
TypeSerializerCollection.Builderto register serializers for only a single type and not its subtypes.
- ➕ Added Java 14+ record support and many other features to the object mapper (see below for more details).
- ➕ Added new submodules to integrate with Mojang's DataFixerUpper library (versions 2-4), with a
DataFix-using transformations, and conversions between
- 👉 Make more extensive use of a unified
NodePathacross the whole API, for operations like resolving nodes and specifying transformation paths.
- 📇 Redesigned the exception structure of the project, so all configuration operations throw exceptions that extend from
ConfigurateException, which provide more machine-readable metadata.
IOException, so existing error handling may not break.
- ➕ Add new
NodeFactoryinterface to provide a common view for creating configuration nodes.
- 👍 Limited support for reading
YAMLfiles indented with tabs.
- ➕ Added a new "representation hints" system for attaching arbitrary metadata to nodes.
- ➕ Added support for "implicit initialization" in
TypeSerializers. This will, for collection types, resolve
nullnode values as empty collections. Implicit initialization is enabled by default.
💥 Breaking changes
- 📦 Moved from
- 📦 Moved type serializers from
- 📦 Made node implementation classes package-private, and moved the attributed and commented node subtypes out of their own packages.
- ⬇️ Dropped the
setprefixes from method names across the API.
- No longer depends on the Guava library. This has resulted in a lot of code that formerly used the Guava
TypeTokenmoving to use either
java.lang.reflect.Typeor the GeAnTyRef
- 🔧 Renamed
- 🔧 Renamed
- 🔧 Moved Guice support out of
- 🔧 When loading a configuration file, empty lists and maps are represented as such in nodes in all loaders. In the past, some loaders have provided
CommentedConfigurationNodeinstances, in preparation for full comment support coming in a future release.
- 🔧 In the
HOCONloaders, the underlying libraries used are now to be treated as an implementation detail. All API that directly referenced them has been replaced with equivalents that use Configurate types.
- 🔧 The default
shouldCopyDefaultshas been set to
- 🚚 The deprecated node walker has been removed.
The object mapper has changed quite a bit, so most users will need to change their use in some way.
- 🔨 Refactored
TypeSerializerCollectionto be immutable. A new child collection must be created to add custom type serializers.
- 🏗 Redesigned the object mapper to be more extensible. Rather than subclassing the object mapper as some people did before, there are now defined extension points where additional annotations and behaviours can be registered. See the methods in
ObjectMapper.Factory.Builderfor a more thorough overview.
- ➕ Added support for Java 14+ records and, in combination with the
@Settingannotation is now optional. By default, all non-transient fields will be included in objects, and names will be converted to the
kebab-casenaming scheme. Both of these can be customized with a custom
- 0️⃣ The
shouldCopyDefaultsoption is now respected for mapped object fields.
- 🏗 The
ObjectMapperFactoryfield has been removed from
ConfigurationOptions. Instead, the object mapper can be registered like any other type serializer, using the
🐛 Bugs fixed
- 🚚 Create the parent directory of files being written, to remove a common 'gotcha'.
- Try to group together events in the watch service listener, to reduce duplicate reloads.
- 🛠 Fix merging values into a virtual node not correctly attaching the node (#181)
- ➕ Added
Previous changes from v3.7.2
🛠 This is a bugfix release for the Configurate 3.7 series, coming with a few minor fixes:
- 🔧 Work around null values appearing when visiting configuration nodes
- Be more defensive when potentially returning null lists
Compiled jars are available from Maven Central