You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rules_baton, a Bazel module under bazel/, versioned with Baton: a
toolchain its extension fetches from the release's artifact bundle,
selecting the variant for the execution platform, or from the compiler BATON_COMPILER names; baton_generate, the command with every input
and output declared, one output per source named as the SwiftPM plugin
names it, whose files a swift_library or a kt_jvm_library lists in
its srcs, with the report and the persisted documents file as output
groups; and baton_check_test, --check over committed output. docs/recipes/bazel.md is its page, in place of the genrule on the
command's contract page, and docs/decisions/a-build-integration-holds-no-logic.md records why a
shell holds no logic and wraps no library rule. Answers issue 40.
batonc generate --persisted <file> names where the persisted documents
file is written, as --shared and --report name theirs, so a build
system that declares its outputs before it reads baton.json can declare
this one; without it the file goes under --out, else beside the
configuration, as before. The contract page now also says that --schema
beside --config overrides the configuration's schema, and that any
source an --emit names gets a header-only output when it holds no
GraphQL, both of which the compiler already did.
The compiler's artifact bundle carries a static Linux binary for x86_64
and one for aarch64 beside the universal macOS one, listed under the
gnu triples a Linux host reports and built with the musl target, so one
binary runs on any distribution. SwiftPM on a Linux host and a Linux CI
runner take the compiler from the same bundle a Mac downloads; the
release workflow builds each on a host of its architecture, and CI builds
and runs them so a release is never their first build. The Linux half of
issue 40.
A subscription's stream that fails on its environment, as one with no
subscription transport does, ends with that failure as a request error
ends it, in both runtimes, instead of retrying on the backoff forever; retry() opens it again. A transport failure still reconnects on the
backoff.
The Kotlin host's marker is recorded in docs/decisions/the-kotlin-host-marks-a-document-on-the-composable.md:
a document is an annotation on the composable that renders, holds or
acts, written in a $$ raw string since $ is a template in Kotlin and
a variable in GraphQL; answers issue 6.
batonc writes Kotlin lenses: a @Stable class per fragment and per
operation's Data, equal by its anchor, with a property per field over
the anchor's readers and a companion of its checks; an @inline
fragment as a data class read once; a connection's state, loadNext
and refetch. A mutation gets its OptimisticResponse and a suspend operator fun invoke on its MutationAction. A generated enum's
case for an undeclared value is Undeclared, since Unknown and a
schema value UNKNOWN are one class file on a file system that ignores
case. The Kotlin runtime's tests now run every case of the manifest,
its records and its reads, through the code batonc generates from spec/sources.
The Kotlin runtime has its environment: the wire's Request and
standard encoding, a Transport whose one verb returns a Flow, the
handle with its fetch policies, its derived Phase and its Fetch,
roots with retention, ages, the verdict and collection, the
availability check, the heal, mutate, commitPayload, end() and
the value-free log; baton-testing holds the scripted, recorded and
silent transports. Every script of the manifest runs through it, to the
steps that wait for the image, the subscriptions and the optimistic
layers. A Kotlin operation's companion forwards its Data's fieldErrors and missingRequiredField, so the handle judges its data.
The Kotlin target refuses, with an error at the name, a field named Variable or Variables, and a fragment or an operation named like
what the generated Kotlin calls or declares where it names the class
(Unit, OptIn, JvmName, listOf, anchor, equals, fieldErrors, name, text, data, Data, invoke among them), for which it wrote
Kotlin that did not compile; it writes suspend, out and dynamic in
backticks. A corpus of Kotlin's hostile names, compiler/src/tests/hosts/HostileKotlinDocuments.kt, holds every
keyword and every name the generated Kotlin declares in every position
inside a document, and scripts/hostile-name-sweep-kotlin.py compiles
the names of fragments and operations with kotlinc.
The Kotlin runtime applies an optimistic response as a layer that a
commit rebases under, the server's answer replaces and a failure
reverts, notifying only what differs at the batch's end; holds a
subscription's stream in a SubscriptionHandle that reconnects by the
fixed backoff and parks while the environment is inactive; and loads a
connection's pages and refetches a fragment. Store is public, and Environment(transport, subscriptions, store) takes it, with a debug
flag that prints missing data until a log is set. Every script but the
image's relaunch runs whole, and every case's override reads under
its layer.
The Kotlin runtime keeps the store's image: Persistence(path) or Persistence.named(name), handed to Store(persistence), writes every
server batch behind the commit on a thread of its own, and the
availability check reads back what memory lacks, so a relaunch draws
its first screen from the last launch's data and ages survive it. The
schema, the versions, the eviction by launch, the names forgotten with
their rows and what never reaches the file are the Swift runtime's; the
file is reached through the AndroidX SQLite driver API, with the bundled
engine on the JVM alone. All twelve scripts run whole.
The Kotlin runtime speaks to a server and to Compose. HttpTransport
posts over HttpURLConnection, reading a deferred response's multipart/mixed parts and a subscription's graphql-sse events
through the common MultipartParser and EventStreamParser, credentials
per attempt, a request error answered as application/graphql-response+json as its GraphQLErrors; GraphQLTransportWebSocket speaks graphql-transport-ws over the JVM's java.net.http.WebSocket, one connection per transport; and Environment(url) makes an environment over HTTP. LocalBaton, rememberQuery, rememberMutation and rememberSubscription resolve
operation values in a composition, retained while the composable stays. kotlin/samples/desktop is a Compose for Desktop app over the Rick and
Morty API.
Generated Kotlin compiles for two shapes it did not: a fragment or a
field named like a plan's selection, selection0, which a lens read as
the selection, since the selections are now members of a private object
beside the operation's class, `HeroQuery-plan`, that no lens sees;
and an @inline fragment's value of some two hundred linked fields,
whose constructor passed the 64 KiB the JVM allows a method, since the
constructor now reads each field through a private function of the
value's companion, `read-name`.