-
Notifications
You must be signed in to change notification settings - Fork 395
Please remove the ExecutionContext.global warning #4670
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
Comments
Have you read #4129, which led to this warning? There is a lot of context in there that explains how we got to make this decision. Do you have any new information that would invalidate the reasoning made there? |
Hi @sjrd, I remember that issue, I even added some input at that point — which was that, out of all solutions, continuing with My problem with it is that it's violating the principle of the least surprise, because people that want to use When importing The issue I'm seeing is with the behavior of Speaking of, what sense does In the browser, at least, In my opinion, But if it isn't, due to performance reasons, then own the current implementation, instead of triggering a warning. If Triggering a warning on usage of I'm basically complaining about usability here. |
I have taken a stab at grouping the discussion here abit and giving my POV. Usability
Fair point, but IIUC feature-parity (and compiler option syntax) between Scala 2.x / 3.x are a more general issue.
Absolutely. This isn't good. But IMHO it's the least bad we could come up with. So unless we have a better option (see second section below), I do not know what you want us to do.
That's essentially what the warning is (also see response below). Actually removing it is a bit tricky because it's in the Scalalib, which the Scala.js project doesn't directly control. In any case, a new major Scala.js version is not on the horizon any time soon, so IMHO, no point in figuring out how to remove it right now.
Fair. But you need to think about this more like a deprecation warning (we cannot remove it due to backwards compatibility guarantees). The reason it isn't directly implemented as a deprecation warning is due to how Scala.js itself cross compiles the scala library. Alternatives
Could you clarify what you mean by non-standard? IIUC,
suggests that the issues you point out depend on the exact usage of the API and are not inherent to using
See: #4129 (comment) Please address this point when you're arguing for using
If Ownership
I'm not 100% sure what you mean by "owning' here. We maintain (to the best of our abilities) both implementations. Batched Execution
I do not know. |
The signature, yes, the implementation, no — there are 3 major browser engines with 3 different implementations of
Right. Well, it would also leak in
"Owning it" as in living with your choice, with no regrets 🙂 I think this is a contentious issue for a usability concern, and recommending that project to people is useful enough, so I'm going to backtrack on my suggestion. Cheers, |
I'm seeing this warning in my project:
I understand the intent, or why usage of
scala.concurrent.ExecutionContext.global
may be problematic, however it's a standard import that often gets used for code that cross-compiles to both the JVM and JS, which is one of the primary strengths of Scala.js. Having the official compiler perpetually warn on standard functionality, and suggest a third-party library, isn't good IMO. And why isn't that warning and option available on Scala 3.x?Personally, I see only 3 possibilities:
global
in Scala.js proper;global
and remove it completely in a future version;As it is, removing that warning is a lot of work, especially in a project that compiles for multiple Scala versions. Updating minor Scala.js versions shouldn't be this hard.
Just a suggestion, thanks a lot for your work 🤗
The text was updated successfully, but these errors were encountered: