Notice
Pre-releases are experimental versions that often contain unpatched bugs, work-in-progress features and rewritten implementations. If you don't consider yourself advanced user, please download latest stable release instead. Pre-release versions are dedicated to users who know how to report bugs, deal with issues and give feedback - no technical support will be given. Check out ASF release cycle if you'd like to learn more.
Changelog
Changes since V5.5.3.4:
- [!] ASF V6 comes with modern
System.Text.Json
replacement of previously used since the very first ASF version,Newtonsoft.Json
library. This is core foundation that ASF is based on - while it should be mostly transparent for end-users, it's breaking change for existing ASF plugins, and it also has far bigger scope than usual in terms of ASF codebase, hence V6 major version bump. If you're plugin creator, you can find notes below for technical details in regards to upgrade (@JustArchi #3145 #3061). - Latest ASF-ui with new features, improvements and bugfixes (@MrBurrBurr).
- Updated localization provided by our community (@JustArchi-ArchiBot).
- Usual amount of other core improvements, optimizations and bugfixes (@JustArchi).
Changes for plugin creators:
- V6 upgrade version may require more changes than usual, especially in regards to breaking changes that are not outright visible during compilation, as well as extensive testing.
OnASFInit()
andOnBotInitModules()
found inIASF
andIBotModules
plugin interfaces have changed the signature ofadditionalConfigProperties
fromJToken
toJsonElement
. If you're not using additional config props, change in signature is sufficient, otherwise, you'll need to correct existing usage a bit to the new API.- Apart from above, you should search for every
Newtonsoft.Json
reference in your code, and correct it as per instructions below. - Remove
<PackageReference Include="Newtonsoft.Json">
reference in all yourcsproj
files - there is no need for any other additional custom dependency for JSON parsing anymore. ASF uses STJ exclusively now, which means that your Newtonsoft attributes, if any, are ignored anyway - this is why code that compiles, but doesn't use STJ, might not serialize/deserialize properly in V6. - Drop
using Newtonsoft.Json
from each of yourcs
files, those files will need a correction. - Replace every
[JsonProperty]
you have with[JsonInclude]
fromSystem.Text.Json
namespace. - If your
[JsonProperty]
included custom property name, like[JsonProperty("custom")]
, add additional attribute,[JsonPropertyName("custom")]
. - If your
[JsonProperty]
was always required, like[JsonProperty(Required = Required.Always)]
, add additional attribute,[JsonRequired]
. - If your
[JsonProperty]
used disallowed nulls, like[JsonProperty(Required = Required.DisallowNull)]
, then either: -
- If it's non-nullable and you expect to always have a value there, add additional
[JsonDisallowNull]
attribute.
- If it's non-nullable and you expect to always have a value there, add additional
-
- If it's nullable, null by default, or null-allowed, don't add additional attribute, leave it as it is.
- If your property was
{ get; }
-only before, make it{ get; private init; }
instead. - If your field was
readonly
before, dropreadonly
and make it{ get; private init; }
instead. - If your property was
static
before, drop it, STJ doesn't serialize those, even if they're same for every instance. - If you're using custom parameterless constructor, including internal/private one i.e.
internal MyClass() { ... }
, ensure it's annotated with[JsonConstructor]
- this wasn't required before in Newtonsoft, but it's mandatory in STJ now. - If you've used
[JsonExtensionData]
, use the same attribute from STJ, add additional[JsonInclude]
and correctJToken
toJsonElement
- also remember about{ get; private init; }
. - If you've used
JsonConverter
before, useToJsonObject<T>()
,ToJsonText()
(and in rare occurances,ToJsonElement()
) helper methods from ASF namespace. You can also useJsonSerializer
with ASF-providedJsonUtilities.DefaultJsonSerialierOptions
.
Depending on how big your plugin is and what it does, you most likely won't have as much work as it might seem like from our notes above - we've included comprehensive guide to aid you with upgrade, but it's expected that majority of plugin developers will be fine just changing [JsonProperty]
to [JsonInclude]
, and maybe adding [JsonPropertyName]
on top of it.
Like you, we also needed to adapt all of our existing ASF code to STJ - this is why you can find a lot of examples of expected/required changes in our commit 6b0bf0f, feel free to use it as a reference in regards to notes above, and if you need help, remember you can always reach us through usual support channels, especially #dev-plugins
on our Discord server.
Support
ASF is available for free, this release was made possible thanks to the people that decided to support the project. If you're grateful for what we're doing, please consider a donation. Developing ASF requires massive amount of time and knowledge, especially when it comes to Steam (and its problems). Even $1 is highly appreciated and shows that you care. Thank you!