Skip to content

Avoid global namespace pollution #2

Open
@fef1312

Description

@fef1312

Right now, anything that is required in multiple places is either stored in the global.videu object (for configuration data) or the module exporting it is just imported wherever needed (e.g. the repositories).

This scheme kind of works, but making mistakes is quite easy and it gets more and more difficult to maintain as the codebase grows. Especially stuff like modifying types from external packages (express in this case) is probably a time bomb. We should migrate to a more sophisticated, object-oriented design. This not only provides better ways of abstraction, it also enables us to use TypeScript's type system to its full extent (I'm thinking of stuff like the request body from express, which has no central validation system right now and has an any type).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions