Reputation: 16706
After reading the question on how to build a complex web_ui application, I'm wondering if it will be performant enough.
I'm building a fairly large web application and am wondering if I should split up the main parts or if I can safely serve everything on one page (assuming that I don't mind that the user has to download a pretty big junk of .dart
code).
Upvotes: 1
Views: 189
Reputation: 21383
It is usually considered best practice to split up your code once it reaches a certain size (that size depends on your target audience, your servers etc.).
Dart2js supports lazy loading of libraries so that you load an initial app chunk on page load and then load separate chunks through AJAX requests as they are needed. This will save you bandwidth and speed up page load time.
You can start with serving a single file, but if you expect that will not be performant enough, I would build lazy loading into the app from the start.
Note: at this time there are limitations on how many files can be lazy loaded: https://code.google.com/p/dart/issues/detail?id=3940
Upvotes: 1