The lastest version of the gadget emulator now shows the gadget state and supports an actual list of participants and quite a few of the sample gadgets are working now. I am current working with Patrick “p2k” Schneider to try to integrate this into his work on a wave server. There are still a few gadgets that don’t work because of unimplemented APIs on the emulator (_IG_Prefs and OpenSocial), but the current state of the emulator is enough for us to start creating some significant gadgets. If anyone feels that they would like this emulator to support additional APIs, feel free to participant by forking the project on GitHub.
On another note, Vidar’s attempt at an SVG editor has shown how hard it is to manage gadget state information when all you can use for values is strings (no arrays or objects). Vidar made an attempt to solve it in his gadget by encoding an array-like structure as keys of the form “svg_<participant-id>_<index>”. This is a good idea but it is still broken because:
- You can be logged in as the same user on multiple machines
- This paradigm would not allow to add elements in the beginning or middle of an array
I am starting to work on a gadget state management framework that should give you the feeling like you’re almost just working with plain Javascript objects and arrays when in fact is uses a crazy encoding scheme to make it work with Wave’s basic gadget state structure without breaking concurrency.