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

API conversion to TypeScript #41

Merged
merged 169 commits into from
Nov 27, 2023
Merged

API conversion to TypeScript #41

merged 169 commits into from
Nov 27, 2023

Conversation

lm-sousa
Copy link
Member

@lm-sousa lm-sousa commented Aug 20, 2023

[WARNING] Merging of this PR is dependant on the prior merge of specs-feup/specs-java-libs#9

Many of the Lara API files have been translated into TypeScript. Enough to support a conversion of Clava APIs.

These changes include:

  • Creation of the Lara-JS project.
  • Moving APIs to this new project.
  • Ability to export APIs in JS form from Lara-JS to Lara Classic.
  • Class member information in IDEs regarding Joinpoints is now available through the use of wrapper classes.
  • APIs are now properly recognized by IDEs and its features can now aid in development.
  • Weavers can register their wrappers with the Lara API.
  • Scripts are provided to automatically generate the wrapper classes from the JSON specification created by WeaverGenerator.
  • APIs created by JulesHervault during his internship were moved from Lara to Clava as its contents were dependant on Clava specific features.
  • The MathExtra API has been moved from Lara to Clava as it is Clava specific.
  • Generation of a website containing documentation of APIs (present in the LARA-JS project) has been implemented.
  • When using enums in joinpoint methods the type is converted to String as to allow for JS API compatibility (This used to be done manually but is now enforced by the generator).

Not addressed in this PR

  • Information about the ancestral Joinpoint is replicated and hardcoded across the codebase. It requires consolidation into one single source of truth. Hardcoded replicated information regarding LaraJoinPoint #42
  • Not all APIs have been translated into TypeScript.
  • Documentation of the new development workflow.
  • The CI flow for automatic generation and publishing of the API documentation website.

Breaking Changes

  • The transformation of the TimeUnit API has made it so that only members of the TimeUnits enum are accepted by the API as opposed to the previously used strings ("SECONDS" --> TimeUnits.SECONDS).
  • The WeaverJps API alias of Query has been removed.
  • The generation of joinpoint wrapper classes by weavers is required.
  • The API JoinPointsBase is now called JoinPoints and is now final meaning that weavers do not extend it.
  • The CompilationBase API has been removed.
  • lara._JavaTypes has been renamed to lara.util.JavaTypes.
  • System.getExecutable was tagged as deprecated and has now been removed.
  • System.getenv was removed since it was calling non-existing functions.

Known Issues

Affects the creation of abstract joinpoints from the Language specification.
If a method returns or receives a enum type also defined in the Language Specification then the type is considered to be a String. This is because all enum members are forcibly strings and this allows for proper interface with JS APIs.
@lm-sousa lm-sousa mentioned this pull request Sep 5, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Remove dependance of LARA files on "LaraCore.laraGetter"
3 participants