Skip to content

Conversation

@AbhiPrasad
Copy link
Member

Folks gave some feedback that we should be explicit about the units we
support. Let's add TypeScript types for these so we don't add any
runtime logic, but it should have helpful autocomplete for users.

cc @k-fish who brought this up with getsentry/sentry#36012

Folks gave some feedback that we should be explicit about the units we
support. Let's add TypeScript types for these so we don't add any
runtime logic, but it should have helpful autocomplete for users.
@AbhiPrasad AbhiPrasad requested review from Lms24 and lforst June 24, 2022 18:20

__DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS');
_measurements['cls'] = { value: metric.value, unit: 'none' };
_measurements['cls'] = { value: metric.value, unit: '' };
Copy link
Member Author

Choose a reason for hiding this comment

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

'none' === '' here, but this saves us some bytes.

Copy link
Member

@k-fish k-fish left a comment

Choose a reason for hiding this comment

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

Appreciate it 👍 this makes it far easier to use without looking things up.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.3 KB (added)
@sentry/browser - ES5 CDN Bundle (minified) 59.72 KB (added)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.9 KB (added)
@sentry/browser - ES6 CDN Bundle (minified) 52.67 KB (added)
@sentry/browser - Webpack (gzipped + minified) 19.67 KB (added)
@sentry/browser - Webpack (minified) 64.04 KB (added)
@sentry/react - Webpack (gzipped + minified) 19.69 KB (added)
@sentry/nextjs Client - Webpack (gzipped + minified) 43.85 KB (added)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.63 KB (added)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.9 KB (added)

@AbhiPrasad AbhiPrasad merged commit 446a295 into master Jun 27, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-measurement-unit branch June 27, 2022 15:35
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