@parcel/types-internal 2.12.1-canary.3182 → 2.12.1-dev.3185

Sign up to get free protection for your applications and to get access to all the features.
package/lib/index.d.ts CHANGED
@@ -2061,6 +2061,11 @@ export interface IDisposable {
2061
2061
  export type AsyncSubscription = {
2062
2062
  unsubscribe(): Promise<unknown>;
2063
2063
  };
2064
+ export type MeasurementOptions = {
2065
+ args?: Record<string, unknown>;
2066
+ categories: string[];
2067
+ name: string;
2068
+ };
2064
2069
  export interface PluginTracer {
2065
2070
  /** Returns whether the tracer is enabled. Use this to avoid possibly expensive calculations
2066
2071
  * of arguments to `createMeasurement` - for example if you need to determine the entry of a bundle to pass it
@@ -2083,4 +2088,5 @@ export interface PluginTracer {
2083
2088
  * For example: <code>tracer.createMeasurement('compiled', 'find_css', path.relative(options.projecRoot, asset.filePath), { meta: 'data' })</code>
2084
2089
  */
2085
2090
  createMeasurement(name: string, category?: string, argumentName?: string, otherArgs?: Record<string, unknown>): TraceMeasurement | null;
2091
+ measure<T>(options: MeasurementOptions, fn: () => T): T;
2086
2092
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/types-internal",
3
- "version": "2.12.1-canary.3182+2df56ed28",
3
+ "version": "2.12.1-dev.3185+298c035e0",
4
4
  "license": "MIT",
5
5
  "main": "src/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -16,10 +16,10 @@
16
16
  "check-ts": "tsc --noEmit lib/index.d.ts"
17
17
  },
18
18
  "dependencies": {
19
- "@parcel/diagnostic": "2.0.0-canary.1559+2df56ed28",
20
- "@parcel/feature-flags": "2.12.1-canary.3182+2df56ed28",
19
+ "@parcel/diagnostic": "2.0.0-dev.1562+298c035e0",
20
+ "@parcel/feature-flags": "2.12.1-dev.3185+298c035e0",
21
21
  "@parcel/source-map": "^2.1.1",
22
22
  "utility-types": "^3.10.0"
23
23
  },
24
- "gitHead": "2df56ed286ae41610d5ed9d439c37d6cd02c8ead"
24
+ "gitHead": "298c035e0ffb82d7c5579ce233cc35dce2fe1061"
25
25
  }
package/src/index.js CHANGED
@@ -2066,6 +2066,12 @@ export type AsyncSubscription = {|
2066
2066
  unsubscribe(): Promise<mixed>,
2067
2067
  |};
2068
2068
 
2069
+ export type MeasurementOptions = {|
2070
+ args?: {[key: string]: mixed},
2071
+ categories: string[],
2072
+ name: string,
2073
+ |};
2074
+
2069
2075
  export interface PluginTracer {
2070
2076
  /** Returns whether the tracer is enabled. Use this to avoid possibly expensive calculations
2071
2077
  * of arguments to `createMeasurement` - for example if you need to determine the entry of a bundle to pass it
@@ -2093,4 +2099,6 @@ export interface PluginTracer {
2093
2099
  argumentName?: string,
2094
2100
  otherArgs?: {[key: string]: mixed},
2095
2101
  ): TraceMeasurement | null;
2102
+
2103
+ measure<T>(options: MeasurementOptions, fn: () => T): T;
2096
2104
  }