Hi All:
I think we can all agree that Bubble’s Plugin Editor is honestly awful. It accomplishes the bare minimums well enough, but it is severely lacking in terms of debugging, no auto-complete, and the list goes on and on.
I’ve been trying to make an open-source library for some time that could simulate Bubble’s environment in anyone’s IDE of choice. The idea is to simulate things like the properties
object and the context
object. Then, it would be a lot easier to simply copy-and-paste from your IDE into the actual plugin editor.
My biggest headache has been simulating context.async
with the functionality similar to the way bubble handles things. I’ve tried the below code, but it does not work synchronously (it returns promises, and I’m struggling with how to get them to wait to be fulfilled). I’d love to make this into a full-fledged open-source library at some point! Thanks for any help you can provide!
// context.js
const context = {
callback: async function(err, value){
if(err) {
console.error(err);
}
else {
return value;
}
},
async: async function(run) {
await run(this.callback);
}
}
module.exports = context;
Yep.
Yet another interesting project popping up recently on the forums. The library they are using that wraps this functionality has been discussed somewhere. I’ll take a look for where I read about it in detail. Maybe someone like @vini_brito will chime in before I get back.
Ahh found it: Building Actions - Bubble Docs
I think you might have better luck if you try to reproduce this functionality using the “Fibers” library. It’s not likely to happen anytime soon but one day maybe Bubble will move away from this and uses standard node async/promise functionality.
Thanks @bubble.trouble. I did try to get the Fibers library to work, but it also doesn’t work synchronously. I gave it a shot with loops and stuff, but it doesn’t wait as one would expect.
@nicholasrbarrow yeah well, I think it’s going to be an uphill battle to try to achieve your end goal. You can see a bit of the Bubble fibers implementation around line ~72,000 in run.js package but the obfuscation is going to make it difficult to recreate on your own. I would email Bubble support or try to reach out via DM to an active engineer on these forums and see if they will give you some pointers (I know others in the past have gotten help this way, not sure how available anyone is presently to help you)
Best of luck, maybe someone smarter than me will stumble upon this thread and be able to help you further. I definitely appreciate the way you are thinking!
1 Like
This can potentially happen around april 2023.
Node.js 14 is EOL at that time and on fibers - npm it says:
Update [April 13th, 2021] – Fibers is not compatible with nodejs v16.0.0 or later. Unfortunately, v8 commit dacc2fee0f is a breaking change and workarounds are non-trivial.
1 Like
@dorilama nice find.
@josh I know you are extremely busy but can you take a moment and comment on the roadmap for fibers as it would affect many plugins and April 2023 is just around the corner.
3 Likes