-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated deferred language #5489
Conversation
src/language/libraries.md
Outdated
|
||
To lazily load a library, you must first | ||
import it using `deferred as`. | ||
To lazily load a library, import it using `deferred as`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK the flutter-AOT deferred loading solution will still bundle the deferred components in e.g. the Android APK. So they will not lazily be downloaded from network.
This is quite different from JS, where the actual JS files will be downloaded when needed.
It may be worth pointing out this aspect.
Visit the preview URL for this PR (updated for commit bb736ed): |
235e444
to
db78058
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this update Tony! However, since this is currently Flutter specific, it's best to just point to the documentation there.
To account for the VM technically having some of the underlying support, we can shift the discussion of lack of support from the "Dart VM" to the dart
tool.
@@ -89,29 +89,24 @@ import 'package:lib1/lib1.dart' show foo; | |||
import 'package:lib2/lib2.dart' hide foo; | |||
``` | |||
|
|||
<a id="deferred-loading"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep this extra anchor fragment target? It's been used for a while and there are a few links from other sites to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't. I checked first. There are two. I believe this PR accounts for that.
@@ -89,29 +89,24 @@ import 'package:lib1/lib1.dart' show foo; | |||
import 'package:lib2/lib2.dart' hide foo; | |||
``` | |||
|
|||
<a id="deferred-loading"></a> | |||
#### Lazily loading a library | |||
#### Lazily loading a library {:#lazily-loading-a-library} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't expect the header ID customization {:#lazily-loading-a-library}
is needed in this case since it matches the original header. Any reason you needed to add it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case the title ever gets changed because a lot of pages point to this anchor.
src/content/language/libraries.md
Outdated
The Android and JavaScript deferred loading differ. | ||
The Android app bundles all deferred components into the APK at compile time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that this support for deferred loading on Android functionality is specific to Flutter, and other Dart users can't take advantage it without further customizations to the VM or their embedder.
Due to this and the fact we don't generally document Flutter specific handling on the site, I'd instead recommend not mentioning Android in this discussion, and linking to the Flutter site.
Maybe something roughly like:
The `dart` tool doesn't support deferred loading for its other compilation targets.
If you're building a Flutter app, to learn about the platform it supports for deferred loading,
check out the flutter.dev docs on
[deferred components](https://docs.flutter.dev/perf/deferred-components).
That also prevents us from having to make further updates if Flutter changes that functionality or implements support for other target platforms.
Fixes #5100