Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use 2.13-style collections library syntax in json-api #6075

Merged
merged 15 commits into from
May 27, 2020

Conversation

S11001001
Copy link
Contributor

@S11001001 S11001001 commented May 21, 2020

Preparing for Scala 2.13 by removing some constructs no longer present there, replacing them with existing portable constructs or those provided by scala-collection-compat, as @leo-da suggested. Currently included:

  • For single-operation breakOut, we use .view.op(...).toX, with variations:
    • where view causes an Any warning, we use iterator instead
    • where there are multiple operations, we use iterator instead
    • where there is no toX, we use to(X) instead, by importing scala.collection.compat._
  • For to[X], we use toX or to(X), depending on what is available
    • this includes the hacky test mode for doobie, for which the CBF hack works equally well, hence the presence of to(List)

Those of the changes above that didn't require scala-collection-compat have also been made in the daml-lf tree.

Fixes #5874.

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@S11001001 S11001001 added the component/json-api HTTP JSON API label May 21, 2020
@S11001001 S11001001 added this to the HTTP JSON API Maintenance milestone May 21, 2020
@S11001001 S11001001 changed the title 5874 use 2.13 esque colls use 2.13-style collections library syntax in json-api May 21, 2020
@S11001001 S11001001 marked this pull request as ready for review May 26, 2020 16:21
Copy link
Contributor

@leo-da leo-da left a comment

Choose a reason for hiding this comment

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

looks good, but we need to make sure the changes do not affect performance, we touched interpreter and data.transaction

Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da left a comment

Choose a reason for hiding this comment

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

Looks good.

@ghost
Copy link

ghost commented May 27, 2020

Noice.

@S11001001
Copy link
Contributor Author

As discussed, these changes lay outside the critical path in question.

@mergify mergify bot merged commit 78205af into master May 27, 2020
@mergify mergify bot deleted the 5874-use-2.13-esque-colls branch May 27, 2020 22:27
@stefanobaghino-da stefanobaghino-da added the team/ledger-clients Related to the Ledger Clients team's components. label Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/json-api HTTP JSON API team/ledger-clients Related to the Ledger Clients team's components.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add scala-collection-compat dependency to JSON API
4 participants