Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Research / Develop plugin for variational images #92

Open
irae opened this issue Apr 4, 2017 · 0 comments
Open

Research / Develop plugin for variational images #92

irae opened this issue Apr 4, 2017 · 0 comments

Comments

@irae
Copy link
Collaborator

irae commented Apr 4, 2017

Here is an useful scenario Mendel could cover: We already have variational CSS and JS, and some variations might include images to change as well. Right now the only way to setup an app environment and have variational images is as follows:

  1. Have some sort of pipeline for image compression and cache busting outside of mendel
  2. Create different images by name, maybe even use variation folder names to create different images
  3. Deploy all images to CDN, use some sort of pipeline tool to pre-process JS files before adding them to JS/CSS. Different variations can point to different images/assets.

It would be great to just have Mendel handle this complexity the same way it handles JS:

  • Add image plugin to have variational images, maybe it is more than one plugin, one for CSS other for JS
  • Use mendel manifest somehow to reference those images, so in production we get multilayer images and the mendel consistent hash algorithm on the URL.
  • CDN reverse proxy (just like mendel already does for JS) with high expiration headers.

There is a lot of benefits from this approach:

  • Clear mental model from variations applied to assets too
  • Mendel becomes a single tool you can write quality production apps
  • No need to duplicate a JS or CSS file on a variation just because of image change, therefore faster development cycle
  • Future potential: manifest diff can show variations to images (we don't have a tool for that yet, but it could be cool to visualize it)

There is one additional complication this needs to solve: How do we reference/get/replace images from CSS and JS? Should we do something similar to bundle splitting for lazy loading? Should we provide a "require" module on JS that calls a method and gets the paths. What about CSS?

@irae irae changed the title Research / develop plugin for image hashing and replacement on JS/CSS files. Research / Develop plugin for variational images Apr 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant