-
Notifications
You must be signed in to change notification settings - Fork 62
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
Improve TypeScript usage #612
Conversation
Also: while working on this, I noticed there's nothing in the docs about working with TypeScript or ES Modules. For instance, should users do Not a priority (React doesn't even support native ESM yet) but I think some folks will eventually start asking about it as ESM gains traction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is beautiful. Thanks!
@shipjs prepare |
@joshuap |
(Apologies for the size of the PR; the changes involved turned out to be a little more than anticipated.)
This PR:
@types/express
to our dependencies, fixing Typescript module error #604if (typeof thing === 'object')
, with the subtle bug thatnull
in JS also returnsobject
.tsconfig.json
, then updating our Rollup config to point to the right paths for each build. However, this generates separate type decl files for the two builds, so there's a manualhoneybadger.d.ts
file that re-exports them as one file as before. Additionally, users can still import thebrowser/honeybadger.d.ts
orserver/honeybadger.d.ts
files like before (with the added advantage of accurate types for the build).