Defer module evaluation

App builders can now defer the initialization of modules until they're viewable to improve the initial loading time of larger apps! :rocket:

To enable this public beta, navigate to Beta > Settings and enable [Perf] Module deferred evaluation.

When an app is initially loaded, Retool initializes all code, components, and modules. However, a common use case for modules is including them in conditionally hidden frames, and these modules don't need to be loaded when they are still hidden.

Modules now have a new option in the Inspector: [Beta] Defer evaluation until visible. When a β€œdeferred” module is hidden (either β€˜hidden’ state is true, or it is in a hidden frame, or otherwise not being rendered), Retool defers the module's initialization. When the module is shown, Retool invokes the initialization procedure that would typically happen during app startup.

This gives builders more flexibility in how components are loaded in their apps, and large apps load more quickly.

7 Likes

This sounds incredible - exactly what I was hoping for.

Thanks guys!

1 Like

This is great :slight_smile:

Just FYI, I had a submit button stop working for a form in one of my apps around the time you launched this. Even confetti didn’t fire :frowning: . We had made no changes to the app at all for about 10 days.
I was able to get it working again by changing the button to a normal button type and adjusting the event handlers, but it might be worth looking at.

Thanks for reporting, @Rachael! Is this form contained within a module? And had you previously enabled deferred evaluation?