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 EvenEmitter3 for web-sdk #847

Merged
merged 3 commits into from
Mar 5, 2024
Merged

Conversation

lukas-reining
Copy link
Member

This PR

Fixes an issue where the events node polyfill does not comply to the node:events types.
When trying to use the web OpenFeatureEventEmitter the following error message comes up, describing that the events polyfill's EventEmitter is incompatible to node:events EventEmitter.

✘ [ERROR] TS2416: Property 'eventEmitter' in type 'OpenFeatureEventEmitter' is not assignable to the same property in base type 'GenericEventEmitter<ProviderEmittableEvents, Record<string, unknown>>'.
  Type 'EventEmitter' is not assignable to type 'PlatformEventEmitter'.
    Types of property 'addListener' are incompatible.
      Type '(type: string | number, listener: Listener) => EventEmitter' is not assignable to type '(eventName: string | symbol, listener: (...args: any[]) => void) => PlatformEventEmitter'.
        Types of parameters 'type' and 'eventName' are incompatible.
          Type 'string | symbol' is not assignable to type 'string | number'.
            Type 'symbol' is not assignable to type 'string | number'.

This PR fixes that issue by not using the events anymore and instead using https://www.npmjs.com/package/eventemitter3

cc @toddbaert

Related Issues

Fixes #845

@lukas-reining lukas-reining requested a review from a team as a code owner March 5, 2024 21:58
@toddbaert
Copy link
Member

@lukas-reining @beeme1mr I pushed a small change to remove @types/events since it's not needed now.

@lukas-reining
Copy link
Member Author

@lukas-reining @beeme1mr I pushed a small change to remove @types/events since it's not needed now.

Ah sure missed that one thanks!

@toddbaert toddbaert added this pull request to the merge queue Mar 5, 2024
Merged via the queue into main with commit 861cf83 Mar 5, 2024
9 checks passed
@toddbaert toddbaert deleted the fix/use-eventemitter3-for-web branch March 5, 2024 22:47
toddbaert pushed a commit that referenced this pull request Mar 5, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.0.28](core-v0.0.27...core-v0.0.28)
(2024-03-05)


### ✨ New Features

* use EvenEmitter3 for web-sdk
([#847](#847))
([861cf83](861cf83))

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

---------

Signed-off-by: OpenFeature Bot <[email protected]>
Signed-off-by: openfeature-peer-update-bot <[email protected]>
Co-authored-by: openfeature-peer-update-bot <[email protected]>
toddbaert pushed a commit that referenced this pull request Mar 5, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.4.15](web-sdk-v0.4.14...web-sdk-v0.4.15)
(2024-03-05)


### ✨ New Features

* use EvenEmitter3 for web-sdk
([#847](#847))
([861cf83](861cf83))


### 🧹 Chore

* **main:** release core 0.0.28
([#849](#849))
([31b92a9](31b92a9))

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

Signed-off-by: OpenFeature Bot <[email protected]>
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.

[BUG] Removing skipLibCheck throws an error
3 participants