Skip to content

[Refactor]: Remove EventEmitter #139

@SuperVK

Description

@SuperVK

What would you like?

In https://github.com/GEWIS/aurora-client/blob/develop/src/handlers/stage-effects/index.tsx#L1 we use the nodejs events API. This is ideally replaced by another approach, a good starting point is https://stackoverflow.com/questions/45831911/is-there-any-eventemitter-in-browser-side-that-has-similar-logic-in-nodejs

Why is this needed?

We want to remove the react-scripts package, this package is still left over from create-react-app. create-react-app is long sunset, and react-scripts introduces a lot of bloat that is otherwise not needed. However, removing this breaks the app because of: https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility (as EventEmitter is a nodejs API). Why this does work with react-scripts installed is unclear, it seems that something polyfills the event API.

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    For: CodeFor issues which specifically relates to the code, not its functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions