Apps are bundled in packages. When a new version of a package is released,
users are going to update the package, and with it all apps in the package.
It may be necessary to apply changes to all instances of those apps,
for example, when an attribute named
foo is to be renamed to
.Update method is for this purpose: to update all affected files.
(All files that are instances of apps of the updated package.)
Let’s assume you are the vendor of the package
example.com, and you have a
gallery app at
example.com/gallery-1. Your app uses a string attribute
that you want to rename to
/gallery-2as you can’t reuse the application path.
/gallery-1and set its type to
.Updatefile’s link property to
reference /gallery-2. (This documents that the
/gallery-2app supersedes the
/gallery-1app. Required to do updates one version at a time.)
sjs-3or any interpreter of your choice, and write the code that will do the transformation:
fwill point to the instance being transformed.
fmay have a longer typeChain to your app. It is guaranteed that the files on the typeChain of
fwill be updated after
fitself. Thus, the typeChain of
fto point to
/gallery-2, it will be done automatically. In fact, it may not need to be updated, if there is a longer typeChain.
Updating an entire package is a single transaction.
In the above example, never ever remove the file
/gallery-1. It makes sure
that restoring an old version of a website will continue to just work.
.Trustrules of a website during an update is not currently supported. Get in touch if you need it implemented. Note that the website owner will have to approve
.Trustchanges every single time.