-
Notifications
You must be signed in to change notification settings - Fork 716
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
Add page to explain Dart modes #4436
Comments
Could you provide some more context on what documentation you are looking to see. As far as I can tell, the language specification doesn't really cover a "production" or "development" mode, it only specifies that program execution can occur with asserts enabled or disabled. From a quick look, it seems like we cover that where relevant. We cover enabling asserts and other debugging options/modes in the |
@a-siva , can you comment? Is it intention not to explain compilation mode for Dart applications and only explain asserts? |
I faced this issue when I wanted to explain leak_tracker availability in different modes for Dart and Flutter. I wanted to reference the modes. I found the modes explanation for Flutter, but not for Dart. For now I just linked this bug for Dart: https://github.com/dart-lang/leak_tracker/blob/04ad7a9e0b15ea4dac281ddd5522d496429b4fb1/README.md#by-build-mode |
Thanks for the clarification! I guess it's a bit challenging on the Dart side compared to Flutter. Flutter has a standardized platform combined into one tool, so there are standard build modes, but in terms of Dart, each platform and compiler/tool has its own configuration. So there are no standards modes as far as I know, at least like Flutter has with the build modes, and enabling the vm service and debugging looks different depending on the tool. For the VM, the current documentation of enabling debugging is in While we have sort of consolidated a concept for a "development" vs "production" web compiler on the website recently, that is separate from debugging. At least on the site, there does not seem to be a general concept of modes for VM apps, outside of JIT vs AOT and passing in For your case of documenting leak_tracker, until we have a better consolidated picture, perhaps you could document in terms of the tools? Perhaps mentioning \cc @mit-mit Is there is a bigger idea of modes or "production" vs "development" we should be documenting for VM apps or all Dart apps in general? |
I'm a but confused about the term "productive mode". Do you mean "production mode" @polina-c? If so, please update your readme. We have an overview that introduces those terms for each of native and web here: https://dart.dev/overview#platform We should probably detail here which are development mode and which are production mode: https://dart.dev/tools/dart-compile |
@mit-mit , I was not sure what term to use. I took 'productive' from the article I linked, because I did not find anything else. Your link helps a lot. Updated README. Thank you! Yes, it seems clarification of compilation modes on this page will help: https://dart.dev/tools/dart-compile |
Ah, I forgot about that picture, thanks! Might be nice to be a bit more explicit in text so it's easier to search for. Sounds like we potentially have a good step forward with improvements to the compile page. |
I believe the key concept that @polina-c wants to capture here is that |
if you go to dart sdk folder and run command
The modes are different from what is explained here; https://dart.dev/tools/dart-compile This instruction works just for debug and release modes: https://github.com/dart-lang/sdk/blob/main/runtime/tools/heapsnapshot/README.md The limitation is hard to document well as the modes are not documented: dart-lang/sdk#52114 |
The instructions for |
@mit-mit , per my understanding, the modes are for applications. And the modes define what features are available for the applications. @a-siva and @mkustermann , can you comment on this? What should we say in documentation for, for example, NativeRuntime.writeHeapSnapshotToFile? |
Maybe the documentation of NativeRuntime.writeHeapSnapshotToFile can state that this function will not work in a self contained dart executable produced using the |
There are may features like this. For example, leak tracker. Why do not we give names and explain Dart modes in a central place, that can be easily referenced in all other docs? |
The name "product" does leak into users code via an environment define: Users that want to exclude certain code in production mode (e.g. for Flutter specifically provides a @mit-mit Would it make sense that we expose |
@polina-c , @mkustermann , @mit-mit : This is beginning to read like a code change before a documentation change. If that's the case, I can move this back into dart-lang/sdk for resolution. Thoughts? |
Page URL
https://dart.dev/guides/
Page source
https://github.com/dart-lang/site-www/tree/main/src/_guides/index.md
Describe the problem
development mode
andproductive mode
mentioned in this post are important aspects of the dart language, but they are not explained in dart documentation:https://www.geeksforgeeks.org/assert-statements-in-dart/
Expected fix
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: