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

ref(browser): Simplify TraceKit parser and reorganize tests #4514

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Feb 7, 2022

Refactors and reorganises typekit unit tests:

  • Categorised tests per platform/target/framework rather than original/custom
  • Ensures parse results are tested against the full result object including message and name which were previously not checked
  • Moved stack strings into individual test so it's easier to visually compare to the output

Makes a few simplifications to tracekit parser including:

  • Remove unused parsed function args
  • Move address at stripping to the Chrome regex
  • Remove use in Firefox of error.columnNumber since it's not used and even the original typekit tests expect what appears in the stack string

@timfish
Copy link
Collaborator Author

timfish commented Feb 8, 2022

Guessing these code analysis results are false positives since it's highlighting regexes that I haven't even modified?

@AbhiPrasad
Copy link
Member

Guessing these code analysis results are false positives since it's highlighting regexes that I haven't even modified?

It might be that CodeQL only scans code that was changed (and tracekit regex hasn’t been moved for a while). I’ll mark as false positive for now.

@AbhiPrasad AbhiPrasad changed the title Refactor typekit tests and minor simplifications ref(browser): Simplify TraceKit parser and reorganize tests Feb 9, 2022
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Seems to have ~0.7% difference in minified, non-gzipped bundle (which is what we are focusing on)

@sentry/browser - CDN Bundle (gzipped)
Size limit: 100 KB
Size:       19.63 KB with all dependencies, minified and gzipped

@sentry/browser - CDN Bundle (minified)
Size limit: 120 KB
Size:       62.75 KB with all dependencies and minified

@sentry/browser - Webpack
Size limit: 100 KB
Size:       22.16 KB with all dependencies, minified and gzipped

@sentry/browser - Webpack - gzip = false
Size limit: 100 KB
Size:       75.87 KB with all dependencies and minified

@sentry/react - Webpack
Size limit: 100 KB
Size:       22.19 KB with all dependencies, minified and gzipped

@sentry/nextjs Client - Webpack
Size limit: 100 KB
Size:       46.26 KB with all dependencies, minified and gzipped

@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)
Size limit: 100 KB
Size:       28.18 KB with all dependencies, minified and gzipped

@AbhiPrasad
Copy link
Member

I'm gonna tag @kamilogorek for a review for some added confidence.

Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

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

LGTM! We have all custom made changes covered with tests, so I trust them just fine.

@AbhiPrasad AbhiPrasad merged commit b476532 into getsentry:master Feb 10, 2022
@AbhiPrasad AbhiPrasad added this to the Treeshaking / Bundle Size milestone Feb 10, 2022
@timfish timfish mentioned this pull request Feb 10, 2022
15 tasks
@timfish timfish deleted the easy-wins branch February 11, 2022 17:10
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