Closed
Conversation
guyguy2001
commented
Jun 9, 2024
| @@ -22,6 +22,7 @@ | |||
| "core-js": "^3.13.1", | |||
Contributor
Author
There was a problem hiding this comment.
I accidentally comitted this file - Should I keep it if this is what npm install gives me?
guyguy2001
commented
Jun 9, 2024
| this._puzzle.getBarcodeHairpin(Sequence.fromSequenceString(seq)).sequenceString() | ||
| )); | ||
|
|
||
| this._scriptInterface.addCallback('current_folder', (): string | null => ( |
Contributor
Author
There was a problem hiding this comment.
You should go commit by commit, since the first commit doesn't modify this code, only moves it (and adds code around it)
This commit only copies the relevant lines from PoseEditMode.ts to ScriptsApi.ts - it doesn't modify them, only adds code around them. Because of that, ScriptsApi.ts is broken for this commit.
844640e to
c7ce02a
Compare
guyguy2001
commented
Jun 14, 2024
| 'select_folder', (folderName: string): boolean => this.selectFolder(folderName) | ||
| ); | ||
| addSelectFolderAPIToInterface({ | ||
| selectFolder: this.selectFolder, |
Contributor
Author
There was a problem hiding this comment.
This is probably broken due to this shenanigans
luxaritas
pushed a commit
that referenced
this pull request
Dec 20, 2024
## Summary This is part of the process of extracting the script-facing API from PoseEditMode in order to make it usable for non-booster scripts. Replaces #749 ## Implementation Notes I did it like the previous PR, except I didn't implement get_folder/select_folder, since they are behind a "lock", and I didn't want to think yet of whether or not I want the extracted logic to inherit the lock. However, while get_folder is locked, the calculation functions (such as `fold`) which also access the folder, aren't locked (even on `dev`). Is this intended? ## Testing I ran https://eternagame.org/scripts/13774466, and it passed. The script checks that all of the extracted functions (expect folding with binding sites) work and return the same values. This is an unrelated issue, but : For some reason, both on main/master (https://eternagame.org/puzzles/6096060/play) and on my branch, the first time I run it I get the following errors, and on future runs it passes. Reloading the page makes the issue appear again for a single execution. Errors:  Successful run:  (In my branch I just copy pasted the script, since I didn't have it on eternadev.org, and changed `Lib.fold`->`applet.fold`. I shouldn't have Lib in the terminal, right?) ## Related Issues Enables eternagame/eternagame.org#378, #750
Contributor
Author
|
Closing in favor of #840 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 eternagame/eternagame.org#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._folderand 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 eternagame/eternagame.org#378
TODO
Blocking merge:
Rename the class and the file nameProbably change the class into a function- I decided against it.Move the fileMake eslint not angryDirect Follow-Up / maybe this PR
extract setting the folding engine as wellLater
Notes / Questions for CR
Notes
Questions
_getFolderand_getIsPseudoknotmake sense? I couldn't find a better way without a) making aSwitchableFolderproxy object or b) giving this class access to the entire PoseEditMode (now that I think about it, we could define an interface containingfolderandisPseudoknot... but I think it's better to just pass these 2, although I haven't done typescript in years)SwitchableFolder- it'sFolderSwitcher. Should I use it for this? Or the getter thing?FolderSwitcheris coupled to pixi and the GUI, so I think I'm satisfied with the current way.isPseudoknotever going to change?Lib.foldbehave differently between different puzzles - but now it will also (or maybe has) behave differently between the editor and the scripts page and the gameeterna/eternaScript, butExternalInterfaceCtxshould probably also sit there - however, I'm not sure if they should sit together - the code I moved is "user" code using the interface context, while the interface context itself is more of a "library" thing. Should I move it there as well in a follow up PR?