3.7.0: NightConfig rejuvenated ✨
Major changes
FileWatcher
now comes with out-of-the-box debouncing, which improves the performance of autoreloading and autosaving configurations ⚡, see #148FileConfig
instances are now actually thread-safe and work better with autoreload, which should prevent most of the corruption issues 🛡️, see #152- A new Serialization/Deserialization framework is available in the
serde
package 🚀, see #163.
Unlike the oldObjectConverter
, the newObjectSerializer
andObjectDeserializer
are modular and extensible: you can register your own serializers and deserializers. Deserializers (config -> object) are chosen based on the generic type of the field to set and the type of the config value to deserialize. This allows for fine-grained deserialization. The oldObjectConverter
still works but is now deprecated. The goal is to remove the oldconversion
package in version 4.0.0.
Enhancements
- Allow multiple spec conditions to be checked by @vaperion in #151 (Note: this fix applies to the deprecated
conversion
package; the newserde
package supports multiple@SerdeAssert
conditions out of the box) - Support UTF-16 and UTF-8 BOM by @TheElectronWill in 68502b9
- In ConfigSpec and in the new
serde
Deserializer, automatically apply some "risky" conversions (e.g. long -> int) when it is not lossy, close #119 - Allow custom
Config
storage inConfigSpec
, by @PaintNinja in #168 - More unit tests, on Java 8, Java 11 and Java 17, by @TheElectronWill
Bug fixes
- toml: Fix squeezed Files by @Stein-N in #154
- toml: Align List ending when in a "group" by @Stein-N in #160
- toml: Allow header comments by @Stein-N in #162
- json: Disallow trailing data (configurable) by @TheElectronWill, close #167
- Multiple bugs have been fixed in
ObjectConverter
by @TheElectronWill in #163
Compatibility Note
NightConfig 3.7.0 is backward-compatible with previous releases, therefore I encourage you to upgrade your dependency on NightConfig in order to benefit from the new version.
Binary-wise, the backward-compatibility has been checked with japicmp
.
Source-wise, there is one small incompatible change: FileWatcher#addWatch
no longers throws an IOException
, which can result in a compiler error unreachable code
on the associated try/catch (example in forge).
New Contributors
- @vaperion made their first contribution in #151
- @Stein-N made their first contribution in #154
- @PaintNinja made their first contribution in #168
Thank you everyone!
Full Changelog: v3.6.7...v3.7.0