-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: refactor/extract-scripting-api
Are you sure you want to change the base?
Create an entrypoint for just folding API #750
Conversation
<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> |
There was a problem hiding this comment.
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
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; |
There was a problem hiding this comment.
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.
48fedc4
to
228cd42
Compare
|
||
public async run(): Promise<void> { | ||
if (!FoldingAPIApp.isWebAssemblySupported()) { | ||
throw new WasmNotSupportedError( |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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
Summary
TODO
Implementation Notes
Currently I provide an html entrypoint containing a
maingame
element which has the same external folding API as the mainmaingame
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:
Related Issues
A per-requesit of eternagame/eternagame.org#378
Stacked on top of #749