Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Fix vscode breakpoints not being hit #2932

Merged
merged 1 commit into from Jan 15, 2021

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Jan 15, 2021

Turns out that inline source mapping paths are always resolved relative to the source file which had the //# sourceMappingURL= comment. This doesn't play well with breakpoints set from vscode as they expect it to be a straight forward mapping between paths. This is usually the absolute path to the file and vscode has a pathMapping setting to swap out prefixes.

The way webpack solves it, is by always resolving paths to the current working directory and appending webpack:///./ in front of every url. Didn't want to use that, so instead we'll always use the absolute mapping instead. This leads to the launch configuration being shortened to:

{
  "type": "chrome",
  "request": "attach",
  "name": "Attach Karma",
  "address": "localhost",
  "port": 9333
}

Screenshot from 2021-01-15 19-06-51

Screenshot from 2021-01-15 19-09-44

To be able to do that I had switch away from inline source maps in karma-esbuild. They are now always a separate file. An interesting advantage of this approach is that live-editing in Chrome of JS files is much smoother, and IE11 doesn't lag as much when inspecting tests 🎉

@github-actions
Copy link

github-actions bot commented Jan 15, 2021

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -0% - +1% (-0.17ms - +1.78ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -4% - +5% (-1.10ms - +1.52ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -2% - +1% (-34.55ms - +16.46ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -2% - +2% (-0.56ms - +0.51ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -4% - +12% (-5.97ms - +16.66ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -15% - -0% (-5.85ms - +0.06ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -3% - +5% (-0.13ms - +0.18ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -0% - +0% (-0.01ms - +0.02ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 80
  • Built by: CI #719
  • Commit: b7e5170

duration

VersionAvg timevs preact-mastervs preact-local
preact-master148.60ms - 149.68ms-unsure 🔍
-1% - +0%
-1.78ms - +0.17ms
preact-local149.14ms - 150.76msunsure 🔍
-0% - +1%
-0.17ms - +1.78ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.60ms - 3.61ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
preact-local3.60ms - 3.61msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master55.97ms - 56.60ms-unsure 🔍
-0% - +1%
-0.21ms - +0.59ms
preact-local55.85ms - 56.34msunsure 🔍
-1% - +0%
-0.59ms - +0.21ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master87.69ms - 88.32ms-faster ✔
0% - 1%
0.22ms - 1.23ms
preact-local88.33ms - 89.12msslower ❌
0% - 1%
0.22ms - 1.23ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master99.67ms - 101.69ms-unsure 🔍
-2% - +1%
-2.15ms - +0.71ms
preact-local100.39ms - 102.41msunsure 🔍
-1% - +2%
-0.71ms - +2.15ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master55.18ms - 56.71ms-unsure 🔍
-2% - +2%
-1.28ms - +0.90ms
preact-local55.36ms - 56.92msunsure 🔍
-2% - +2%
-0.90ms - +1.28ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master102.34ms - 107.10ms-unsure 🔍
-4% - +2%
-4.51ms - +2.05ms
preact-local103.70ms - 108.21msunsure 🔍
-2% - +4%
-2.05ms - +4.51ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master54.80ms - 55.48ms-unsure 🔍
-2% - +1%
-1.15ms - +0.35ms
preact-local54.88ms - 56.21msunsure 🔍
-1% - +2%
-0.35ms - +1.15ms
-
03_update10th1k_x16
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 110
  • Built by: CI #718
  • Commit: 40daf4b

duration

VersionAvg timevs preact-mastervs preact-local
preact-master38.84ms - 40.70ms-unsure 🔍
-2% - +5%
-0.73ms - +1.89ms
preact-local38.27ms - 40.10msunsure 🔍
-5% - +2%
-1.89ms - +0.73ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.53ms - 3.53ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-local3.52ms - 3.53msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
07_create10k
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 50
  • Built by: CI #719
  • Commit: b7e5170

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1509.07ms - 1542.90ms-unsure 🔍
-1% - +2%
-16.46ms - +34.55ms
preact-local1497.85ms - 1536.04msunsure 🔍
-2% - +1%
-34.55ms - +16.46ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master25.99ms - 25.99ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local25.99ms - 25.99msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter_list
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 50
  • Built by: CI #719
  • Commit: b7e5170

duration

VersionAvg timevs preact-mastervs preact-local
preact-master27.67ms - 28.39ms-unsure 🔍
-2% - +2%
-0.51ms - +0.56ms
preact-local27.61ms - 28.40msunsure 🔍
-2% - +2%
-0.56ms - +0.51ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.60ms - 1.60ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-local1.60ms - 1.60msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
hydrate1k
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 80
  • Built by: CI #719
  • Commit: b7e5170

duration

VersionAvg timevs preact-mastervs preact-local
preact-master136.14ms - 147.77ms-unsure 🔍
-11% - +4%
-16.66ms - +5.97ms
preact-local137.60ms - 157.01msunsure 🔍
-4% - +12%
-5.97ms - +16.66ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.19ms - 6.21ms-unsure 🔍
-0% - +0%
-0.02ms - +0.01ms
preact-local6.20ms - 6.22msunsure 🔍
-0% - +0%
-0.01ms - +0.02ms
-
many_updates
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 80
  • Built by: CI #719
  • Commit: b7e5170

duration

VersionAvg timevs preact-mastervs preact-local
preact-master36.50ms - 41.10ms-unsure 🔍
-0% - +17%
-0.06ms - +5.85ms
preact-local34.05ms - 37.76msunsure 🔍
-15% - -0%
-5.85ms - +0.06ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.85ms - 4.85ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local4.85ms - 4.85msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
text_update
  • Browser: chrome-headless 87.0.4280.141
  • Sample size: 220
  • Built by: CI #719
  • Commit: b7e5170

duration

VersionAvg timevs preact-mastervs preact-local
preact-master3.66ms - 3.84ms-unsure 🔍
-5% - +3%
-0.18ms - +0.13ms
preact-local3.65ms - 3.90msunsure 🔍
-3% - +5%
-0.13ms - +0.18ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master0.83ms - 0.83ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local0.83ms - 0.83msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

tachometer-reporter-action v2 for CI

@coveralls
Copy link

coveralls commented Jan 15, 2021

Coverage Status

Coverage remained the same at 99.431% when pulling e5a98d4 on vscode-breakpoints into 70713e4 on master.

@github-actions
Copy link

github-actions bot commented Jan 15, 2021

Size Change: 0 B

Total Size: 42.4 kB

ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.45 kB 0 B
compat/dist/compat.module.js 3.47 kB 0 B
compat/dist/compat.umd.js 3.51 kB 0 B
debug/dist/debug.js 2.99 kB 0 B
debug/dist/debug.module.js 2.98 kB 0 B
debug/dist/debug.umd.js 3.07 kB 0 B
devtools/dist/devtools.js 186 B 0 B
devtools/dist/devtools.module.js 196 B 0 B
devtools/dist/devtools.umd.js 261 B 0 B
dist/preact.js 4.05 kB 0 B
dist/preact.min.js 4.08 kB 0 B
dist/preact.module.js 4.08 kB 0 B
dist/preact.umd.js 4.12 kB 0 B
hooks/dist/hooks.js 1.13 kB 0 B
hooks/dist/hooks.module.js 1.15 kB 0 B
hooks/dist/hooks.umd.js 1.2 kB 0 B
jsx-runtime/dist/jsxRuntime.js 327 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 335 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 405 B 0 B
test-utils/dist/testUtils.js 437 B 0 B
test-utils/dist/testUtils.module.js 439 B 0 B
test-utils/dist/testUtils.umd.js 515 B 0 B

compressed-size-action

@marvinhagemeister marvinhagemeister merged commit 79b3c8f into master Jan 15, 2021
@marvinhagemeister marvinhagemeister deleted the vscode-breakpoints branch January 15, 2021 18:16
Copy link
Member

@andrewiggins andrewiggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants