Mind your "Do when..."

You smart people probably already knew this, but a note to myself

Having too many “Do when…” events on a page may contribute to page bloat, since each one continuously listens for condition changes. The actual impact depends largely on the complexity of the condition being evaluated. Conditions that involve multiple searches or filtered lists are resource-intensive and can significantly slow the page down. In contrast, simple conditions, like checking if the current user’s email equals a specific value, are much lighter and can generally be used more freely without affecting performance too much.
–Bubble Support

2 Likes

Makes sense haha, but in day-to-day building we end up piling on more and more ‘Do when…’ workflows in our app, especially in SPA apps, and that’s where things get messy.

Sooner or later, one of the main tasks in any large app will be to refactor all the existing ‘Do when…’ workflows.

Only use existing data from page in do when conditions and you’re good to go. Add to them and this custom definition is visible if on a reusable element

My view: ‘Every time’, ‘Do when’ or ‘Every x seconds’ create debug misery. Used as a last resort, in hidden corners. YMMV.

What’s your alternative?

This may seem like the worst response, but if there’s no other option - then I rethink or ditch the idea. Debugging a live app is already a rough sport (with Bubble’s rogue race conditions) so I like to keep the noise down with things that fire so often that debugging becomes tricky. For example: ‘every x seconds’ makes debugging nearly impossible.

There needs to be an option to “hide do every X seconds from debugger” @josh @emmanuel

Simple must-have

People are not using certain action types because they flood the debugger

Hopefully something that might arrive in 2029