Closed jaumard closed 3 years ago
Can you point me at that guidance?
Sure! Here is a medium article that talk about this https://medium.com/flutter/optimizing-performance-in-flutter-web-apps-with-tree-shaking-and-deferred-loading-535fbe3cd674
Official docs mention it here https://flutter.dev/docs/perf/deferred-components but not dedicated to flutter web.
Would be awesome to have GODeferredRoute that take care of loading the deferred component to improve loading time.
I'm open to a PR for sure.
Although in thinking about it more, if your pages are deferred types, then it should just work, right?
Deferred types mean that before you can use it you need to load it, so it's a async process. So it need to be taking care in some way or it doesn't work, to be honest I didn't make any testing about this yet. And I just start building for web so I was searching for some examples ^^
To load the page types asynchronously, I'd use a pattern like the one described here: https://pub.dev/packages/go_router#async-data
I read that best practice for flutter web is to use deferred import to optimize loading time.
I was wondering if there is any exemple of how it work with go_router, I was expecting a
GoDeferredRoute