Prepare for 1.0.0: JS/Native cross-build, MiMa, declaration-order eval, publishing hygiene - #3
Open
stivens wants to merge 1 commit into
Open
Prepare for 1.0.0: JS/Native cross-build, MiMa, declaration-order eval, publishing hygiene#3stivens wants to merge 1 commit into
stivens wants to merge 1 commit into
Conversation
…l, publishing hygiene
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Preparation for the
1.0.0release. A 1.0 freezes both the API semantics and the binaryinterface, so this PR settles the one arbitrary runtime semantic (
evalordering), cleans upwhat 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
evalnow runs handlers in field declaration orderPreviously 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, inregistration order. The contract is documented on
CaseComplete.evaland in the README, andpinned by tests that distinguish declaration, alphabetical, and registration order.
Internally,
compileImplalready knows the field order at expansion time, so the emitted codenow passes a single pre-ordered
List[SOURCE_TYPE => TARGET_TYPE]toCaseCompleteImpl,replacing the name-keyed
Map+ runtime sort.getHandledFieldspreserves registration orderto support this.
Cross-build for Scala.js and Scala Native
The build is now an sbt-crossproject (
CrossType.Pureat 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.Yearreplaced withInt(nojava.timeinthe JS/Native javalibs) and a
Doublefixture value replaced withInt(Scala.js renders7.0as"7").Binary-compatibility guardrail (MiMa)
sbt-mima-pluginwired into CI via the existing test invocation (sbt 'test; mimaReportBinaryIssues').mimaPreviousArtifactsis intentionally empty until1.0.0ships (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-policysection added to the README.
Publishing hygiene
scalacticwas a compile-scoped dependency in the published POM;scalatest is now
% Test, so the library has zero runtime dependencies beyond the Scalastandard library (verified in the generated POM).
shibboleth-releases, Sonatype snapshots) — everything resolvesfrom Maven Central.
inThisBuild+ per-project blocks.Docs & CI
%%%), documentedevalordering, compatibilitypolicy, platform requirements, typo fix (
equivalant→equivalent).