|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project are documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this |
| 6 | +project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The major version |
| 7 | +tracks Javalin's: 7.x targets Javalin 7.x. Releases up to 5.x predate this file. |
| 8 | + |
| 9 | +## [Unreleased] |
| 10 | + |
| 11 | +## [7.0.0] - unreleased |
| 12 | + |
| 13 | +The first release for Javalin 7 and graphql-kotlin 10. Everything under *Changed* and *Removed* |
| 14 | +is a breaking change; the README has a |
| 15 | +[migration guide](.github/README.md#migrating-from-5x) and `docs/adr` has the reasoning. |
| 16 | + |
| 17 | +### Added |
| 18 | + |
| 19 | +- Subscriptions are served over the |
| 20 | + [graphql-transport-ws](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md) |
| 21 | + protocol: `connection_init` / `connection_ack`, `ping` / `pong`, `subscribe` with an operation |
| 22 | + id, `next`, `error`, `complete`, and the close codes 4400, 4401, 4409 and 4429 (ADR-002). |
| 23 | +- Several subscriptions can run concurrently on one connection, each cancellable by id with |
| 24 | + `complete`, and all of them are cancelled when the socket closes or the server stops. |
| 25 | +- `disableGraphiQL()`, for an application that does not want to publish a schema explorer. |
| 26 | +- `Automatic-Module-Name: io.javalin.community.graphql`, so a modular application can |
| 27 | + `requires` the plugin ([#5](https://github.com/javalin/javalin-graphql/issues/5), ADR-004). |
| 28 | +- Architecture decision records under `docs/adr`. |
| 29 | +- Continuous integration: build and test on JDK 17 and 21 across Linux, macOS and Windows, |
| 30 | + plus detekt. |
| 31 | +- The published version is derived from the release tag. |
| 32 | + |
| 33 | +### Changed |
| 34 | + |
| 35 | +- Javalin 7.2.2, graphql-kotlin 10.2.0, JVM baseline 17. |
| 36 | +- `config.plugins.register(...)` is now `config.registerPlugin(...)`. |
| 37 | +- The context is graphql-java's map-like `GraphQLContext` instead of a type of yours, and a |
| 38 | + resolver reads it from the `DataFetchingEnvironment` rather than receiving it as a parameter |
| 39 | + (ADR-001). `GraphQLPluginBuilder` lost its context type parameter. |
| 40 | +- The context factories are now optional constructor arguments of `GraphQLPluginBuilder`, and |
| 41 | + the constructor is annotated `@JvmOverloads` so Java can leave them out. |
| 42 | +- `GraphQLPluginBuilder.add(...)` is now `addPackage(...)`, and at least one package is |
| 43 | + required. |
| 44 | +- Subscription resolvers return a kotlinx `Flow` instead of a reactive-streams `Publisher`; |
| 45 | + Reactor is no longer a dependency. |
| 46 | +- GraphiQL is pinned to 4.1.2 with React 18.3.1, both by version and by SRI hash, and its |
| 47 | + fetcher now points at the subscription WebSocket as well as the POST endpoint. |
| 48 | +- Payloads are parsed without graphql-kotlin's sealed types, so the plugin works with whatever |
| 49 | + `JsonMapper` the application configured (ADR-003). |
| 50 | +- The public API dependencies are exposed as `api` rather than `implementation`, so the |
| 51 | + examples in the README compile against the artifact. |
| 52 | +- The Kotlin sources moved from `src/main/java` to `src/main/kotlin`. |
| 53 | + |
| 54 | +### Removed |
| 55 | + |
| 56 | +- `GraphQLOptions`, together with `GraphQLPluginBuilder.create(options)` and the |
| 57 | + `GraphQLPlugin(options)` constructor. `GraphQLPluginBuilder` is the only entry point. |
| 58 | +- `middleHandler`, `wsMiddleHandler`, `setMiddleHandler`, `setWSMiddleHandler` and the |
| 59 | + `context` argument of `GraphQLOptions`: nothing ever read them, so a `middleHandler` set to |
| 60 | + authorize requests was silently dropped. Javalin's `before` and `beforeWs` do that job. |
| 61 | +- `GraphQLRun` — use `GraphQLRequestHandler.executeSubscription`. |
| 62 | +- `JavalinDataLoaderRegistryFactory` — use graphql-kotlin's `KotlinDataLoaderRegistryFactory`. |
| 63 | +- The ad-hoc 5.x WebSocket exchange (a bare query frame answered with bare result data). |
| 64 | + |
| 65 | +### Fixed |
| 66 | + |
| 67 | +- A subscription no longer pins a Jetty thread for its whole lifetime, and stopping the server |
| 68 | + cancels the ones still running instead of leaking their coroutines. |
| 69 | +- A malformed payload is answered with a 400 over HTTP and a 4400 close over WebSocket instead |
| 70 | + of a 500 or a dropped connection. |
| 71 | +- A resolver that throws is reported as a protocol `error` frame for its operation instead of |
| 72 | + tearing down the whole connection. |
| 73 | +- GraphiQL loaded unversioned scripts from a CDN, so it broke as soon as upstream released an |
| 74 | + incompatible major, and it requested a `renderExample.js` that does not exist. |
| 75 | +- Building the plugin without registering a package now fails saying so, instead of scanning |
| 76 | + the package `kotlin.Unit`, which is a class and matches nothing. |
| 77 | + |
| 78 | +[Unreleased]: https://github.com/javalin/javalin-graphql/compare/v7.0.0...HEAD |
| 79 | +[7.0.0]: https://github.com/javalin/javalin-graphql/releases/tag/v7.0.0 |
0 commit comments