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

Proposed API and build improvements #45

Open
8 of 9 tasks
bz2 opened this issue Nov 20, 2018 · 4 comments
Open
8 of 9 tasks

Proposed API and build improvements #45

bz2 opened this issue Nov 20, 2018 · 4 comments

Comments

@bz2
Copy link
Contributor

bz2 commented Nov 20, 2018

Thanks for publishing this library, have been using it a quite heavily over the last few months to record frontend errors in the same place as we track backend problems. Out of this, I'd like to submit some improvements, some of which may require some discussion and decisions, so this is a meta issue for tracking the proposed changes.

Library API

Currently StackdriverErrorReporter exposes a callback parameter in a few places, mostly to enable the testing. This allows some errors to be seen by callers, but does not expose the extracted stacktrace message and is somewhat awkward to use. As stacktrace-js already uses promises, I suggest the interface here should too. The promise api is widely available and there's a polyfill bundled in the build already (though this may want some tweaking, see below).

When calling report() directly from a logging framework, stacktraces for strings currently start inside the logger rather than at the caller.

Build and packaging

This is a simple library and doesn't need a complicated build, but there are a few niggles currently when embedding in a modern webapp, and the single file bundle could also been improved. Not sure how far to go on this front, but there are some simple improvements to make at least.

@steren
Copy link
Collaborator

steren commented Nov 20, 2018

Thanks for your contributions. They look good to me.
I will be reviewing the changes within the next days.

@bz2
Copy link
Contributor Author

bz2 commented Nov 21, 2018

Thank you very much for review and landing so far!

Will put the next batch up for consideration later.

Main things to resolve are what specifically report() should resolve and reject into, and how to produce both a simple ES5 compatible bundled file and a clean module interface.

@steren
Copy link
Collaborator

steren commented Jun 2, 2019

I created a new release with all your existing improvements.

Thanks a lot for your contributions!

@bz2
Copy link
Contributor Author

bz2 commented Jun 3, 2019

@steren Thanks! Will update our code to use latest version and some of the new interfaces.

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

No branches or pull requests

2 participants