-
Notifications
You must be signed in to change notification settings - Fork 7
Transform to Typescript - #274 #275
Conversation
…el, remove manually generated d.ts, new rollup config and cleanup, export honeybadger from js, new version number (patch)
@@ -9,7 +9,7 @@ | |||
"url": "git+ssh:https://[email protected]/honeybadger-io/honeybadger-react.git" | |||
}, | |||
"main": "dist/honeybadger-react.cjs.js", | |||
"types": "./honeybadger-react.d.ts", | |||
"types": "./dist/index.d.ts", |
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.
Type definitions are now generated dynamically when installing the package! 🥳
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@honeybadger-io/react", | |||
"version": "1.0.2", | |||
"version": "2.0.0", |
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.
I decided to bump the major version because we are introducing a breaking change. See details in PR description and we can discuss this further.
@@ -1,30 +1,27 @@ | |||
import babel from 'rollup-plugin-babel' |
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.
A number of these deps were unnecessary so I did some cleanup.
@@ -0,0 +1,9 @@ | |||
import Honeybadger from "@honeybadger-io/js" |
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.
Exporting core Honeybadger
from @honeybadger-op/js
to make react integration simpler.
We try to stick to the approved subset of headings defined by keepachangelog (https://keepachangelog.com/en/1.0.0/). I added a prefix to call out the breaking change.
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.
Looks good, thanks! Feel free to merge this when ready. I'll cut the release and then merge the docs PR.
👌 Will do another round of testing (probably tomorrow) and merge. |
@joshuap This is ready to release. |
2.0.0 has been released |
Awesome! Will test the release asap. |
Status
READY
Description
This PR introduces a typescript version of the react component, which means auto-generated typescript delcaration files (
.d.ts
).It also exports the
Honeybadger
object from@honeybadger-io/js
.This simplifies the component's integration from:
to:
Related PRs
docs - https://github.com/honeybadger-io/docs/pull/141
Todos
@honeybadger-js
- BREAKING CHANGESteps to Test or Reproduce
I tested this by creating a react app with the typescript template.
I then installed the honeybadger-react package and imported the component slightly differently.
src/index.tsx
and do: