If a version other than 1, which is the default, is specified for the version property in the widget.json  file, then Commerce Cloud will use that version number as part of the path for loading widget files. For example, the JavaScript file for the first version of a widget (either explicitly stated as "version" : "1" or no version specified) is loaded using the URI:

/file/widget/myWidget/js/myWidget.js

If v1 is later replaced on the system with v2 of the same widget, then the JavaScript file is loaded using the URI:

/file/widget/v2/myWidget/js/myWidget.js

In other words, the root folder for the widget has changed from /file/widget/myWidget to /file/widget/v2/myWidget. This can provide a form of cache-busting, ensuring that the correct files are loaded for the widget.

However, Commerce Cloud does not allow multiple versions of a widget to be uploaded at the same time. That is, if a version of a widget (v1) is uploaded in an extension and, at a later time, a new version (v2) is to be uploaded, the extension containing v1 must first be deactivated before the extension with v2 can be uploaded.

The version property in widget.json also serves as a useful reference for the widget developer.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices