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

feat!: use bundled event emitter type #389

Merged
merged 4 commits into from
Mar 31, 2023
Merged

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Mar 30, 2023

⚠️ This change only impacts the experimental web-sdk.

This includes an aliased, bundled version of EventEmitter so we have full control over that API/implementation, and consumers don't need the events dep for browsers.

We currently bundle events (a browser polyfill for the node events API) into this package, but a provider author who wants to implement events in their provider would need to install that package as well. This removes the need for that. Interested in others' thoughts.

Signed-off-by: Todd Baert <toddbaert@gmail.com>
@toddbaert toddbaert requested a review from a team March 30, 2023 13:33
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #389 (eee7dab) into main (eb00fb0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #389   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          18       18           
  Lines        1326     1326           
  Branches      101      101           
=======================================
  Hits         1324     1324           
  Misses          2        2           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Todd Baert <toddbaert@gmail.com>
@toddbaert toddbaert requested a review from kinyoklion March 30, 2023 13:46
@toddbaert toddbaert marked this pull request as draft March 30, 2023 13:57
Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Todd Baert <toddbaert@gmail.com>
@kinyoklion
Copy link
Member

I think this is a step in the right direction. I know you are only intending to change the client at the moment, but I think this would generally be important for server as well, though it may also become less so over time. Edge environments have their own non-node version of a number of libraries, so it would be convenient to be able to swap. I think Cloudflare added EventEmitter around a week ago, for instance.

@toddbaert toddbaert marked this pull request as ready for review March 30, 2023 16:04
@beeme1mr
Copy link
Member

I'm wondering if we should define our own interface that the events library just happens to conform with. I'm not sure if it's worth the effort, but it would be a way to support custom event emitters and ensure that events doesn't change in a breaking way.

@toddbaert
Copy link
Member Author

toddbaert commented Mar 30, 2023

I'm wondering if we should define our own interface that the events library just happens to conform with. I'm not sure if it's worth the effort, but it would be a way to support custom event emitters and ensure that events doesn't change in a breaking way.

I think that exposing (and aliasing) our own export allow us to defer this decision. Of course, the underlying events lib could change underneath us, but between reasonable unit tests (yet to be written) and a locked version of that dep, I think we can call this good enough for now.

I dont think it would be a huge effort though, so we could do as you say if you feel like it's worth it.

@toddbaert toddbaert merged commit 47d1634 into main Mar 31, 2023
toddbaert pushed a commit that referenced this pull request Apr 3, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.3.0-experimental](web-sdk-v0.2.0-experimental...web-sdk-v0.3.0-experimental)
(2023-04-03)


### ⚠ BREAKING CHANGES

* use bundled event emitter type
([#389](#389))

### Features

* use bundled event emitter type
([#389](#389))
([47d1634](47d1634))


### Bug Fixes

* fix readme typo
([a23f899](a23f899))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
lukas-reining pushed a commit that referenced this pull request Jun 29, 2023
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

None yet

3 participants