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

fix(react): Import default for hoistNonReactStatics #15238

Merged
merged 5 commits into from
Jan 31, 2025

Conversation

chargome
Copy link
Member

This came up during upgrading Sentry to our v9 alpha (getsentry/sentry#84258).

Currently our import emits this line in cjs:
hoistNonReactStatics.default(Wrapped, WrappedComponent);
Which results in a runtime error (at least in jest runners).

With this change I updated the import to use import * as hoistNonReactStaticsImport from 'hoist-non-react-statics'; which solves the issue but breaks our ts-check. For this I moved the import into a fallback util function which satisfies ts.

@chargome chargome self-assigned this Jan 30, 2025
@chargome chargome requested review from mydea and AbhiPrasad January 30, 2025 23:59
Copy link
Contributor

github-actions bot commented Jan 31, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.03 KB - -
@sentry/browser - with treeshaking flags 22.92 KB - -
@sentry/browser (incl. Tracing) 35.8 KB - -
@sentry/browser (incl. Tracing, Replay) 72.59 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 66.13 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.85 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.35 KB - -
@sentry/browser (incl. Feedback) 39.71 KB - -
@sentry/browser (incl. sendFeedback) 27.66 KB - -
@sentry/browser (incl. FeedbackAsync) 32.44 KB - -
@sentry/react 24.84 KB -3.34% -879 B 🔽
@sentry/react (incl. Tracing) 37.69 KB -2.25% -885 B 🔽
@sentry/vue 27.14 KB - -
@sentry/vue (incl. Tracing) 37.52 KB - -
@sentry/svelte 23.15 KB - -
CDN Bundle 24.23 KB - -
CDN Bundle (incl. Tracing) 35.91 KB - -
CDN Bundle (incl. Tracing, Replay) 70.56 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 75.69 KB - -
CDN Bundle - uncompressed 70.83 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.57 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.42 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 229.99 KB - -
@sentry/nextjs (client) 38.65 KB - -
@sentry/sveltekit (client) 36.3 KB - -
@sentry/node 156.36 KB - -
@sentry/node - without tracing 97.45 KB - -
@sentry/aws-serverless 106.92 KB - -

View base workflow run

chargome and others added 3 commits January 30, 2025 16:03
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

nice!

@chargome chargome merged commit 25e7071 into develop Jan 31, 2025
67 checks passed
@chargome chargome deleted the cg/fix-default-import branch January 31, 2025 08:30
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.

3 participants