Skip to content

Releases: AVSystem/scala-commons

v1.28.2

13 Jul 13:58
Compare
Choose a tag to compare

Introduced TypeString and JavaClassName - platform-independent, serializable, macro-generated typeclasses that hold full textual representation of a Scala type (TypeString) and fully qualified class name of a Java class corresponding to a Scala type (JavaClassName).

v1.28.1

26 Jun 10:26
Compare
Choose a tag to compare
  • Introduced SealedUtils.instancesFor macro which lists instances of some typeclass for every case class (non-abstract subclass) of a sealed hierarchy
  • Introduced @showAst annotation which works similarly to .showAst extension macro but can be used on definitions (classes, objects, members) instead of just expressions. However, it requires commons-analyzer compiler plugin to be enabled.

v1.28.0

13 Jun 15:43
Compare
Choose a tag to compare

Generalized RPC framework - #57

This is an overhaul of RPC macro engine and overall RPC design. Compatibility with previous version is not preserved but RPCFramework is kept as legacy glue code. Porting old usages of RPCFramework to new version should be relatively easy as incompatibilities are not big:

  • Signature of raw methods (fire, call and get) has changed - it takes RPC name in separate parameter list and arguments as List[RawValue] instead of List[List[RawValue]]
  • RPCMetadata API changed - there is separate metadata map for every method type (procedure, function, getter).

Changes in GenCodec and serialization

Breaking changes:

  • HasGenCodec redesigned. MacroCodec[T] removed in favor or MacroGenerated[GenCodec[T]]. HasGenCodec is now more flexible - previously it didn't work for case classes with default parameter values or sealed traits with subclasses in companion object. This was caused by overzealous validation done by the compiler on super constructor arguments - they cannot refer to the object being constructed. Materialization of MacroGenerated is now able to work around this.
  • GenCodec.Auto has been deprecated and will be removed
  • Input and Output now support BigInt and BigDecimal natively - #69

Other changes:

  • @whenAbsent for providing default values for case class parameters used only during deserialization
  • Macro materialization works sealed refined types - #67
  • Macro materialization works for case classes with more than 22 parameters - #62
  • Fixed recursive materialization of flat sealed hierarchies - #63

v1.27.8: Merge branch 'redis-init-rc-fix' into HEAD

14 Jun 09:46
Compare
Choose a tag to compare

Fixed race condition in RedisClusterClient initialization that caused it to sometimes not initialize at all.

v1.27.1

27 Apr 11:22
Compare
Choose a tag to compare

Breaking changes:

  • Field order preservation requirement for Input/Output has been relaxed - instead of preserving field order, ObjectInput may provide implement (override) peekField for random field access

v1.27.0

27 Apr 11:13
Compare
Choose a tag to compare

Breaking changes:

  • BsonRef is now parameterized by entity type and also wraps an actual getter from entity type to referred type
  • Automatic GenCodec for Map[K,V] that uses list-of-key-value-pairs encoding (where no GenKeyCodec[K] is available) has been removed

v1.25.3

08 Dec 17:15
Compare
Choose a tag to compare

New features in commons-spring

  • ScalaParameterNameDiscoverer - a ParameterNameDiscoverer implementation which uses Java 8 reflection to obtain parameter names or falls back to Scala runtime reflection when under older Java or when parameter names are not present in bytecode
  • ScalaDefaultValuesInjector - a BeanFactoryPostProcessor implementation which injects default values of Scala constructor and factory method arguments into bean definitions if they are lacking.

v1.25.2

06 Dec 08:16
Compare
Choose a tag to compare
  • GuavaUtils trait renamed to GuavaInterop, its companion object extends it
  • JavaInterop no longer mixes in GuavaUtils
  • dependency on Guava in commons-core (JVM) is optional

v1.25.0

06 Dec 07:09
Compare
Choose a tag to compare

commons-core full cross project

  • Modules commons-shared (previously cross compiled to JVM and JS) and commons-core (previously JVM only) have been merged into a single cross compiled module commons-core. Therefore you must replace your dependencies to commons-shared with commons-core.
  • Removed BasicJavaInterop, implemented JavaInterop separately for JS (without Java 8 stuff which is unavailable in ScalaJS)

v1.24.1

06 Dec 08:14
Compare
Choose a tag to compare

ValueEnum

ValueEnum is a new way for defining Scala enums, representing enum constants as final vals in companion object of enum class.

Advantages:

  • feature parity with Java enums (although ValueEnum does not extend java.lang.Enum)
  • every enum constant has name (name of the final val that declares the constant) and ordinal (zero based index of enum constant, consistent with declaration order).
  • less boilerplate than sealed hierarchy based enums
  • it's possible to declare many enum constants in a single line of code
  • much less generated classes, which is advantageous primarily for JS size reduction

Disadvantages:

  • scalac exhaustive pattern match checking does not understand ValueEnum which may result in both lack of correct warnings and incorrect warnings
  • each enum constant can't have its own API (unless through implicit classes)