eternagame / EternaJS

Eterna game/RNA design interface
Other
12 stars 10 forks source link

Refactor/extract scripting api #749

Open guyguy2001 opened 3 months ago

guyguy2001 commented 3 months ago

Summary

In order to prepare the ground for creating a new EternaJS app that just exposes the folding API without any additional state (which would allow fixing https://github.com/eternagame/eternagame.org/issues/378), and in order to just simplify PoseEditMode, this PR extracts logic related the to the folding scripting (booster) API from PoseEditMode to a new class (/function), which would have very few dependencies.

Implementation Notes

Moved the code responsible for exposing the folding API (which only depends on the folding context, i.e read-only access to this._folder and understanding whether or not we are in psuedoknot mode) from PoseEditMode.ts to a separate ScriptsApi.ts flie (name WIP)

Testing

I currently only ran document.getElementById("maingame").fold("AUGGGGGGGGGGGGGGGGGGGGCCCCCCCCCCCCCCCCCCCC") after running the script evaluator (in order to load the script interface)`.

Related Issues

Preparations for fixing https://github.com/eternagame/eternagame.org/issues/378

TODO

Blocking merge:

Direct Follow-Up / maybe this PR

Later

Notes / Questions for CR

Notes

Questions