flashwright 1.64.1-flashwright.3 → 1.64.1-flashwright.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,6 +90,7 @@ function installSourceMapSupport() {
90
90
  Error.stackTraceLimit = 200;
91
91
  const runnerFramePrefix = import_package.packageRoot + import_path.default.sep;
92
92
  const formatRunnerFrames = showInternalStackFrames();
93
+ const mappedFrames = /* @__PURE__ */ new Map();
93
94
  setRawStackFormatter((error, callSites) => {
94
95
  const lines = [String(error)];
95
96
  for (const callSite of callSites) {
@@ -98,8 +99,20 @@ function installSourceMapSupport() {
98
99
  lines.push(` at ${fileName2}:${callSite.getLineNumber()}:${callSite.getColumnNumber()}`);
99
100
  continue;
100
101
  }
101
- const mapped = fileName2 && sourceMaps.has(fileName2) ? sourceMapSupport.wrapCallSite(callSite) : callSite;
102
- lines.push(" at " + String(mapped).replace(/^async /, ""));
102
+ const sourceMap = fileName2 ? sourceMaps.get(fileName2) : void 0;
103
+ if (!sourceMap) {
104
+ lines.push(" at " + String(callSite).replace(/^async /, ""));
105
+ continue;
106
+ }
107
+ const key = sourceMap + "\n" + String(callSite);
108
+ let line = mappedFrames.get(key);
109
+ if (line === void 0) {
110
+ line = " at " + String(sourceMapSupport.wrapCallSite(callSite)).replace(/^async /, "");
111
+ if (mappedFrames.size >= 1e4)
112
+ mappedFrames.clear();
113
+ mappedFrames.set(key, line);
114
+ }
115
+ lines.push(line);
103
116
  }
104
117
  return lines.join("\n");
105
118
  });
@@ -1,5 +1,5 @@
1
1
  # packages/playwright/lib/common/index.js
2
- # total: 115.6 KB
2
+ # total: 116.0 KB
3
3
 
4
4
  ## Inlined (20)
5
5
  12.6 KB packages/playwright/src/common/config.ts
@@ -15,7 +15,7 @@
15
15
  12.9 KB packages/playwright/src/common/testType.ts
16
16
  1.4 KB packages/playwright/src/common/validators.ts
17
17
  1.3 KB packages/playwright/src/isomorphic/teleReceiver.ts
18
- 8.6 KB packages/playwright/src/transform/compilationCache.ts
18
+ 9.0 KB packages/playwright/src/transform/compilationCache.ts
19
19
  1.7 KB packages/playwright/src/transform/esmLoaderSync.ts
20
20
  1.1 KB packages/playwright/src/transform/pirates.ts
21
21
  1.1 KB packages/playwright/src/transform/portTransport.ts
@@ -4188,6 +4188,12 @@ function calculateSha1(buffer) {
4188
4188
  return hash.digest("hex");
4189
4189
  }
4190
4190
 
4191
+ // packages/isomorphic/manualPromise.ts
4192
+ var captureRaceCallSite = () => new Error();
4193
+ function setRaceCallSiteCapture(capture) {
4194
+ captureRaceCallSite = capture;
4195
+ }
4196
+
4191
4197
  // packages/utils/env.ts
4192
4198
  function getFromENV(name) {
4193
4199
  let value = process.env[name];
@@ -4207,12 +4213,28 @@ function getAsBooleanFromENV(name, defaultValue) {
4207
4213
  // packages/utils/debug.ts
4208
4214
  var _debugMode = getFromENV("PWDEBUG") || "";
4209
4215
  var _isUnderTest = getAsBooleanFromENV("PWTEST_UNDER_TEST");
4216
+ function isUnderTest() {
4217
+ return _isUnderTest;
4218
+ }
4210
4219
 
4211
4220
  // packages/utils/stackTrace.ts
4212
4221
  var rawStackFormatter;
4213
4222
  function setRawStackFormatter(formatter) {
4214
4223
  rawStackFormatter = formatter;
4215
4224
  }
4225
+ function withShallowStack(create) {
4226
+ const stackTraceLimit = Error.stackTraceLimit;
4227
+ const limit = showInternalStackFrames() || isUnderTest() ? 10 : 0;
4228
+ if (stackTraceLimit <= limit)
4229
+ return create();
4230
+ Error.stackTraceLimit = limit;
4231
+ try {
4232
+ return create();
4233
+ } finally {
4234
+ Error.stackTraceLimit = stackTraceLimit;
4235
+ }
4236
+ }
4237
+ setRaceCallSiteCapture(() => withShallowStack(() => new Error()));
4216
4238
  var re = new RegExp(
4217
4239
  "^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"
4218
4240
  );
@@ -4236,6 +4258,7 @@ function installSourceMapSupport() {
4236
4258
  Error.stackTraceLimit = 200;
4237
4259
  const runnerFramePrefix = import_package.packageRoot + import_path.default.sep;
4238
4260
  const formatRunnerFrames = showInternalStackFrames();
4261
+ const mappedFrames = /* @__PURE__ */ new Map();
4239
4262
  setRawStackFormatter((error, callSites) => {
4240
4263
  const lines = [String(error)];
4241
4264
  for (const callSite of callSites) {
@@ -4244,8 +4267,20 @@ function installSourceMapSupport() {
4244
4267
  lines.push(` at ${fileName2}:${callSite.getLineNumber()}:${callSite.getColumnNumber()}`);
4245
4268
  continue;
4246
4269
  }
4247
- const mapped = fileName2 && sourceMaps.has(fileName2) ? import_source_map_support.default.wrapCallSite(callSite) : callSite;
4248
- lines.push(" at " + String(mapped).replace(/^async /, ""));
4270
+ const sourceMap = fileName2 ? sourceMaps.get(fileName2) : void 0;
4271
+ if (!sourceMap) {
4272
+ lines.push(" at " + String(callSite).replace(/^async /, ""));
4273
+ continue;
4274
+ }
4275
+ const key = sourceMap + "\n" + String(callSite);
4276
+ let line = mappedFrames.get(key);
4277
+ if (line === void 0) {
4278
+ line = " at " + String(import_source_map_support.default.wrapCallSite(callSite)).replace(/^async /, "");
4279
+ if (mappedFrames.size >= 1e4)
4280
+ mappedFrames.clear();
4281
+ mappedFrames.set(key, line);
4282
+ }
4283
+ lines.push(line);
4249
4284
  }
4250
4285
  return lines.join("\n");
4251
4286
  });
@@ -1,7 +1,7 @@
1
1
  # packages/playwright/lib/transform/esmLoader.js
2
- # total: 284.0 KB
2
+ # total: 285.0 KB
3
3
 
4
- ## Inlined (51)
4
+ ## Inlined (52)
5
5
  1.3 KB node_modules/balanced-match/dist/esm/index.js
6
6
  4.8 KB node_modules/brace-expansion/dist/esm/index.js
7
7
  1.8 KB node_modules/buffer-from/index.js
@@ -39,9 +39,10 @@
39
39
  8.6 KB node_modules/source-map/lib/util.js
40
40
  0.3 KB node_modules/source-map/source-map.js
41
41
  3.1 KB node_modules/supports-color/index.js
42
+ 0.1 KB packages/isomorphic/manualPromise.ts
42
43
  0.1 KB packages/isomorphic/rtti.ts
43
44
  0.2 KB packages/isomorphic/stringUtils.ts
44
- 6.7 KB packages/playwright/src/transform/compilationCache.ts
45
+ 7.1 KB packages/playwright/src/transform/compilationCache.ts
45
46
  3.1 KB packages/playwright/src/transform/esmLoader.ts
46
47
  1.7 KB packages/playwright/src/transform/esmLoaderSync.ts
47
48
  1.1 KB packages/playwright/src/transform/pirates.ts
@@ -50,9 +51,9 @@
50
51
  3.2 KB packages/playwright/src/transform/tsconfig-loader.ts
51
52
  4.7 KB packages/playwright/src/util.ts
52
53
  0.2 KB packages/utils/crypto.ts
53
- 0.1 KB packages/utils/debug.ts
54
+ 0.2 KB packages/utils/debug.ts
54
55
  0.5 KB packages/utils/env.ts
55
- 0.4 KB packages/utils/stackTrace.ts
56
+ 0.8 KB packages/utils/stackTrace.ts
56
57
 
57
58
  ## External (3)
58
59
  ../globals
@@ -861,6 +861,9 @@ var TestInfoImpl = class {
861
861
  this._ariaSnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
862
862
  this._interruptedPromise = new ManualPromise4();
863
863
  this._steps = [];
864
+ // Flashwright: hook and fixture steps that have not finished. When there are none, as in the test
865
+ // body, looking for one does not walk all steps of the test for every API call.
866
+ this._unfinishedPredefinedSteps = 0;
864
867
  this._stepMap = /* @__PURE__ */ new Map();
865
868
  this._onDidFinishTestFunctionCallbacks = /* @__PURE__ */ new Set();
866
869
  this._hasNonRetriableError = false;
@@ -976,6 +979,8 @@ var TestInfoImpl = class {
976
979
  }
977
980
  }
978
981
  _findLastPredefinedStep(steps) {
982
+ if (!this._unfinishedPredefinedSteps)
983
+ return void 0;
979
984
  for (let i = steps.length - 1; i >= 0; i--) {
980
985
  const child = this._findLastPredefinedStep(steps[i].steps);
981
986
  if (child)
@@ -1015,6 +1020,8 @@ var TestInfoImpl = class {
1015
1020
  if (step.endWallTime)
1016
1021
  return;
1017
1022
  step.endWallTime = Date.now();
1023
+ if (step.category === "hook" || step.category === "fixture")
1024
+ this._unfinishedPredefinedSteps--;
1018
1025
  if (result.attachments) {
1019
1026
  for (const attachment of result.attachments)
1020
1027
  this._attach(attachment, stepId);
@@ -1063,6 +1070,8 @@ ${stringifyStackFrames2(step.boxedStack).join("\n")}`;
1063
1070
  };
1064
1071
  const parentStepList = parentStep ? parentStep.steps : this._steps;
1065
1072
  parentStepList.push(step);
1073
+ if (step.category === "hook" || step.category === "fixture")
1074
+ this._unfinishedPredefinedSteps++;
1066
1075
  this._stepMap.set(stepId, step);
1067
1076
  if (!step.group) {
1068
1077
  const payload = {
@@ -1,11 +1,11 @@
1
1
  # packages/playwright/lib/worker/workerProcessEntry.js
2
- # total: 81.0 KB
2
+ # total: 81.5 KB
3
3
 
4
4
  ## Inlined (9)
5
5
  4.6 KB packages/playwright/src/speculativeBrowser.ts
6
6
  3.7 KB packages/playwright/src/util.ts
7
7
  8.7 KB packages/playwright/src/worker/fixtureRunner.ts
8
- 21.3 KB packages/playwright/src/worker/testInfo.ts
8
+ 21.8 KB packages/playwright/src/worker/testInfo.ts
9
9
  11.9 KB packages/playwright/src/worker/testTracing.ts
10
10
  5.4 KB packages/playwright/src/worker/timeoutManager.ts
11
11
  0.3 KB packages/playwright/src/worker/util.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flashwright",
3
- "version": "1.64.1-flashwright.3",
3
+ "version": "1.64.1-flashwright.4",
4
4
  "description": "Flashwright: a faster drop-in replacement for Playwright (fork of Playwright 1.64.1)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "license": "Apache-2.0",
50
50
  "dependencies": {
51
- "playwright-core": "npm:flashwright-core@1.64.1-flashwright.3"
51
+ "playwright-core": "npm:flashwright-core@1.64.1-flashwright.4"
52
52
  },
53
53
  "bugs": {
54
54
  "url": "https://github.com/xcodebeast/flashwright/issues"