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
Currently the Media objects used to represent assets from Contentful are plain Javascript objects without any functionality, however for certain media types (e.g. images) there exist rich Contentful APIs that provide transforms on the underlying image before serving it up to the client.
I would like to propose changing the Media interface / type to a class hierarchy that has additional functions which would support the broader image API features, such as:
Progressive JPEG
Image resizing
Image cropping
etc.
This change would not break compatibility assuming we had a base interface for Media that still looks the same, but then had classes for specific media types such as ImageMedia that then implemented the interface. You could also just have a base class Media that was subclassed - these are minor implementation details.
The text was updated successfully, but these errors were encountered:
Currently the
Media
objects used to represent assets from Contentful are plain Javascript objects without any functionality, however for certain media types (e.g. images) there exist rich Contentful APIs that provide transforms on the underlying image before serving it up to the client.I would like to propose changing the
Media
interface / type to a class hierarchy that has additional functions which would support the broader image API features, such as:This change would not break compatibility assuming we had a base interface for
Media
that still looks the same, but then had classes for specific media types such asImageMedia
that then implemented the interface. You could also just have a base classMedia
that was subclassed - these are minor implementation details.The text was updated successfully, but these errors were encountered: