Skip to content
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

Update dart:developer support note on 'Core libraries' #5107

Open
6 tasks
Tracked by #5475
parlough opened this issue Aug 13, 2023 · 4 comments
Open
6 tasks
Tracked by #5475

Update dart:developer support note on 'Core libraries' #5107

parlough opened this issue Aug 13, 2023 · 4 comments
Assignees
Labels
a.libraries Relating to the Dart standard libraries. e1-hours Can complete in < 8 hours of normal, not dedicated, work from.team Reported by Dash docs team member p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.blocked Issue cannot continue until another action completes st.triage.ltw Indicates Lead Tech Writer has triaged target.web Target apps on the web platform

Comments

@parlough
Copy link
Member

parlough commented Aug 13, 2023

Page URL

https://dart.dev/guides/libraries/index

Page source

https://github.com/dart-lang/site-www/tree/main/src/_guides/libraries/index.md

Describe the problem

The dart:developer note mentions that only Dart VM JIT and the web development compiler (previously dartdevc) support the API. However, I believe that has changed slightly, perhaps earlier, but at least in Dart 3.2 (dart-lang/sdk@af8fb2c). Other platforms may support the library to a certain extent as well.

Expected fix

Determine each platform's support for the library, and update the note for that.

  • web production compiler (dart2js)
  • web development compiler (dartdevc/DDC)
  • wasm compiler (dart2wasm)
  • VM JIT
  • VM AOT (There are different modes, not sure if it makes a difference, release, product, etc?)
  • (Flutter special cases?)

We should consider expanded docs for dart:developer APIs and how to use them to accomplish certain tasks as well.

Additional context

No response

@parlough parlough added a.libraries Relating to the Dart standard libraries. p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. e1-hours Can complete in < 8 hours of normal, not dedicated, work target.web Target apps on the web platform st.blocked Issue cannot continue until another action completes labels Aug 13, 2023
@parlough
Copy link
Member Author

parlough commented Aug 13, 2023

I will wait until after the 3.2 beta cut-off to investigate this further as other changes may be made before that point.

@atsansone atsansone added from.team Reported by Dash docs team member st.triage.ltw Indicates Lead Tech Writer has triaged labels Aug 21, 2023
@MaryaBelanger MaryaBelanger changed the title [Dart 3.2] Update dart:developer support note on 'Core libraries' [3.2] Update dart:developer support note on 'Core libraries' Nov 13, 2023
@parlough
Copy link
Member Author

parlough commented Nov 15, 2023

@bkonyi Would you be able to help me understand what works in dart:developer on what platforms/modes? Let me know if I should redirect this query elsewhere :) Thanks!

@bkonyi
Copy link

bkonyi commented Nov 15, 2023

I'll do my best :) cc @elliette to confirm the web side of things.

Unless otherwise specified, "VM" implies Dart and Flutter native. The standalone VM is the dart runtime. "non-PRODUCT mode" means an embedded VM built with either DEBUG or RELEASE defined. Only Flutter "release" builds use PRODUCT.

  • Flow (VM + dartdevc)
  • NativeRuntime (Standalone, non-PRODUCT mode VM)
  • Service (non-PRODUCT mode VM)
  • ServiceExtensionResponse (VM + dartdevc)
  • ServiceProtocolInfo (non-PRODUCT mode VM)
  • Timeline (VM + dartdevc)
  • UserTag (VM)
  • extensionStreamHasListener (VM + dartdevc)
  • reachabilityBarrier (VM)
  • debugger() (non-PRODUCT JIT VM + dartdevc)
  • getCurrentTag() (VM)
  • inspect(...) (VM + dartdevc)
  • log(...) (VM + dartdevc)
  • postEvent(...) (VM + dartdevc)
  • registerExtension(...) (VM + dartdevc)

dart2js doesn't support any of these APIs, and I didn't mention dart2wasm anywhere since I'm not exactly sure what the support looks like on that end. I assume dart2wasm will have the same support as either dartdevc or dart2js.

Note that none of these APIs will throw exceptions or cause crashes if they're executed on unsupported configurations, but will either be no-ops or simply return default values.

@parlough parlough changed the title [3.2] Update dart:developer support note on 'Core libraries' Update dart:developer support note on 'Core libraries' Nov 16, 2023
@parlough
Copy link
Member Author

Wow thanks @bkonyi! I didn't expect that much detail and explanation, but how you outlined everything was perfect. It will be extremely helpful for @MaryaBelanger and I!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.libraries Relating to the Dart standard libraries. e1-hours Can complete in < 8 hours of normal, not dedicated, work from.team Reported by Dash docs team member p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.blocked Issue cannot continue until another action completes st.triage.ltw Indicates Lead Tech Writer has triaged target.web Target apps on the web platform
Projects
None yet
Development

No branches or pull requests

3 participants