How to Migrate to CQ v2
CQ v2 pipeline changes server behavior for CQ to easily support additional features such as Export, Replication, DevMode etc. CQ v1 (current) will continue to work until CQ GA release, then it will be deprecated, so you are recommended to migrate to v2 ASAP.
CQ v2 does not have any serverside logic for CQ content manipulation in comparison with CQ v1, so CQ v2 files are hosted in a file library as-is without any modifications.
If you see in a CQ client app list that your CQ is not "v2" but "old", then it requires migration.

Migration
Step 1: Update metadata.json file
Add "schemaVersion": 2 to the metadata.json file.
Before
{
"id": "b3fcf125-a27a-4012-b33b-feddd006a138",
"name": "devmode",
"description": "",
"baseQuestionType": "SingleForm",
"disableDefaultRendering": true,
"iconUrl": "design/icon.svg",
"designEntryPoint": "design/index.html",
"runtimeEntryPoint": {
"component": "runtime/component.js",
"deps": {
"scripts": [],
"styles": []
}
}
}
After
{
"id": "b3fcf125-a27a-4012-b33b-feddd006a138",
"schemaVersion": 2,
"name": "devmode",
"description": "",
"baseQuestionType": "SingleForm",
"disableDefaultRendering": true,
"iconUrl": "design/icon.svg",
"designEntryPoint": "design/index.html",
"runtimeEntryPoint": {
"component": "runtime/component.js",
"deps": {
"scripts": [],
"styles": []
}
}
}
Step 2: Update runtime entry point code
Replace "register" magic function call (implicit CQ registration) in runtime component entry point with implicit CQ registration via ResponsiveRendering API’s registerCustomQuestion call. Use the same CQ ID as you have in your metadata.json for the registration.
Before
/* global register */
register(function (question, customQuestionSettings, questionViewSettings) {
// TODO: put your code here
});
After
(function () {
Confirmit.pageView.registerCustomQuestion(
"b3fcf125-a27a-4012-b33b-feddd006a138",
function (question, customQuestionSettings, questionViewSettings) {
// TODO: put your code here
}
);
})();
If you are using nodejs pipeline and use imports, you can write it as below (using the exported runApp function from the other file).
import runApp from "./component";
(function () {
Confirmit.pageView.registerCustomQuestion("b3fcf125-a27a-4012-b33b-feddd006a138", runApp);
})();