Skip to content

Prepare for 1.0.0: JS/Native cross-build, MiMa, declaration-order eval, publishing hygiene - #3

Open
stivens wants to merge 1 commit into
mainfrom
prepare-the-1-0-release
Open

Prepare for 1.0.0: JS/Native cross-build, MiMa, declaration-order eval, publishing hygiene#3
stivens wants to merge 1 commit into
mainfrom
prepare-the-1-0-release

Conversation

@stivens

@stivens stivens commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Motivation

Preparation for the 1.0.0 release. A 1.0 freezes both the API semantics and the binary
interface, so this PR settles the one arbitrary runtime semantic (eval ordering), cleans up
what the published artifact exposes to users (dependencies, resolvers), puts the machinery in
place to keep the 1.x line binary-compatible (MiMa + early SemVer), and widens the audience
with Scala.js and Scala Native artifacts — nearly free for a compile-time-only library.

Changes

eval now runs handlers in field declaration order

Previously handlers ran in alphabetical order of field name — an arbitrary choice that would
have been frozen by 1.0. Handlers now run in the declaration order of the source type's
primary-constructor fields; handled non-constructor fields (body vals) come last, in
registration order. The contract is documented on CaseComplete.eval and in the README, and
pinned by tests that distinguish declaration, alphabetical, and registration order.

Internally, compileImpl already knows the field order at expansion time, so the emitted code
now passes a single pre-ordered List[SOURCE_TYPE => TARGET_TYPE] to CaseCompleteImpl,
replacing the name-keyed Map + runtime sort. getHandledFields preserves registration order
to support this.

⚠️ Behaviorally breaking vs 0.3.0 for anyone relying on the alphabetical order — intentional,
and the reason this lands in 1.0.0 rather than after it.

Cross-build for Scala.js and Scala Native

The build is now an sbt-crossproject (CrossType.Pure at the repo root) targeting JVM,
Scala.js 1.x, and Scala Native 0.5
. Sources are shared; the full test suite runs on all
three platforms. Artifacts: casecomplete_3, casecomplete_sjs1_3, casecomplete_native0.5_3.

Test-only adjustments this surfaced: java.time.Year replaced with Int (no java.time in
the JS/Native javalibs) and a Double fixture value replaced with Int (Scala.js renders
7.0 as "7").

Binary-compatibility guardrail (MiMa)

  • sbt-mima-plugin wired into CI via the existing test invocation (sbt 'test; mimaReportBinaryIssues').
  • mimaPreviousArtifacts is intentionally empty until 1.0.0 ships (it is a new baseline);
    the exact expression to flip afterwards is spelled out in build.sbt.
  • versionScheme := Some("early-semver") declared in the POM, and a compatibility-policy
    section added to the README.

Publishing hygiene

  • Dependency leak fixed: scalactic was a compile-scoped dependency in the published POM;
    scalatest is now % Test, so the library has zero runtime dependencies beyond the Scala
    standard library (verified in the generated POM).
  • Removed stray resolvers (shibboleth-releases, Sonatype snapshots) — everything resolves
    from Maven Central.
  • Build settings consolidated into inThisBuild + per-project blocks.

Docs & CI

  • README: cross-platform install snippet (%%%), documented eval ordering, compatibility
    policy, platform requirements, typo fix (equivalantequivalent).
  • CI: job timeout raised 15 → 30 minutes to accommodate JS/Native linking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant