mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
ac6150c4c0
Adds an "eventLog" property to the global "$__dart_deferred_initializers__" object. The event log is just a JS Array that gets initialized alongside $__dart_deferred_initializers__. Each event entry is a String->String JS object. I unified the format of these event objects for easier parsing. Each printed event is now valid JSON (passed through JSON.stringify) so we can more easily post-process the logs if necessary. Fully replacing the existing "_eventLog" field makes the logging logic simpler. Having a single array allows us to not include a timestamp because the array captures the event ordering (actual timing doesn't matter). It also makes it easier to stringify the logs when there's only 1 data source/format. Sample output: ``` {"hunkName":"out.js_1.part.js","event":"loadHunk"} {"uri":"path_to/out.js_1.part.js","hunkName":"out.js_1.part.js","event":"downloadHunk"} {"file":"out.js_1","event":"beginLoadPart"} {"file":"out.js_1","event":"endPartLoad","hash":"aCscY7yv4EHodRPmCqYn5BqMelA="} {"uri":"path_to/out.js_1.part.js","hunkName":"out.js_1.part.js","event":"downloadHunkSuccess"} {"hunkName":"out.js_1.part.js","hash":"aCscY7yv4EHodRPmCqYn5BqMelA=","event":"initialize"} ``` Change-Id: Ifee73be0bf7dc53a0e7710ff033dd2b0fae9fb0e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307240 Commit-Queue: Nate Biggs <natebiggs@google.com> Reviewed-by: Stephen Adams <sra@google.com> |
||
---|---|---|
.. | ||
lib/synced | ||
test | ||
analysis_options.yaml | ||
OWNERS | ||
pubspec.yaml | ||
README.md |
Package js_runtime
:
This package contains code that is shared between the dart2js compiler and the dart2js runtime libraries.
Important: all code under the lib/synced/
must be kept in sync with the
runtime at all times (in sdk/lib/_internal/js_runtime/lib/synced
). The
test/in_sync_test.dart
test verifies this.