dart-sdk/pkg/js_runtime
Nate Biggs ac6150c4c0 [dart2js] Improve deferred part file logging.
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>
2023-06-09 17:05:11 +00:00
..
lib/synced [dart2js] Improve deferred part file logging. 2023-06-09 17:05:11 +00:00
test [web] Cleanup redundant language version comments 2022-05-26 20:19:09 +00:00
analysis_options.yaml [pkg/js_*] use package:lints/recommended.yaml for analysis for pkg/js_shared and pkg/js_runtime 2023-03-24 01:10:09 +00:00
OWNERS
pubspec.yaml [pkg] use package:lints for pkg/_js_interop_checks, pkg/js_runtime 2022-07-18 17:27:53 +00:00
README.md [web] Move libraries to a shared location 2022-05-18 19:59:33 +00:00

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.