You may have noticed a glaring flaw with Hotcake - no model adjustment logic!
If you make changes to the way you represent your data model between versions, your clients will be stuck using the
old data model, while your newly hotswapped code will be using logic which depends on the new data model - that's bad.
Hotcke doesn't offer an explicit solution to this, because it's more of a pattern problem than a Hotcake problem.
However, one easy solution is to have a separate script file, that is not included in the HEAD of your document,
which handles upgrades between versions of your code and models. In this example, it's named "upgrade.js", and it's
included in every hotswap, as the very last script evaluated.
Here, we go from a very simple model ("Apple") which contains an integer number of seeds;
to a model where each seed is described as its own object as part of an array.


People are interested into this house
More than 500 people checked this rental in last month.
{{ newBooking.startAt }} to {{ newBooking.endAt }}
Guests: {{ newBooking.guests }}
Price: {{ newBooking.totalPrice }}$
Do you confirm booking for selected days?
{{ error.detail }}


FlipNotes
Need To Add A New Deck? Do So Here!
Create A New Card!
Select a deck from the drop-down, or use the form up top to add a new one!
Select a deck below to see its cards!