Skip to content

Conversation

rbygrave
Copy link
Contributor

@rbygrave rbygrave commented Dec 8, 2024

This is a Breaking change - e.g. the Exception types + JsonReader/JsonWriter move into io.avaje.json

Not 100% sure if this is a good idea yet, the thinking here is:

  • Split the avaje-core / stream API off into a separate module (avaje-json)
  • Some libs only need to depend on avaje-core (can use JsonReader/JsonWriter explicitly themselves)
  • Kinda mirrors the split in Jackson between Jackson-core and Jackson-databind

Splitting them means that avaje-core becomes ~95kb and avaje-jsonb ~135kb

Breaking changes / Renames:

  • io.avaje.jsonb.JsonReader -> io.avaje.json.JsonReader

  • io.avaje.jsonb.JsonWriter -> io.avaje.json.JsonWriter

  • io.avaje.jsonb.spi.PropertyNames -> io.avaje.json.PropertyNames

  • io.avaje.jsonb.stream.JsonStreamAdapter -> io.avaje.json.stream.JsonStream

Constructors to Builder

  • io.avaje.jsonb.stream.JsonStream -> renamed to CoreJsonStream and no longer public. MUST use io.avaje.json.stream.JsonStream.builder() to build and can no longer use constructors

@rbygrave rbygrave self-assigned this Dec 8, 2024
Copy link
Collaborator

@SentryMan SentryMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't see anything wrong with the PR from a technical perspective

@rbygrave
Copy link
Contributor Author

rbygrave commented Dec 8, 2024

When I look at code that we write [manually without jsonb generator] like - https://github.com/avaje/avaje-jsonb/pull/293/files#diff-1e05e375a32827a80ed685aa0e6417a8c5de55ef81aff992486bab633fe064cb

... this makes me ponder if a JsonAdapter like interface should exist in avaje-core? ... with implementations for the basic types such as string, long, double, boolean, map? and list? ... with the view that it should be easier to constructor your own JsonAdapter manually using those basic building blocks?

That is, should JsonAdapter be in avaje-core? [minus the ViewBuilderAware and Factory] ... and some of the basic implementations like stringAdapter etc?

… ViewAwareBuilder

This will allow moving JsonAdapter to the core module and leave the ViewAwareBuilder "trait" in jsonb.

It's less "tight" doing things this way but it does allow the JsonAdapter to live in a separate module from ViewAwareBuilder.
@rbygrave
Copy link
Contributor Author

rbygrave commented Dec 9, 2024

Ok, good to go with this now. Overall pretty happy with the result, I think it makes decent sense.

@rbygrave rbygrave added this to the 3.0 milestone Dec 9, 2024
@rbygrave rbygrave merged commit 5b39c69 into main Dec 9, 2024
9 checks passed
@rbygrave rbygrave deleted the feature/split-json-core branch December 9, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants