Comments (6)
borer derivation is intentionally not fully "auto-magic", because this often leads to issues down the road.
See this ticket for example: softwaremill/magnolia#79
Consider this snippet for example:
case class Foo(int: Int, qux: Qux)
case class Bar(qux: Qux)
case class Qux(...)
If deriveCodec[Foo]
would automatically also derive the codec for Qux
then this Codec[Qux]
wouldn't be visible during derivation of Codec[Bar]
! Which means that deriveCodec[Bar]
would generate Codec[Qux]
again!
And you wouldn't see this duplication anywhere!
In this small example this might not be an issue but for large model hierarchies these kinds of invisible duplications can create huge amounts of code, that takes a long time to compile and can create a number of strange issues.
In our experience it's indeed better to manually cache codecs for all types in implicit vals
, which takes only a single line.
This results in the minimal amount of code, fastest compilation and runtime performance as well as full transparency on which type classes are actually available and which aren't.
from akka-serialization-helper.
Let's assess https://github.com/plokhotnyuk/jsoniter-scala in this context
from akka-serialization-helper.
Let's assess https://github.com/plokhotnyuk/jsoniter-scala in this context
Hmm...
Jsoniter philosophy seams difrent form Borer.
JsonValueCodec[A]
is "fat". It contains all information required to serialize and deserialise class.
Borer's codeces are more like layers. One codex feeds into another, breaking down object into simpler and simpler elements.
from akka-serialization-helper.
Hmmm okay but jsoniter claims that it can cooperate with Borer somehow (generate Borer-compatible codecs?)... this is probably going to be useful for our use case (?)
from akka-serialization-helper.
@sirthias can you think of any ready solution here? Like jsoniter-scala or sth else Magnolia-based?
from akka-serialization-helper.
Okay, that's a valuable point... so maybe we @MarconZet should not go down this rabbit hole indeed, and instead focus on #5 to prevent runtime errors
from akka-serialization-helper.
Related Issues (20)
- Add `verbose` logs to Codec Registration Checker Compiler Plugin
- Set sbt keys for all `ashSerializabilityCheckerCompilerPlugin` flags
- Update `AkkaCodecs` usage in `examples/`
- Add support for Scala 3 HOT 1
- Enable security reports from `Dependabot`
- Fix critical Log4J vulnerabilities HOT 1
- Support for `Laguna` - add persistence schema checks to CI
- Support for `Laguna` - tidy up the mess with multiple ASH cache directories
- Updata scala versions to `2.12.17` and `2.13.9`
- In README document jackson ScalaObjectDeserializerModule HOT 2
- Support for native serializable types and/or exclusions HOT 14
- Support for `Laguna` - fix persistence schema check in CI HOT 1
- Question, adding many options HOT 3
- `OverlappingFileLockException` from `SerializerCheckCompilerPluginComponent$$anon$1.interactWithTheCacheFile` HOT 15
- `spray.json.JsonParser$ParsingException: Unexpected end-of-input` at `PersistenceSchemaWriter`
- Untangle file access in codec-registration-checker-compiler-plugin
- Pekko support HOT 2
- Snapshots are published for each Scala minor version
- Snapshots are published as `0.0.0+...` version, regardless of the latest tag
- Restore Scala Steward (?) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akka-serialization-helper.