Open parlough opened 1 year ago
I will wait until after the 3.2 beta cut-off to investigate this further as other changes may be made before that point.
@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!
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.
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!
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 (previouslydartdevc
) support the API. However, I believe that has changed slightly, perhaps earlier, but at least in Dart 3.2 (https://github.com/dart-lang/sdk/commit/af8fb2cd73c3b5ec96a39c59e85f470efe78d8a4). 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.
We should consider expanded docs for
dart:developer
APIs and how to use them to accomplish certain tasks as well.Additional context
No response