Write a plugin porting guide
FairlySadPanda opened this issue · 0 comments
FairlySadPanda commented
Plugins need modification to work. A good plugin that is being used in this engine needs:
- Any global variables assigned to the window object
- All modifications to classes defined in declaration merges, either in file or in an independent d.ts file
- All modifications to game objects that remain in state on saves and loads (that is, that uses JsonEx) using the replacement process for saving and loading objects on load (gameLoadInput options inside class files)
- CommonJS requires or import statements for any imported classes
- Manipulation of export modules when redefining constructors (please note: please stop redefining constructors. It's a pain in the ass.)
We need a good documentation guide to cover this. We want to encourage plugin writers to use ES6, rather than TS, as TS would be too much work to learn for most indie JS devs who are not being paid.