Configurate v3.7 Release Notes

Release Date: 2020-05-26 // almost 4 years ago
  • ๐Ÿš€ After a long wait, v3.7 is finally here. The biggest feature in this release is the ConfigurationReference system and associated ability to automatically reload configurations, but it also contains a variety of bug fixes and deprecates some methods in preparation for 4.0. There is now also a collection of idiomatic Configurate examples included in the repository, under the configurate-examples folder that can be referenced for inspiration on how to effectively use the library.

    โž• Additionally, up-to-data Javadocs are now published at https://configurate.aoeu.xyz! It's been a while since javadocs were last updated, so the new revision brings a lot of improvements.

    ๐Ÿš€ Thanks to @kashike for contributions to this release

    ๐Ÿ—„ Deprecations

    • ๐Ÿ”ง All set* methods in ConfigurationOptions have been deprecated, to be replaced with equivalent methods starting with with___.
    • Accessors in TypeSerializers have been moved to TypeSerializerCollection, and register ____ methods have been renamed to register
    • ๐Ÿ”ง Modifying the global TypeSerializerCollection is deprecated behaviour. Any configurations that need custom type serializers should create their own child of the default collection and add to that.
    • ๐Ÿ”ง ConfigurationNode.getAppendedChild() should be replaced with ConfigurationNode.appendListNode()
    • hasListChildren() and hasMapChildren() should be replaced with isList() and isMap() to more effectively express that they reflect the type of the node, not whether it has contents.
    • ๐Ÿ“ฆ As root node creation methods have been moved to the node interface, usage of the Simple* nod implementation classes is deprecated. They will be made package-private in 4.0.
    • ๐Ÿ”ง ConfigurationNodeWalker has been deprecated, to be replaced with the new more structured ConfigurationVisitor API.
    • ๐Ÿšš ValueType will be removed in 4.0. Its functionality is already covered by existing methods.

    โž• Added

    ๐Ÿ†• New configuration and value reference system for automatically reloading configurations

    ๐Ÿ†• New module configurate-ext-kotlin with some basic utilities for using Configurate in Kotlin

    ๐Ÿ†• New module configurate-tool is a CLI tool to inspect configurations loaded through Configurate loaders`

    ๐Ÿ†• New module: configurate-bom can be imported to centralize Configurate version declaration across a project

    ๐Ÿ”ง loader: Automatically create parent directories when trying to write a configuration

    ๐Ÿ”ง objectmapping: New TypeSerializers for arrays, chars, Sets, and ConfigurationNodes

    core: New method isEmpty() to determine if a node has contents, or exists but with an empty value.

    ๐Ÿ”ง core: New act method on nodes that takes a Consumer<ConfigurationNode> to perform an action on the node

    core: New setCommentIfAbsent method on CommentedConfigurationNodes

    core: Abstract TypeSerializer implementations added for Scalars and objects read from list nodes

    ๐Ÿ— loader: Added functional helper methods for changing options and options' TypeSerializerCollection when building a loader

    core: New getNode(Iterable<?>) method will work the same as getNode(Object...), but allow looking up nodes without having to convert existing collections to arrays.

    core: AttributedConfigurationNode now extends CommentedConfigurationNode

    xml: Load and save comments

    ๐Ÿ”ง all: Configurate jars now include their license for easier compliance

    ๐Ÿ›  Fixed

    • objectmapping: Preserve comments on map keys when round-tripping data through the type serializer for Maps
    • ๐Ÿ”ง gson: Correctly ignore null values in JSON files loaded from the Gson configuration loader
    • objectmapping: Resolve type parameters in fields. For example, in a class class MyConfig<T> { @Setting private List<T> items;, the list will be appropriately resolved as long as new object mapper factory methods that accept TypeTokens are used.
    • ๐Ÿ‘ป objectmapping: Correctly reject interface types from being passed to ObjectMappers rather than throwing an exception
    • ๐Ÿ”ง objectmapping: Preserve configuration options when deserializing map keys
    • hocon: Read empty lists as empty lists, to match behaviour when reading maps.
    • loader: Don't read whole line to determine if file contains header. Resolves issues exceeding the mark limit on extremely long first lines, or files without line breaks (minified JSON, for example)
    • ๐Ÿ”ง objectmapping: The TypeSerializer for subclasses of Number will now attempt to coerce values to types native to the destination configuration when serializing.
    • core: AttributedConfigurationNodes will now be attached as soon as attributes are set on them.
    • ๐Ÿ”ง core: The root configuration node's path is the empty array, and getPath() has been corrected to return this.

    ๐Ÿš€ Releases are available on the Sponge maven repo, and all configurate components are contained within the configurate-tool distribution attached to this release.