Upgrading to the latest BMC Helix Innovation Studio SDK
To upgrade to the latest BMC Helix Innovation Studio SDK
- After you receive a notification that your BMC Helix Innovation Studio has been updated, download the BMC Helix Innovation Studio SDK ZIP file (com.bmc.arsys.rx.sdk-23.3.04.zip).
- Install Node.js version 16.20.1 and Yarn version v1.22.19. For more information, see To install Node.js and To install Yarn.
- The development environment has changed to OpenJDK. To install OpenJDK, see Setting-up-your-IDE-and-installing-BMC-Helix-Innovation-Studio-SDK.
Comment the maven-default-http-blocker to avoid the following error on HTTP download:
Could not transfer artifact com.bmc.arsys.mojo:is-build-helper-maven-plugin:pom:1.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [bmcmanaged-nexus-tps (http://<server>:<port>/nexus/content/repositories/BMCRemedyManagedRepo, default, releases+snapshots)<!--
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
-->Some Maven repositories might not be available over HTTP. If your maven compilation fails due to the error, Return code is: 501 , ReasonPhrase:HTTPS Required, add the following entry in the <mirrors> section in the settings.xml file located in your <maven installation>/conf directory.
For more information, see Creating-a-Project-using-Maven-and-the-Archetype.<mirror>
<id>central-over-https</id>
<mirrorOf>central</mirrorOf>
<name>Maven Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</mirror>- Rename your current SDK folder to create a backup.
For example, rename it to com.bmc.arsys.rx.sdk-23.0.03.BACKUP. - At the location where you want to install the SDK, create a new SDK folder and extract the BMC Helix Innovation Studio SDK ZIP file (com.bmc.arsys.rx.sdk-23.3.04.zip).
- Add an environment variable, RX_SDK_HOME, that points to the sdk folder location.
- Find the .m2 folder (usually located in your user directory, such as %USERPROFILE%\.m2\repository\com\bmc on windows). Delete the arsys and rx folders located there.
Install BMC Helix Innovation Studio SDK in your Maven repository by using the following commands:
\com.bmc.arsys.rx.sdk-23.3.04> cd lib
\com.bmc.arsys.rx.sdk-23.3.04\lib> mvn clean installUpdate the archetype-catalog.xml file to delete the earlier archetype versions (for example 23.3.03) and make sure the archetype-catalog.xml file has the archetype version as 23.3.04-SNAPSHOT.
The archetype-catalog.xml file might be located at the following locations:
- .m2
- .m2/repository
For example:
<archetype>
<groupId>com.bmc.arsys</groupId>
<artifactId>rx-sdk-archetype-application</artifactId>
<version>23.3.04-SNAPSHOT</version>
<description>Rx SDK application archetype</description>
</archetype>
To upgrade your application or library by using the SDK version 23.3.03 to 23.3.04
To upgrade your applications or libraries created by using the SDK from version 23.3.03 or earlier to 23.3.04, perform the following steps:
Change the version of the following parameter in the parent pom.xml file located in the project folder:
Current version
Updated version
<rx-sdk.version>23.3.03-SNAPSHOT</rx-sdk.version><rx-sdk.version>23.3.04-SNAPSHOT</rx-sdk.version><javac.version>11</javac.version>
<javac.version>17</javac.version>
<maven-bundle-plugin.version>4.0.0</maven-bundle-plugin.version>
<maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
<!--felix maven bundle plugin uses bnd lib biz.aQute.bndlib -->
<bnd.version>6.3.1</bnd.version><jersey.version>2.29</jersey.version>
<jersey.version>2.42</jersey.version>
- Delete the content of the following folders:
- /bundle/src/main/webapp/scripts/
- /bundle/src/main/webapp/tools/
- /bundle/src/main/webapp/apps/
- /bundle/src/main/webapp/dist/
- /bundle/src/main/webapp/styles/
- /bundle/src/main/webapp/node_modules/
- Delete the following file:
/bundle/src/main/webapp/yarn.lock Build, export, and deploy your application project. For example:
myproj> mvn clean install -Pexport -Pdeploy- Verify that your application functions correctly.
(Optional) Perform this step only if you are running unit test cases. Update the unit test configuration.
Replace the content of jest.preset.js file from /bundle/src/main/webapp/libs/com-example-foo location with the following content:
Beforeconst {pathsToModuleNameMapper} = require('ts-jest');
const {compilerOptions} = require('../../tsconfig.base.json');
module.exports = {
displayName: 'com-example-foo',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/libs/com-example-foo',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment'
],
setupFilesAfterEnv: ["<rootDir>/src/test-setup.ts"],
globals: {
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
stringifyContentPathRegex: "\\.(html|svg)$",
},
},
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular'
},
moduleNameMapper: Object.assign(
{
"^uuid$": "uuid",
"^lodash-es$": "lodash"
},
pathsToModuleNameMapper(compilerOptions.paths, {prefix: '<rootDir>/../../'})
),
testEnvironment: 'jsdom',
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
testRunner: 'jest-jasmine2'
};After
const {pathsToModuleNameMapper} = require('ts-jest');
const {compilerOptions} = require('../../tsconfig.base.json');
module.exports = {
displayName: 'com-example-foo',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/libs/com-example-foo',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment'
],
setupFilesAfterEnv: ["<rootDir>/src/test-setup.ts"],
globals: {
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
stringifyContentPathRegex: "\\.(html|svg)$",
},
},
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular'
},
moduleNameMapper: Object.assign(
{
"^uuid$": "uuid",
"^lodash-es$": "lodash",
"@joint/plus": "file:./scripts/clientio/joint-plus-4.0.1.tgz"
},
pathsToModuleNameMapper(compilerOptions.paths, {prefix: '<rootDir>/../../'})
),
testEnvironment: 'jsdom',
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
testRunner: 'jest-jasmine2'
};
To upgrade your application or library by using the SDK version 23.3.02 to 23.3.03
To upgrade your applications or libraries created by using the SDK from version 23.3.02 or earlier to 23.3.03, perform the following steps:
Change the version of the following parameter in the parent pom.xml file located in the project folder:
Current version
Updated version
<rx-sdk.version>23.3.02-SNAPSHOT</rx-sdk.version><rx-sdk.version>23.3.03-SNAPSHOT</rx-sdk.version>- Delete the content of the following folders:
- /bundle/src/main/webapp/scripts/
- /bundle/src/main/webapp/tools/
- /bundle/src/main/webapp/apps/
- /bundle/src/main/webapp/dist/
- /bundle/src/main/webapp/styles/
- /bundle/src/main/webapp/node_modules/
- Delete the following file:
/bundle/src/main/webapp/yarn.lock Build, export, and deploy your application project. For example:
myproj> mvn clean install -Pexport -Pdeploy- Verify that your application functions correctly.
To upgrade your application or library by using the SDK version 23.3.01 to 23.3.02
To upgrade your applications or libraries created by using the SDK from version 23.3.01 or earlier to 23.3.02, perform the following steps:
Change the version of the following parameter in the parent pom.xml file located in the project folder:
Current version
Updated version
<rx-sdk.version>23.3.01-SNAPSHOT</rx-sdk.version><rx-sdk.version>23.3.02-SNAPSHOT</rx-sdk.version>- Delete the content of the following folders:
- /bundle/src/main/webapp/scripts/
- /bundle/src/main/webapp/tools/
- /bundle/src/main/webapp/apps/
- /bundle/src/main/webapp/dist/
- /bundle/src/main/webapp/styles/
- /bundle/src/main/webapp/node_modules/
- Delete the following file:
/bundle/src/main/webapp/yarn.lock Build, export, and deploy your application project. For example:
myproj> mvn clean install -Pexport -Pdeploy- Verify that your application functions correctly.
To upgrade your application or library by using the SDK version 23.3.00 to 23.3.01
To upgrade your applications or libraries created by using the SDK from version 23.3.00 or earlier to 23.3.01, perform the following steps:
Change the version of the following parameter in the parent pom.xml file located in the project folder:
Current version
Updated version
<rx-sdk.version>23.3.00-SNAPSHOT</rx-sdk.version><rx-sdk.version>23.3.01-SNAPSHOT</rx-sdk.version><jackson.version>2.14.0</jackson.version><jackson-databind.version>2.14.0</jackson-databind.version><jackson.version>2.16.0</jackson.version><jackson-databind.version>2.16.0</jackson-databind.version>- Delete the content of the following folders:
- /bundle/src/main/webapp/scripts/
- /bundle/src/main/webapp/tools/
- /bundle/src/main/webapp/apps/
- /bundle/src/main/webapp/dist/
- /bundle/src/main/webapp/styles/
- /bundle/src/main/webapp/node_modules/
- Delete the following file:
/bundle/src/main/webapp/yarn.lock Build, export, and deploy your application project. For example:
myproj> mvn clean install -Pexport -Pdeploy- Verify that your application functions correctly.
To upgrade your application or library by using the SDK version 22.1.xx to 23.3.00
To upgrade your applications or libraries created by using the SDK from version 22.1.08 or earlier to 23.3.00, perform the following steps:
Change the version of the following parameter in the parent pom.xml file located in the project folder:
Current version
Updated version
<rx-sdk.version>22.1.08-SNAPSHOT</rx-sdk.version><rx-sdk.version>23.3.00-SNAPSHOT</rx-sdk.version>- Delete the content of the following folders:
- /bundle/src/main/webapp/scripts/
- /bundle/src/main/webapp/tools/
- /bundle/src/main/webapp/apps/
- /bundle/src/main/webapp/dist/
- /bundle/src/main/webapp/styles/
- /bundle/src/main/webapp/node_modules/
- Delete the following file:
/bundle/src/main/webapp/yarn.lock - Update the files from /bundle/src/main/webapp/ location.
Replace the content of preinstall.js with the following script:
const path = require('path');
const preInstall = require(path.resolve(path.join(process.env.RX_SDK_HOME, '/client/target/web-build/webapp/dist/libs/platform/schematics/src/config/preinstall.js')));
preInstall.initialize();Find and remove the following property from the angular.json file from /bundle/src/main/webapp/ location.
"extractCss": true
- Remove the deprecated bundleId property used in rxViewComponentRegistryService.register() and rxViewActionRegistryService.register().
For view components, remove the bundleId property from the registration.module.ts file, for example label-registration.module.ts.
For actions, remove the bundleId property from the action.module.ts file, for example confirmation-ootb-action.module.ts.
- Refactor the custom UI View components to:
Handle Handle the deprecated Angular class ComponentFactoryResolver used in componentFactory and designComponentFactory. For more information, see ComponentFactoryResolver.
Convert View components to Standalone.
For the following steps, consider a view component foo that is created by using an earlier version of the SDK, with the following directory structure of a view component:
- foo-registration.module.ts
- design
- foo-design.component.html
- foo-design.component.ts
- foo-design.model.ts
- foo-design.module.ts
- foo-design.scss
- foo.interface.ts
- runtime
- foo.component.html
- foo.component.ts
- foo.scss
- foo.service.ts
- foo.module.ts
For the following steps, consider a view component foo that is created by using an earlier version of the SDK, with the following directory structure of a view component:
- foo-registration.module.ts
- design
- foo-design.component.html
- foo-design.component.ts
- foo-design.model.ts
- foo-design.module.ts
- foo-design.scss
- foo.interface.ts
- runtime
- foo.component.html
- foo.component.ts
- foo.scss
- foo.service.ts
- foo.module.ts
To refactor the deprecated properties, perform the following steps:
(Required) In the -registration.module.ts file from the bundle/src/main/webapp/libs/<your-library-name>/src/lib/view-components/<view-component-name> location, replace the deprecated properties componentFactory and designComponentFactory used in rxViewComponentRegistryService.register() method with component and designComponent properties respectively.
(Required) Convert components to a Standalone style.
A standalone component is a self-defined component that contains all the information required by Angular to create the instance of the component. For more information, see Standalone components.Remove the .module.ts file for the design time and runtime components.
- Revisit the scope of services used in the components and provide the services at the component level rather than in their module (if the service is not stateless, that is the service is not provided in root). A service can be of the following types:
stateless—These services are used as utility functions. Stateless service can be shared across multiple components and does not have to maintain any state internally, hence must be provided at the root level. For more information about providing all services in the application root, see Singleton services.
A stateless service is usually provided in root:@Injectable({
providedIn: 'root'
})
It is usually directly imported in the components, for example:
import { TestService } from '../services/test.service';stateful— These services maintain a state of data between a few components and must be provided at the component level.
A stateful service is usually not provided in root, and does not need to be imported or provided in a module or component. So no code modification is required.
@Injectable()
It is usually declared in the @NgModule providers section:
import { TestService } from '../services/test.service';
@NgModule({
providers: [TestService],
Implement decorators for view components, actions, and initializers. To make sure the manifestis generated correctly, you must declare your view components, view actions, and initializers by using the Platform decorators such as @RxViewComponent(), @RxViewAction(), and @RxApplicationInitializer().
- Enable the manifest file.
A manifest is a file that contains the list of view components, view actions, and initializers of the coded bundle. It is leveraged in BMC Helix Innovation Studio to lazy load the resources, only when they are used in a view. You can decide to:- Generate the manifest.
If it is not enabled, the view components and view actions will not be visible or available in BMC Helix Innovation Studio.
We recommend that you generate the manifest. - Always load or lazy load the css styles.
We recommend that you set the property to lazy. Always load or lazy load the javascript code.
We recommend that you set the property to lazy.
The options for the manifest file generation are at the /bundle/src/main/webapp/package.json location."config": {
"manifest": {
"generate": "true",
"loadCss": "lazy",<- supports any option from "never" | "always" | "lazy"
"loadJs": "lazy" <- supports any option from "never" | "always" | "lazy"
}
}Enable the manifest file generation, by setting the following property:
"generate": "true",The options loadJs and loadCss control whether the bundle UI elements (js/css) are lazy loaded. Lazy loading the UI elements can help with runtime performances, because the js and CSS files would only be loaded if a UI element is used in a view.
For example:
{
"name": "helix",
"version": "1.0.0",
"description": "Foo 22.1.0",
"main": "Index.html",
"groupId": "com.example",
"artifactId": "foo",
"bundleName": "com.example.foo",
"author": "BMC Software Inc.",
"license": "Commercial",
"config": {
"manifest": {
"generate": "true",
"loadCss": "always",<- supports any option from "never" | "always" | "lazy"
"loadJs": "always" <- supports any option from "never" | "always" | "lazy"
}
}
}
- Generate the manifest.
If you are leveraging the moment-es6 package, refactor the import to use the moment packages. Refactor the following code:
import moment from 'moment-es6';To
import * as moment from 'moment';Remove the deprecated tilde (~) import from scss files. Refactor the code that uses ~ from all the *.scss files from /bundle/src/main/webapp/libs/<custom-bundle-name>/src/lib location.
Update the following code:@import "~styles/variables";To
@import "styles/variables";(Optional) Prepare for RxJS 7 upgrade. Refactor the existing use of RxJS . For more information, see Breaking Changes in Version 7 and RxJS 6.x to 7.x Detailed Change List.
(Optional) Perform this step only if you are running unit test cases.
Update the unit test configuration.For unit tests to work after you upgrade to Angular 14, update the following files.
Replace the content of jest.preset.js file from /bundle/src/main/webapp/ directory with the following content:
const nxPreset = require('@nrwl/jest/preset');
module.exports = {
...nxPreset
};Replace the content of jest.config.js file from /bundle/src/main/webapp/libs/com-example-foo location with the following content:
const {pathsToModuleNameMapper} = require('ts-jest');
const {compilerOptions} = require('../../tsconfig.base.json');
module.exports = {
displayName: 'com-example-foo',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/libs/com-example-foo',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment'
],
setupFilesAfterEnv: ["<rootDir>/src/test-setup.ts"],
globals: {
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
stringifyContentPathRegex: "\\.(html|svg)$",
},
},
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular'
},
moduleNameMapper: Object.assign(
{
"^uuid$": "uuid",
"^lodash-es$": "lodash"
},
pathsToModuleNameMapper(compilerOptions.paths, {prefix: '<rootDir>/../../'})
),
testEnvironment: 'jsdom',
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
testRunner: 'jest-jasmine2'
};Replace the content of test.setup.ts file from /bundle/src/main/webapp/libs/com-example-foo/src location with the following content:
import 'jest-preset-angular/setup-jest';
import 'jest-extended';
Build, export, and deploy your application project. For example:
myproj> mvn clean install -Pexport -Pdeploy- Verify that your application functions correctly.
Troubleshooting
This section describes the steps to resolve issues that you might encounter when upgrading your applications or libraries from version 22.1.xx.
Build issues while installing dependencies
The following error is displayed when you upgrade your applications or libraries to version 23.3.04 or earlier:
error tmp@0.2.3: The engine "node" is incompatible with this module. Expected version ">=14.14". Got "12.20.1"
To resolve the issue, add 0.2.1 tmp library to the resolutions section.
...
"tmp": "0.2.1"
},
View Component or View Action is not available in the palette
A View component and Action is not visible in BMC Helix Innovation Studio palette or in the button action list, and/or is not executed at runtime. Also an Initializer is not executed at runtime.
To resolve this issue, verify the following points:
- A View Component, Action, or Initializer is not visible in BMC Helix Innovation Studio palette or button action list, and is not executed at runtime.
- The View Component, View Action, and Initializer must be declared in the manifest file. To declare the components, make sure the following tasks are complete:
- The manifest file must be generated.
- The View Component, View Action, and Initializers must be declared by using the Platform decorators @RxViewComponent(), @RxViewAction(), and @RxApplicationInitializer(). For more information, see Implement decorators for view components, actions, and initializers.
Build issue with schema validation
When you build a coded bundle and the schema validation fails with the following error:
To resolve the issue, locate and delete the " extractCss": true property in the angular.json file from the bundle/src/main/webapp/ location.
Build issue with browserslist
When you build a coded bundle and the following error is displayed:
./libs/foo/src/lib/styles/foo.scss - Error: Module build failed {from ./node_modules/@angular-devkit/build-angular/node_modules/mii-css-extract-plugin/dist/loader.js}; HookWebpackError: Module build failed {from ./node_modules/@angular-devkit/build-angular/node_modules/postcss-loader/dist/cjs.js};
BrowserlistError: Unknown version 104 of android
To resolve this issue, perform the following steps:
- Locate and delete the yarn.lock file from the /bundle/src/main/webapp location.
Run the following command:
mvn clean install
Build issue with yarn cache
When you build a coded bundle and the following error is displayed:
error an unexpected error occurred: "There should only be one folder in a package cache (got in C:\\Users\\Administrator\\AppDainfog report with the information provided in "C:\\foo\\bundle\\src\\main\\webapp\\yarn-error.log".
To resolve the issue, clear the yarn cache by running the following command:
Issues with unit test cases
If the custom application uses third-party libraries defined in the bundle/src/main/webapp/libs/<library-name>/package.json file, and includes unit tests, the following error is displayed during the build:
Error: Need to call TestBed.initTestEnvironment() first
To resolve the issue, you must enable local yarn by performing the following steps:
- Set the environment variable YARN_IGNORE_NODE=1.
Set the enableLocalYarn flag to true in package.json file from /bundle/src/main/webapp/ location.
"config": {
"enableLocalYarn": true
}- Remove the preinstall script from the package.json file from /bundle/src/main/webapp/ location.
Update the build commands in the bundle\pom.xml file.
- Exclude the following files from the source control from /bundle/src/main/webapp/ location.
- .yarn/*
- !.yarn/releases
- Add the following files in the source control:
- .yarn/releases/yarn-4.0.0.cjs
- .yarnrc.yml
- yarn.lock
- Delete the node_modules and tools, folders, and the yarn.lock file from the /bundle/src/main/webapp/ location.
- Run the following command:
Typescript compilation issues
When you encounter the following issue, replace validationIssue type with IValidationIssue:
Update the following code:
type: 'error',
propertyName: issuePropertyName,
description: `${actionDescriptor.label}
});
To
validationIssues.push({
type:IValidationIssue.Error,
propertyName: issuePropertyName,
description: `${actionDescriptor.label}
});