Skip to content
This repository was archived by the owner on Nov 25, 2022. It is now read-only.

Conversation

@janjakubnanista
Copy link
Contributor

@janjakubnanista janjakubnanista commented Apr 30, 2020

Fixes #91

TypeScript types were missing for opentok-react which is a pain for all TypeScript developers using the library at the moment.

I added the .d.ts files for both opentok-react and the base opentok module. This is not ideal ofc since opentok types should not live in this project. If there is a better place to put them please let me know! It also makes this pull request very large :(

I also added tsd tests for the types I created, these will check the prop types of all exported components.

@nielsdB97
Copy link

After I started working on creating types for this package myself I found this PR. I think it looks great!
The only problem I found was that your typings don't allow for a ref to be passed to OTPublisher and OTSubscriber, whereas the README indicates you can (search for ref={), for which the best solution I found was to extend the props with React.RefAttributes:

export const OTPublisher: React.ComponentType<
    OTPublisherProps & React.RefAttributes<any>
  >;

@janjakubnanista
Copy link
Contributor Author

@nielsdB97 I added the ref properties to both OTSubscriberProps and OTPublisherProps plus added the types for the global OT object

@janjakubnanista
Copy link
Contributor Author

@nielsdB97 I see that the CI check is hanging, is that a known issue or does something need to be done?

@nielsdB97
Copy link

@janjakubnanista for some reason the Karma tests can't be run since travis is failing to spawn a Chrome instance to run them against. According to this comment it might help to clear the Travis NPM cache, but it could also be that a new run will work, as I don't see any related code changes.

@mathieuseguin
Copy link

is there anything I could do to retry the CI build?

Copy link
Contributor

@ggoldens ggoldens left a comment

Choose a reason for hiding this comment

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

LGTM

@ggoldens ggoldens requested a review from msach22 July 6, 2020 14:16
@ggoldens
Copy link
Contributor

ggoldens commented Jul 6, 2020

@msach22 should this PR be pointing to dev branch?

@ggoldens ggoldens changed the base branch from master to dev July 6, 2020 15:01
@msach22
Copy link
Contributor

msach22 commented Jul 6, 2020

@janjakubnanista Thanks for the PR. Could you please open it against the dev branch?

@ggoldens
Copy link
Contributor

ggoldens commented Jul 6, 2020

Rebasing to dev.

Copy link
Contributor

@msach22 msach22 left a comment

Choose a reason for hiding this comment

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

LGTM

@ggoldens ggoldens closed this Jul 6, 2020
@ggoldens ggoldens reopened this Jul 6, 2020
@ggoldens
Copy link
Contributor

ggoldens commented Jul 6, 2020

@janjakubnanista thanks for your PR! I closed it and reopened since travis jobs were not working. Now I see it's not passing. Can you check it? Thanks!

@janjakubnanista
Copy link
Contributor Author

@janjakubnanista thanks for your PR! I closed it and reopened since travis jobs were not working. Now I see it's not passing. Can you check it? Thanks!

@ggoldens I see that karma is failing to capture the chrome browser for unit test, this looks like an unrelated issue at first sight (I remember issues like these with karma from a ling time ago but can't quite remember what it was). Does this issue maybe appear in other PRs?

@ggoldens
Copy link
Contributor

ggoldens commented Jul 7, 2020

@janjakubnanista thanks for your PR! I closed it and reopened since travis jobs were not working. Now I see it's not passing. Can you check it? Thanks!

@ggoldens I see that karma is failing to capture the chrome browser for unit test, this looks like an unrelated issue at first sight (I remember issues like these with karma from a ling time ago but can't quite remember what it was). Does this issue maybe appear in other PRs?

I opened another PR to fix travis: #135

@ggoldens ggoldens merged commit 0e40471 into opentok:dev Jul 7, 2020
@enricop89
Copy link
Contributor

@janjakubnanista thanks for the PR. One quick question: shouldn't we add the types key on the package.json?

Something like:

"types": "types/index.d.ts"

@janjakubnanista
Copy link
Contributor Author

@enricop89 Yes indeed! Moreover there now is a new script in package.json, test, that can be used to make sure the type definitions don't break. I think it would make sense to take a look and put it somewhere in the pipeline.

@enricop89
Copy link
Contributor

@janjakubnanista thanks, could you please push the changes? I'll review them

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript definitions for opentok-react

6 participants