Skip to content

What to do about the Scala 3-specific artifact? #451

@sjrd

Description

@sjrd
Member

We merged support for Scala 3 in #450. The question is now: what do we do about the Scala 3-specific artifacts of scalajs-dom?

If we release a version 1.2.0 with a new artifacts for _sjs1_3, we can create problems in the binary ecosystem:

  • There can be a library A compiled against the _2.13 artifact of scalajs-dom 1.1.0
  • And a library a B compiled against the _3 artifact of scalajs-dom 1.2.0

Mixing A and B in the same project will cause both scalajs-dom_2.13 v1.1.0 and scalajs-dom_3 v1.2.0 to be on the classpath. This can cause serious issues.

There are two solutions, IMO:

  • Not release the _3 artifact. After all, it does not bring any actual value compared to the _2.13 artifact at the moment. Users will still have to declare their dependency on scalajs-dom using .cross(CrossVersion.for3Use2_13), as they currently do.
  • Bump to scalajs-dom 2.0.0, clearly advertising that there is binary conflict with the previous versions of scalajs-dom.

@gzm0 Any opinion?

Anyone else?

Activity

Daenyth

Daenyth commented on Jul 14, 2021

@Daenyth

I'd say that anything normal developers run into that advises them to use for3Use2_13 is undesirable. Bumping the version seems fine.

gzm0

gzm0 commented on Jul 14, 2021

@gzm0
Contributor

Maybe I'm missing something here, but is anything of this specific to scala-js-dom? Feels like the argument above applies to any Scala library that is Scala 2 and 3 compatible.

sjrd

sjrd commented on Jul 14, 2021

@sjrd
MemberAuthor

Yes, it applies to any Scala library that

  • Had a period where its 2.13 artifact was used by Scala 3
  • Now wants to publish a real artifact for Scala 3

It seems most library maintainers just pretend that there is no issue. They release a _3 artifact in a minor (or even patch) release.

armanbilge

armanbilge commented on Jul 14, 2021

@armanbilge
Member
sjrd

sjrd commented on Jul 14, 2021

@sjrd
MemberAuthor

Daniel Spiewak's advice is harsh precisely because library maintainers have been doing willy-nilly releases of _3 artifacts in random versions. His advice does not hold if we correctly acknowledge and deal with the issue.

armanbilge

armanbilge commented on Jul 14, 2021

@armanbilge
Member

I do see your point, but as far as I can tell (in my limited experience) this is just deferring an inevitably necessary change which risks increasing downstream pain.

SethTisue

SethTisue commented on Jul 14, 2021

@SethTisue

Might as well rip the bandaid off IMO

I guess I see for3Use2_13 as temporary, transitional, experimental stuff where as soon as it enters the picture, buyer beware.

So the best thing is to make it unnecessary, one library at a time, and do it as soon as possible.

(I'm agreeing with Arman.)

sjrd

sjrd commented on Jul 14, 2021

@sjrd
MemberAuthor

So, apparently I am getting flagged down to death here with my controversial opinions, so I guess we'll just bump it to 2.0.0.

larsrh

larsrh commented on Jul 14, 2021

@larsrh

because library maintainers have been doing willy-nilly releases of _3 artifacts in random versions

Speaking for Typelevel, nothing could be further from the truth.

added a commit that references this issue on Jul 14, 2021
5f16c02
gzm0

gzm0 commented on Jul 14, 2021

@gzm0
Contributor

Huh? That is not how I interpret #451 (comment). From the link:

In other words, treat this like a "normal" breaking Scala update. Try to forget that withDottyCompat exists, because for most intents and purposes, it doesn't exist.

The way I understand this: 2.13 -> 3 is no different than 2.12 -> 2.13. So simply publish _3 for the first version you support it and be done.

FWIW: It seems that bumping to 2.0.0 only improves the situation you describe marginally: The dependency resolver will flag it, but it will still not work.

Another way of looking at this, isn't really the library that introduces a _2.13 / _3 dependency (without appropriate flagging, I do not know how the whole dotty compatibility system works) the culprit?

sjrd

sjrd commented on Jul 14, 2021

@sjrd
MemberAuthor

The way I understand this: 2.13 -> 3 is no different than 2.12 -> 2.13. So simply publish _3 for the first version you support it and be done.

It's different because using 2.12 from 2.13 simply never worked, never works and will never work. However, it is perfectly possible to use 2.13 from 3 and conversely.

FWIW: It seems that bumping to 2.0.0 only improves the situation you describe marginally: The dependency resolver will flag it, but it will still not work.

Yes, clearly. It's a major version bump to make it clear that it will not work. It doesn't solve anything.

Another way of looking at this, isn't really the library that introduces a _2.13 / _3 dependency (without appropriate flagging, I do not know how the whole dotty compatibility system works) the culprit?

Only if we say that publishing anything that uses for3Use2_13 or for2_13Use3 is a reason for a library to be blamed. If we allow libraries to be published like that, then it was in its right to do so.

It's possible that the consensus among maintainers was that publishing such a library is bad. If that is the case, then we can start publishing for _3 in a minor version, clearly.

SethTisue

SethTisue commented on Jul 14, 2021

@SethTisue

So, apparently I am getting flagged down to death here with my controversial opinions

Well, we still love you anyway :-)

Perhaps we can re-conceive/re-market “willy-nilly” as, rather, “freedom” 🇺🇸 and/or “diversity” 🏳️‍🌈

28 remaining items

lihaoyi

lihaoyi commented on Aug 2, 2021

@lihaoyi
Contributor

That does sound like a reasonable plan

I like the cleanup for the dom.raw/dom.experimental/dom.ext stuff. Some of that code made sense to me 7 years ago, but it definitely wouldn't pass review for code written today.

sjrd

sjrd commented on Aug 6, 2021

@sjrd
MemberAuthor

Here is a first wave of cleanups: #458. Feel free to review it.

For those who would like to become maintainers, please say so and take a stab at reviewing the PR. Perhaps @armanbilge @japgolly ?

armanbilge

armanbilge commented on Aug 6, 2021

@armanbilge
Member

Thanks @sjrd. I think that I'm too new to Scala.js to be qualified to be a maintainer, but I am eager to help out. I think @japgolly is a great candidate if he has the bandwidth available :)

japgolly

japgolly commented on Aug 8, 2021

@japgolly
Contributor

Thanks @armanbilge . Yeah I don't really have the bandwidth but I keep signing up for things somehow so I'll do my best :) @sjrd np, send me an invite and I'll review and merge.

Also if anyone else can join me as a maintainer I'd really appreciate it. Good to both share the burden and provide different perspectives.

armanbilge

armanbilge commented on Aug 8, 2021

@armanbilge
Member

@japgolly If you'll have me, I can be a deputy maintainer 😆

japgolly

japgolly commented on Aug 8, 2021

@japgolly
Contributor

@armanbilge Thank you and it'd be my pleasure! We're all in this together 😄

armanbilge

armanbilge commented on Aug 8, 2021

@armanbilge
Member

Also maybe @raquo? It seems they have an important stake in the library as well.

sjrd

sjrd commented on Aug 8, 2021

@sjrd
MemberAuthor

@japgolly

Thanks @armanbilge . Yeah I don't really have the bandwidth but I keep signing up for things somehow so I'll do my best :) @sjrd np, send me an invite and I'll review and merge.

Also if anyone else can join me as a maintainer I'd really appreciate it. Good to both share the burden and provide different perspectives.

@armanbilge

@japgolly If you'll have me, I can be a deputy maintainer 😆

Invitations sent.

aappddeevv

aappddeevv commented on Aug 12, 2021

@aappddeevv

I know this is closed now, but @japgolly and @armanbilge if you find that you are unable to get lift off on this, please reach out to me.

armanbilge

armanbilge commented on Aug 12, 2021

@armanbilge
Member

@aappddeevv thanks for the offer!! If you have a moment to review PRs and/or create PRs to address any "help wanted" issue that would be much appreciated! :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @djspiewak@Daenyth@smarter@SethTisue@japgolly

      Issue actions

        What to do about the Scala 3-specific artifact? · Issue #451 · scala-js/scala-js-dom