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

v5.0.0 #1919

Merged
merged 54 commits into from
Mar 20, 2019
Merged

v5.0.0 #1919

merged 54 commits into from
Mar 20, 2019

Conversation

HazAT
Copy link
Member

@HazAT HazAT commented Feb 21, 2019

While this major version bump and therefor "breaking", if people where using the exposed high level functions like:

Sentry.init
Sentry.captureException
Sentry.captureMessage
Sentry.addBreadcrumb
...

nothing changes. There are some internal breaking changes if you directly worked with a Client, please see Changelog for more details.

  • Remove install function
  • Remove public async API (except eventProcessors, beforeSend)
  • Hide stuff in typedoc
  • Remove deprecated API
  • Do not expose Backend in index.ts
  • Make close dispose / disable the client
  • maxValueLength option
  • Add module to package.json to support esm/esnext
  • Extract "pluggable" integrations into own package
  • Use SyncPromise -> Our implementation of a promise that can be sync once resolved
  • Make Dedupe optional?
  • Figure out how to serve "pluggable" integration via the cdn (maybe https://unpkg.com/)
  • Delete Branch ref/make-sync Use SyncPromise internally & Remove deprecated API & Trim Public API #1858
  • Find out which polyfills we need to make it work on ie10/11

@benvinegar
Copy link
Contributor

@HazAT Why not keep install as a no-op (with maybe a console warning)? Why is it necessary to remove this method?

@HazAT
Copy link
Member Author

HazAT commented Feb 26, 2019

hey @benvinegar :)

install wasn't really used in @sentry/browser already.
Only to set Error.stackTraceLimit = 50;
see: https://github.com/getsentry/sentry-javascript/pull/1919/files#diff-dda6e6fb49918cb8c88c1e6af83e4585L34

So with that change we really only remove implicit internal functionality, since the only call to install was in init: https://github.com/getsentry/sentry-javascript/pull/1919/files#diff-867baf4b7df6e7e6158b92082b86d68fL25

Instead now we set the stackTraceLimit in the global error handler integration.

Keeping this as a noop doesn't really add anything since it, as mentioned before, install was only used in raven-js.
With the new SDKs we made install implicit by just calling init.

@benvinegar
Copy link
Contributor

If I'm running 4.x, and I install 5.x, under what conditions will I have to change my code (public async API)?

@HazAT
Copy link
Member Author

HazAT commented Feb 27, 2019

@benvinegar There are no code changes needed, the "Static API" didn't change.

Sentry.init({dsn: "DSN"});
Sentry.captureException(new Error('test')); // This was never a promise

Internally if you created your own Client, something like:

const client = new Browser_Client({dsn: "DSN"});
client.captureException(new Error('test')); // <- this no longer returns a promise

the API of Client no longer returns Promise instead now only returns string | undefined (event_id).

@HazAT HazAT changed the title v5.0.0 [WIP] v5.0.0 Mar 11, 2019
@HazAT HazAT marked this pull request as ready for review March 11, 2019 08:09
@HazAT HazAT requested a review from kamilogorek as a code owner March 11, 2019 08:09
kamilogorek and others added 17 commits March 19, 2019 13:14
…PIs (#1858)

* ref: Move PromiseBuffer and Error to utils package
* ref: Remove all async api
* ref: Remove invokeClientAsync function
* feat: Finish Node SDK
* feat: SyncPromise implementation
* fix: Browser SDK
* fix: beforeSend callback
* fix: Core tests
* fix: linting and tests
* fix: browser npm package + add error for manual tests
* meta: Remove deprecations
* fix: Typedocs and public exposed functions
* meta: Changelog
* Apply suggestions from code review
* fix: Events created from exception shouldnt have top-level message attribute (#1831)
* Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858)
* ref: Move PromiseBuffer and Error to utils package
* ref: Remove all async api
* ref: Remove invokeClientAsync function
* feat: Finish Node SDK
* feat: SyncPromise implementation
* fix: Browser SDK
* fix: beforeSend callback
* fix: Core tests
* fix: linting and tests
* fix: browser npm package + add error for manual tests
* meta: Remove deprecations
* fix: Typedocs and public exposed functions
* meta: Changelog
* Apply suggestions from code review
* ref: Move public interfaces to types package
* fix: Tests
* fix: Small type issues
* ref: Remove scope listeners
* fix: Add flush to interface
* ref: Remove interfaces from core
* ref: Move ExtendedError to a types package
* ref: Remove assign util in favor of Object.assign
* ref: Pass Event to sendEvent instead of just a body
* ref: Remove isArray and isNaN utils
* ref: Rewrite normalization and removed unused utils
* feat: Add maxValueLength option

* meta: Add changelog
* feat: Remove esm rewrite script, expose module

* feat: Add changelog
@HazAT HazAT changed the title [WIP] v5.0.0 v5.0.0 Mar 19, 2019
@getsentry-bot
Copy link
Contributor

getsentry-bot commented Mar 19, 2019

Fails
🚫

TSLint failed: @sentry/node

  • ERROR: /home/travis/build/getsentry/sentry-javascript/packages/node/src/stack-trace.ts[1, 1]: File name must be camelCase
  • ERROR: /home/travis/build/getsentry/sentry-javascript/packages/node/test/stack-trace.test.ts[1, 1]: File name must be camelCase
Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES6: 14.3223 kB) ()

Generated by 🚫 dangerJS against 6755a66

HazAT and others added 3 commits March 19, 2019 14:44
* Fork stack-trace

* Remove stack-trace dependency

* Oops, fix parser tests

* Add attribution to tests and disable prefer-template for file
@HazAT HazAT merged commit 1dda724 into master Mar 20, 2019
@HazAT HazAT deleted the major/5 branch March 21, 2019 08:39
@JCMais
Copy link

JCMais commented May 17, 2019

@HazAT with this change is there any recommended way to retrieve the breadcrumbs for given stack?

Previously I was using:

Sentry.getCurrentHub().stack[0].scope._breadcrumbs

Now I changed it to:

Sentry.getCurrentHub().getStack()[0].scope._breadcrumbs

But I'm still accessing an internal property, and I would like to avoid that.

(context, this is used on this middleware for redux: https://gist.github.com/olavoasantos/9ac791098758ee7dedf0c0424ec8b398#file-sentry-for-redux-js-L84)

@kamilogorek
Copy link
Contributor

kamilogorek commented May 17, 2019

@JCMais we don't expose getters on the scope. However, your example can be simplified to:

Sentry.getCurrentHub().getScope()._breadcrumbs;

getScope is a basically a shortcut for .getStack()[0].scope.

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.

6 participants