We’ve just upgraded to version 4 and were very excited to get a hold of this new feature. With our use of modules our app loading times had blown out to 12-15seconds, and early indications are that this would slash it to 5-6 seconds.
The problem is that a lot of out modules are either drawers or modals. We place them in the header of our apps and set them to hidden, and then have a seperate module input to hide/show the drawers/modals. So they don’t take up any space on the canvas, but are available from any page on the app.
Once the app is loaded this works great, all the drawers can be opened from any page and performance is fine.
But when using defer module evaluation, when we need to open a drawer we set hidden to false, and the module immediately takes up space in the canvas where it didn’t previously (which shifts everything around.
As it stands the new feature isn’t usable in this use case, which is a little flattening because it’s so promising and clearly works well.
I think if we could have an option to bind the module loading to a property other than hidden, that would be perfect.
Hope this makes sense - I’d love to hear what you think.
Just adding to this - if we could control loading based on a separate input, it would mean that when a module is in a tabbed container for example, it wouldn’t have to continually be re-evaluated as a user is switching back and forward across tabs. Each module would only have to be evaluated once.
I think I understand what you're saying - the module container itself, even though it's blank, takes up space on the canvas when hidden is toggled to false. Let me know if I have that wrong!
There are almost definitely some hacky workarounds - which I'll noodle on - but I'll also talk to the team about potentially adding a secondary loaded attribute. Thanks again for trying this out! It sounds like it has significant implications for your app performance.
Hmm I think the only way to trick the canvas into not allocating space for them is putting them below the other rendered content - even with the CSS hack. If you're open to joining Office Hours tomorrow, I can take a look at your setup and potentially offer some tips! I expect it might be a busy one, though.