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

Support Scala Native #826

Merged
merged 11 commits into from
May 4, 2023
Merged

Conversation

lolgab
Copy link
Contributor

@lolgab lolgab commented Nov 22, 2022

Pull Request Checklist

Purpose

Add support for Scala Native

@lolgab lolgab force-pushed the support-scala-native branch 2 times, most recently from c9e49fd to 00b6ff6 Compare November 29, 2022 14:34
@lolgab lolgab marked this pull request as ready for review November 29, 2022 14:34

import java.io.InputStreamReader

private[json] object StaticBindingJsNative {
Copy link
Contributor Author

@lolgab lolgab Dec 17, 2022

Choose a reason for hiding this comment

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

The code in this file was moved from StaticBinding in the js implementation.

Copy link
Member

Choose a reason for hiding this comment

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

I'm just curious here - what's the point of this restructure?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I think I see - you're making the underlying functionality common, so that both js and native StaticBinding implementations can access this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I think I see - you're making the underlying functionality common, so that both js and native StaticBinding implementations can access this code?

Exactly, to avoid copy-pasting a lot of code, I put the common code here so it's shared and called back and forth from the Native and JS implementations.

Copy link
Member

Choose a reason for hiding this comment

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

A small nit then - I found the js-native and StaticBindingJsNative names a bit confusing. The name doesn't really convey the intent, and isn't intuitive for further possible expansions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the js-native directory is automatically added by sbt-crossproject.
About StaticBindingJsNative I just added the platforms names to the original file name. If you have a better suggestion I change it. I don't have any better name in mind.. maybe StaticBindingNonJvm ?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I had a feeling it was sbt plugin shenanigans causing the package name. Makes sense, given that the subprojects aren't explicitly depending on one another in build.sbt.

I think it's really a nit though, I hate to delay for this. Let's leave it as is, and leave better naming for later. This isn't a public API, so it shouldn't affect very many users.

I will say though, StaticBindingNonJvm or StaticBindingNonJvmShared is a bit more descriptive.

@BillyAutrey BillyAutrey requested a review from mkurz May 1, 2023 21:50
@@ -0,0 +1,58 @@
/*
* Copyright (C) 2009-2021 Lightbend Inc. <https://www.lightbend.com>
Copy link
Member

Choose a reason for hiding this comment

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

I figure this is needed to ensure linting works on the new rules. But this isn't really associated with Lightbend anymore. @mkurz we should visit revamping the requirements on copyrights and file headers.

Copy link
Member

Choose a reason for hiding this comment

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

I will do that in a upcoming pr.

Copy link
Member

@BillyAutrey BillyAutrey left a comment

Choose a reason for hiding this comment

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

Approved, though we should track the comments I made.

  1. Naming of StaticBindingJsNative feels very specific, and doesn't match the intent necessarily.
  2. We're adding files and putting outdated Lightbend copyright data at the top, just to satisfy CI. We should do something different in the future.

@BillyAutrey
Copy link
Member

@mkurz I'll hold off on merging, wanted to give you another day to come back and make sure I didn't miss anything. I'll merge tomorrow if you have no other thoughts.

@mkurz
Copy link
Member

mkurz commented May 3, 2023

will take a look tonight

@lolgab
Copy link
Contributor Author

lolgab commented May 3, 2023

@BillyAutrey I can rename StaticBindingJsNative to StaticBindingNonJvm right now.

@BillyAutrey
Copy link
Member

@lolgab up to you! Like I said I feel it's a nit, and an easy one to fix later if we want to discuss it further.

@lolgab
Copy link
Contributor Author

lolgab commented May 3, 2023

@lolgab up to you! Like I said I feel it's a nit, and an easy one to fix later if we want to discuss it further.

Since we are waiting for tomorrow either way, it doesn't cost me anything to update it :)

@lolgab
Copy link
Contributor Author

lolgab commented May 3, 2023

Thank you very much for reviewing and approving the PR!

@mkurz
Copy link
Member

mkurz commented May 4, 2023

Looking into this the next minutes, thanks for your patience.

Copy link
Member

@mkurz mkurz left a comment

Choose a reason for hiding this comment

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

LGTM, rebased and upgraded versions, since we are now on Scala 3.3.0-RC5.

@mergify mergify bot merged commit cf5d178 into playframework:main May 4, 2023
16 checks passed
@mkurz
Copy link
Member

mkurz commented May 4, 2023

I published 2.10.0-RC8, please test. If no blockers come up 2.10 final will be released soon.

@lolgab lolgab deleted the support-scala-native branch May 4, 2023 16:17
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.

None yet

4 participants