Issue with usability of Defer module evaluation (but it's sooo close)

Hi,

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.

Cheers,
Ben

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.

UPDATE: My recommendation for the short term is to just throw all the module containers down at the bottom of the canvas and hide them with CSS!


Hey @BenCook! Thanks for the feedback.

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. :thinking: 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.

Hey @Darren thanks for the quick response - much appreciated.

And yes your understanding is correct!

I’ll try the CSS suggestion - and let you know
(the modules have to sit in the header as that’s the only part of the app visible the whole)

Let me know if any other workarounds or potential fixes need validation.

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. :+1:

Ok thanks Darren,

Only issue is I’m in Melbourne, so I think the Office Hours is at 5am - would rather not get up that early unless I’m sure to get on the agenda :slight_smile:

Let me know if there’s any other options.

Ah yeah that's not ideal. If you want, you can send me a JSON export of the app in question and I can take a look!