Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: Incorrect "missing transform-jsx-source" warning #4350

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Apr 26, 2024

Fixes #3818

The Preact-CLI usage from the issue is unfortunately borked and not fixable really: CLI has users export their root component which it (CLI) then renders using h() -- no JSX source info is going to be added to that. That creates a situation in which there might not have been any vnodes with .__source set to flow through before getOwnerStack() is called.

Copy link

github-actions bot commented Apr 26, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -2% - +1% (-17.39ms - +10.06ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +5% (-0.14ms - +0.80ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +1% (-0.44ms - +0.45ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +1% (-0.50ms - +0.23ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -3% - +1% (-2.02ms - +1.07ms)
    preact-local vs preact-main
  • text-update: slower ❌ 2% - 7% (0.03ms - 0.12ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +0% (-0.39ms - +0.11ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -2% - +2% (-0.55ms - +0.49ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -3% - +1% (-0.41ms - +0.21ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.02ms - +0.04ms)
    preact-local vs preact-main
  • text-update: faster ✔ 1% - 8% (0.01ms - 0.10ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local881.89ms - 892.92ms-unsure 🔍
-2% - +1%
-17.39ms - +10.06ms
preact-main878.50ms - 903.64msunsure 🔍
-1% - +2%
-10.06ms - +17.39ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local26.75ms - 26.75ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main26.75ms - 26.75msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.64ms - 17.55ms-unsure 🔍
-1% - +5%
-0.14ms - +0.80ms
preact-main16.65ms - 16.88msunsure 🔍
-5% - +1%
-0.80ms - +0.14ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.75ms - 1.75ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.75ms - 1.76msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local73.52ms - 74.16ms-unsure 🔍
-1% - +1%
-0.44ms - +0.45ms
preact-main73.53ms - 74.14msunsure 🔍
-1% - +1%
-0.45ms - +0.44ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local14.01ms - 14.40ms-unsure 🔍
-3% - +1%
-0.41ms - +0.21ms
preact-main14.07ms - 14.54msunsure 🔍
-1% - +3%
-0.21ms - +0.41ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.54ms - 16.94ms-unsure 🔍
-3% - +1%
-0.50ms - +0.23ms
preact-main16.56ms - 17.18msunsure 🔍
-1% - +3%
-0.23ms - +0.50ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.86ms - 4.86ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main4.86ms - 4.86msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local69.89ms - 71.60ms-unsure 🔍
-3% - +1%
-2.02ms - +1.07ms
preact-main69.93ms - 72.51msunsure 🔍
-2% - +3%
-1.07ms - +2.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.67ms - 3.72ms-unsure 🔍
-1% - +1%
-0.02ms - +0.04ms
preact-main3.66ms - 3.70msunsure 🔍
-1% - +0%
-0.04ms - +0.02ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local27.92ms - 28.62ms-faster ✔
1% - 5%
0.18ms - 1.35ms
preact-main28.57ms - 29.51msslower ❌
1% - 5%
0.18ms - 1.35ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local34.76ms - 36.44ms-unsure 🔍
-6% - +1%
-2.35ms - +0.21ms
preact-main35.70ms - 37.63msunsure 🔍
-1% - +7%
-0.21ms - +2.35ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local25.66ms - 26.04ms-unsure 🔍
-2% - +1%
-0.57ms - +0.32ms
preact-main25.57ms - 26.38msunsure 🔍
-1% - +2%
-0.32ms - +0.57ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local24.03ms - 24.85ms-slower ❌
1% - 6%
0.23ms - 1.32ms
preact-main23.31ms - 24.03msfaster ✔
1% - 5%
0.23ms - 1.32ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local28.67ms - 30.50ms-unsure 🔍
-6% - +3%
-1.83ms - +0.86ms
preact-main29.09ms - 31.06msunsure 🔍
-3% - +6%
-0.86ms - +1.83ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local23.56ms - 24.80ms-unsure 🔍
-3% - +4%
-0.82ms - +0.90ms
preact-main23.54ms - 24.73msunsure 🔍
-4% - +3%
-0.90ms - +0.82ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.72ms - 1.79ms-slower ❌
2% - 7%
0.03ms - 0.12ms
preact-main1.65ms - 1.71msfaster ✔
2% - 7%
0.03ms - 0.12ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.16ms - 1.22ms-faster ✔
1% - 8%
0.01ms - 0.10ms
preact-main1.21ms - 1.28msslower ❌
1% - 9%
0.01ms - 0.10ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local27.64ms - 27.86ms-unsure 🔍
-1% - +0%
-0.39ms - +0.11ms
preact-main27.67ms - 28.12msunsure 🔍
-0% - +1%
-0.11ms - +0.39ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.25ms - 1.25ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.25ms - 1.25msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local29.66ms - 30.39ms-unsure 🔍
-2% - +2%
-0.55ms - +0.49ms
preact-main29.68ms - 30.42msunsure 🔍
-2% - +2%
-0.49ms - +0.55ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.69ms - 3.69ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main3.69ms - 3.69msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link

github-actions bot commented Apr 26, 2024

Size Change: -5 B (0%)

Total Size: 61 kB

Filename Size Change
debug/dist/debug.js 3.63 kB -2 B (0%)
debug/dist/debug.module.js 3.62 kB -1 B
debug/dist/debug.umd.js 3.71 kB -2 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 4.09 kB 0 B
compat/dist/compat.module.js 4.01 kB 0 B
compat/dist/compat.umd.js 4.14 kB 0 B
devtools/dist/devtools.js 230 B 0 B
devtools/dist/devtools.module.js 239 B 0 B
devtools/dist/devtools.umd.js 314 B 0 B
dist/preact.js 4.61 kB 0 B
dist/preact.min.js 4.64 kB 0 B
dist/preact.min.module.js 4.64 kB 0 B
dist/preact.min.umd.js 4.67 kB 0 B
dist/preact.module.js 4.62 kB 0 B
dist/preact.umd.js 4.68 kB 0 B
hooks/dist/hooks.js 1.55 kB 0 B
hooks/dist/hooks.module.js 1.59 kB 0 B
hooks/dist/hooks.umd.js 1.63 kB 0 B
jsx-runtime/dist/jsxRuntime.js 976 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 949 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 1.06 kB 0 B
test-utils/dist/testUtils.js 453 B 0 B
test-utils/dist/testUtils.module.js 454 B 0 B
test-utils/dist/testUtils.umd.js 536 B 0 B

compressed-size-action

@coveralls
Copy link

coveralls commented Apr 26, 2024

Coverage Status

coverage: 99.609%. remained the same
when pulling 50c3f3e on fix/jsx-source-debug-warning
into 613cacc on main.

@coveralls
Copy link

Coverage Status

coverage: 99.605%. remained the same
when pulling 784af46 on fix/jsx-source-debug-warning
into aa95aa9 on main.

console.warn(
'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'
);
}
showJsxSourcePluginWarning = false;
Copy link
Member Author

Choose a reason for hiding this comment

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

The idea being that at this point we've either seen .__source or printed the warning, and in either case, we're now covered. hasBabelPlugin previously would only ever be set to true once the warning was shown.

@rschristian rschristian marked this pull request as draft April 26, 2024 04:35
@rschristian rschristian marked this pull request as ready for review April 26, 2024 05:49
@rschristian rschristian merged commit dbc4d61 into main Apr 30, 2024
13 checks passed
@rschristian rschristian deleted the fix/jsx-source-debug-warning branch April 30, 2024 04:34
@JoviDeCroock JoviDeCroock mentioned this pull request Apr 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@babel/plugin-transform-react-jsx-source warning appears regardless of configuration
3 participants