Skip to content

Introduce a Scala-agnostic API for Reflect. #5183

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented May 27, 2025

The new API is offered as part of the javalibintf. It only uses classes from the javalib, which makes it Scala-agnostic.

The old binary API used by the codegen calls the new (public) API in javalibintf. We deprecate them, but keep them for backward binary compatibility.

The public API of scala.scalajs.reflect.Reflect is left untouched, and is still the recommended way to access the public features from user-land Scala code.

In the first commit, we do not change the compiler yet, to test that the deprecated methods are correct.

In the second commit, we change the compiler to use the new APIs.


Alternative to #5161.

sjrd added 2 commits May 28, 2025 08:56
The new API is offered as part of the `javalibintf`. It only
uses classes from the javalib, which makes it Scala-agnostic.

The old binary API used by the codegen calls the new (public)
API in javalibintf. We deprecate them, but keep them for
backward binary compatibility.

The public API of `scala.scalajs.reflect.Reflect` is left
untouched, and is still the recommended way to access the
public features from user-land Scala code.

In this commit, we do not change the compiler yet, to test that the
deprecated methods are correct.
@sjrd sjrd force-pushed the reflect-java-api branch from 9594d0e to 17b5b77 Compare May 28, 2025 06:57
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.

1 participant