You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm definitely starting to feel like `models.ts` has gotten too bloated right? I think there needs to be some amount of separation of our models based on layers.
AKA: the layer that fetches the data from the DB has a bunch of api (renamed from base) models that are more raw representations of the data, and then in another (or multiple other) files we have the view-layer models that have data processed to look exactly as View classes need them to be.
Put another way, netlify function code should only ever see api models, there should be an intermediate layer that transforms api models to view models, and then View vue classes should only ever use view models.
I think we're mostly almost there, we just happen to do a lot of this transforming in the netlify functions right now, and sharing all the types in one models.ts is getting hard to reason about (IMO)
AKA: the layer that fetches the data from the DB has a bunch of
api
(renamed frombase
) models that are more raw representations of the data, and then in another (or multiple other) files we have the view-layer models that have data processed to look exactly asView
classes need them to be.Put another way, netlify function code should only ever see
api
models, there should be an intermediate layer that transformsapi
models toview
models, and thenView
vue classes should only ever useview
models.I think we're mostly almost there, we just happen to do a lot of this transforming in the netlify functions right now, and sharing all the types in one
models.ts
is getting hard to reason about (IMO)Originally posted by @brian-norman in #113 (comment)
The text was updated successfully, but these errors were encountered: