@zelus_pudding, I write all my code in a self-executing function that I paste into Code Instance (for an example, go look at my open source “Fielder” plugin).
Then all the other code boxes are just calls to functions that hang off of instance.data. And of course I don’t initialize states using the state initialization boxes as that’s just silly.
So 99% of my plugin code is in a single file and of course I edit that in VS Code. Everything else is just a little stub.
As for the problem you just experienced, if you have a linter that’s automatically fixing stuff (or you’re fixing stuff your linter is identifying as an issue), note that the first line of everything in the Bubble plugin code boxes is not proper JavaScript (e.g., function(instance, context) {
– this is not a proper JS function definition, it’s just how Bubble detects where the code starts. This is moronic, but there you go. [Also see my note at end!]
If you don’t have the exact (again, not real JavaScript) string Bubble expects there, Bubble will balk at it. (And yes, this makes it hard to self-minify certain types of code - particularly in SSA’s - if that’s a thing that one needs to do.)
One thing to check: If you try to “Submit a new version”, the plugin editor may give you a clue about what it thinks is wrong with your plugin (there’s some checks it does there).
END NOTE: Also, while writing this, I did just go and mess with changing that first line. Something has changed in the plugin editor… if the first line was not exactly what Bubble expects, the code box would complain something like “this code cannot be interpreted as JavaScript”. But it seems it is not doing that right now.
(I appreciate that Bubble does seem to be actively working on the plugin editor and associated stuff, but the only reason we know this is that they are regularly breaking things in the plugin ecosystem. Most recently, they did something that made Bubble not see Events from plugins, and a few days prior to that made a silent change to the SSA API that made certain object properties “disappear” (become not inspectable via Object.hasOwnProperties()) which of course broke a good bit of code for a while.)