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

Create an entrypoint for just folding API #750

Open
wants to merge 3 commits into
base: refactor/extract-scripting-api
Choose a base branch
from

Conversation

guyguy2001
Copy link
Contributor

@guyguy2001 guyguy2001 commented Jun 14, 2024

Summary

TODO

Implementation Notes

Currently I provide an html entrypoint containing a maingame element which has the same external folding API as the main maingame object used in the regular eterna puzzles.

This is stacked on top of #749 ! change this to point to dev after merging #749 and before merging this.

Testing

I ran the following in the terminal:

document.getElementById("maingame").fold("AAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUAAAAAAAAAAAAAAAAAAAAA") 

Related Issues

A per-requesit of eternagame/eternagame.org#378
Stacked on top of #749

@guyguy2001 guyguy2001 marked this pull request as draft June 14, 2024 14:55
Comment on lines +20 to +35
<script src="./frontend/jscripts/jquery/jquery-1.7.2.min.js"></script>
<script src="./frontend/jscripts/jquery/jquery-unselectable.js"></script>
<script src="./frontend/jscripts/jquery-ui/jquery-ui-1.8.7.custom.min.js"></script>
<script src="./frontend/jscripts/json/json2.js"></script>

<script src="./frontend/jscripts/application.js"></script>
<script src="./frontend/jscripts/utils.js"></script>
<script src="./frontend/jscripts/ajaxmanager.js"></script>
<script src="./frontend/jscripts/datamanager.js"></script>
<script src="./frontend/jscripts/usermanager.js"></script>

<script src="./frontend/jscripts/eterna/eterna-application.js"></script>
<script src="./frontend/jscripts/eterna/eterna-utils.js"></script>
<script src="./frontend/jscripts/eterna/script-library.js"></script>
<script src="./frontend/jscripts/eterna/script-interface.js"></script>
<script src="./frontend/jscripts/eterna/presenter.js"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which of these is necessary - I would rather not have all of them in the script editor

Comment on lines +12 to +19
FoldingAPIApp: typeof FoldingAPIApp;
app: EternaApp; // this syntax is used in index.html.tmpl, at least...
__PIXI_APP__?: PIXI.Application;
}
}

window.EternaApp = EternaApp;
window.FoldingAPIApp = FoldingAPIApp;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I'd use a different index.ts for folding-api.html, so that we don't have to import pixi in the script editor - I'm not sure what is the relationship between eterna/index.ts and index.html though.

@guyguy2001 guyguy2001 force-pushed the feat/create-folding-api-entrypoint branch from 48fedc4 to 228cd42 Compare June 14, 2024 15:03
@guyguy2001 guyguy2001 marked this pull request as ready for review June 14, 2024 15:57

public async run(): Promise<void> {
if (!FoldingAPIApp.isWebAssemblySupported()) {
throw new WasmNotSupportedError(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to leave handling this error to the Vue app trying to import it. Does it make sense?

Currently it wouldn't propagate to the vue app because of how I used it in folding-api.html.tmpl

log.info('Initializing folding engines...');
console.time('Test');
const folders: (Folder | null)[] = await Promise.all([
Vienna.create(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folders duplication with EternaApp.ts - I should probably move this to a LoadAllFolders.ts thing, so that new folders wouldn't be missed

@guyguy2001 guyguy2001 changed the title Add comment in index.html.tmpl Create an entrypoint for just folding API Nov 30, 2024
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