Go to file
Thomas Lindner 60110d4e84 add icon and title 2022-04-02 18:36:41 +02:00
.github/workflows also update the comand in the ci 2022-01-28 16:30:04 +01:00
jsnes@d8021d0336 submodule added 2022-04-02 16:02:50 +02:00
.gitignore resize to viewport 2022-04-02 18:23:23 +02:00
.gitmodules submodule added 2022-04-02 16:02:50 +02:00
README.md submodule added 2022-04-02 16:02:50 +02:00
create-xdc.sh add typescript definitions 2022-01-28 16:30:01 +01:00
icon.png add icon and title 2022-04-02 18:36:41 +02:00
index.html resize to viewport 2022-04-02 18:23:23 +02:00
jsnes.min.js resize to viewport 2022-04-02 18:23:23 +02:00
manifest.toml add icon and title 2022-04-02 18:36:41 +02:00
nes-embed.js add save and load state functions to nes.embed.js 2022-04-02 17:32:51 +02:00
style.css css 2022-04-02 17:08:42 +02:00
webxdc.d.ts Merge pull request #24 from deltachat/set-default-serial-in-setUpdateListener 2022-03-31 14:20:17 +02:00
webxdc.js set default value for serial parameter in setUpdateListener 2022-03-30 17:39:12 -04:00

README.md

JSNES as a WebXDC


Webxdc Development Tool

this is a little tool to make development of webxdc apps easier.

for developing webxdc apps, just copy the webxdc.js from this repo beside your index.html and you are ready to go.

no server or installation required.

  • include your webxdc.js to your index.html as usual
  • open your index.html from your local disk in your browser, (tested with Firefox and Chrome, for Safari, enable "Develop / Disable Local File Restrictions")
  • the emulation layer will add an "add peer" button, open as many peers as you like
  • once you call sendUpdate() in on peer, all peers will get the update with their update listeners.

when your app is done, you can bundle it using ./create-xdc.sh your-app-name and send it to your friends :)

note, that the api is not yet complete, this is just a, maybe already useful, proof-of-concept for now.

use type-checking and completion

If you are using vscode you can have autocompletion and type-checking even without using typescript.

just add these two lines to your javascript source files:

//@ts-check
/** @typedef {import('./webxdc').Webxdc} Webxdc */

Without vscode you need to install typescript and then run the check manually.

npm -g typescript
tsc --noEmit --allowJs --lib es2015,dom webxdc.js # to check if types and simulator are in sync
tsc --noEmit --allowJs --lib es2015,dom your_js_file.js