I’m working on a TW plugin that uses some existing JS libraries. I want to understand plugin initialization order better:
- I have a plugin (
$:/plugins/peter/library) that exposes a JS library as a TW plugin. I addedif ($tw.browser) { ... }to the JS source to avoid initializing the plugin (which requireswindowand friends) when running from node - I have another plugin (
$:/plugins/peter/something) that has adependentsfield set to `$:/plugins/peter/library - I add
console.logstatements to both plugins
I noticed that $:/plugins/peter/library has its log statements run after $:/plugins/peter/library. This is surprising - shouldn’t the “leaf-most” plugin get initialized first?