Skip to content

ref: Add no-class-field-initializers eslint rule #8700

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

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Aug 1, 2023

Adding a lint rule (see #5316) to enforce initializing of fields in constructor, to reduce bundle size of transpiled code (and streamline this a bit overall).

Closes #5316

@mydea mydea self-assigned this Aug 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 74.69 KB (-0.55% 🔽)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.1 KB (-0.97% 🔽)
@sentry/browser - Webpack (gzipped) 21.8 KB (-0.69% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 69.49 KB (-0.49% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.13 KB (-0.58% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.14 KB (-0.95% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 218.86 KB (-0.99% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 84.57 KB (-1.66% 🔽)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 59.74 KB (-1.23% 🔽)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 30.42 KB (+0.02% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 64.9 KB (-0.41% 🔽)
@sentry/react - Webpack (gzipped) 21.83 KB (-0.61% 🔽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 92.51 KB (-0.45% 🔽)
@sentry/nextjs Client - Webpack (gzipped) 50.62 KB (-0.55% 🔽)

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice! Solid size reduction!

@mydea mydea force-pushed the fn/eslint-use-constructor branch from 35995c3 to f6a50ff Compare August 2, 2023 11:19
@mydea mydea merged commit 050a636 into develop Aug 2, 2023
@mydea mydea deleted the fn/eslint-use-constructor branch August 2, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make sure field initializers don't add bundle size
3 participants