Types for PubSweet
Types!
End Goal
The end goal is to have a set of interfaces that can be used to build and describe other types throughout the system. Some of the advantages of this are:
- Better decoupling - strongly defined interfaces make it easier to see and avoid dependencies across modules
- More Generics - by using abstract interfaces instead of concrete types, it becomes easier to write generic functions that will lead to more extensive reuse.
- Shared Types === Shared Code - if all the projects that use PubSweet have the same set of types they can use, it becomes much easier to contribute code back to PubSweet as all the code uses a common vocabulary to describe the data it processes.
Basic Roadmap
There are a few things we need to do before we get there though:
-
1.1: Add typescript build/lint config to PubSweet -
1.2: Add some concrete types to PubSweet (i.e. transfer the new base model into typescript interfaces
that map 1-1 to base model entities) -
1.3: Split those concrete types into a set of interfaces that can be used to describe common types throughout PubSweet. -
2.1: Add the interface for a message queue
The plan
- We're probably going to re-purpose !593 (closed), for delivering 1.1 and 1.2
- Then we'll work on splitting those types down into interfaces (1.3)