Skip to content

Commit 47101fd

Browse files
authored
Merge pull request webpack#7489 from mohsen1/update-tracer
Update "chrome-trace-event" package and remove types
2 parents ebe90f4 + 48a1e51 commit 47101fd

File tree

4 files changed

+21
-27
lines changed

4 files changed

+21
-27
lines changed

declarations.d.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@ declare namespace NodeJS {
77
}
88
}
99

10-
// There are no typings for chrome-trace-event
11-
declare module "chrome-trace-event" {
12-
interface Event {
13-
name: string;
14-
id?: number;
15-
cat: string[];
16-
args?: Object;
17-
}
18-
19-
export class Tracer {
20-
constructor(options: { noStream: boolean });
21-
pipe(stream: NodeJS.WritableStream): void;
22-
instantEvent(event: Event): void;
23-
counter: number;
24-
trace: {
25-
begin(event: Event): void;
26-
end(event: Event): void;
27-
};
28-
}
29-
}
30-
3110
// There are no typings for @webassemblyjs/ast
3211
declare module "@webassemblyjs/ast" {
3312
export function traverse(

lib/debug/ProfilingPlugin.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,18 @@ class Profiler {
7171
}
7272
}
7373

74+
/**
75+
* @typedef {Object} Trace
76+
* @description an object that wraps Tracer and Profiler with a counter
77+
* @property {Tracer} trace instance of Tracer
78+
* @property {number} counter Counter
79+
* @property {Profiler} profiler instance of Profiler
80+
* @property {Function} end the end function
81+
*/
82+
7483
/**
7584
* @param {string} outputPath The location where to write the log.
76-
* @returns {{trace: ?, counter: number, profiler: Profiler, end: Function}} The trace object
85+
* @returns {Trace} The trace object
7786
*/
7887
function createTrace(outputPath) {
7988
const trace = new Tracer({
@@ -325,7 +334,7 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({
325334

326335
/**
327336
* @param {string} hookName Name of the hook to profile.
328-
* @param {Tracer} tracer Instance of tracer.
337+
* @param {Trace} tracer The trace object.
329338
* @param {object} options Options for the profiled fn.
330339
* @param {string} options.name Plugin name
331340
* @param {string} options.type Plugin type (sync | async | promise)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"acorn-dynamic-import": "^3.0.0",
1515
"ajv": "^6.1.0",
1616
"ajv-keywords": "^3.1.0",
17-
"chrome-trace-event": "^0.1.1",
17+
"chrome-trace-event": "^1.0.0",
1818
"enhanced-resolve": "^4.0.0",
1919
"eslint-scope": "^3.7.1",
2020
"json-parse-better-errors": "^1.0.2",

yarn.lock

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,11 @@ chownr@^1.0.1:
992992
version "1.0.1"
993993
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181"
994994

995-
chrome-trace-event@^0.1.1:
996-
version "0.1.3"
997-
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.3.tgz#d395af2d31c87b90a716c831fe326f69768ec084"
995+
chrome-trace-event@^1.0.0:
996+
version "1.0.0"
997+
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48"
998+
dependencies:
999+
tslib "^1.9.0"
9981000

9991001
ci-info@^1.0.0:
10001002
version "1.1.3"
@@ -5950,6 +5952,10 @@ trim-right@^1.0.1:
59505952
version "1.0.1"
59515953
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
59525954

5955+
tslib@^1.9.0:
5956+
version "1.9.0"
5957+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
5958+
59535959
tty-browserify@0.0.0:
59545960
version "0.0.0"
59555961
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"

0 commit comments

Comments
 (0)