Compilation

Angular IVY compiler

Angular compile components templates and controllers into code that is runnable and efficient in a web browser. Angular have two built-in compilers, "View Engine" and "Ivy".

  • View Engine is the standard compiler for Angular version prior to 9 with the maximal compatibility.

  • Ivy is the new compiler provided since Angular 9, which produce faster and lighter applications but requires compatible third-part Angular components libraries.

The Platform Web client module is configured to use View Engine as default compiler for a better compatibility.

To enable Ivy compiler, the tsconfig.json in the web folder of your Platform needs to be modified as follow:

{
    ...
    "angularCompilerOptions": {
        "enableIvy": true,
        "fullTemplateTypeCheck": true,
        "strictInjectionParameters": true
    }
}

Error integrity when fetching from the cache

This message may appear when building the web app. It is related to an inconsistency within the caches used by the tool we use to compile the different node modules.

To solve this issue, you have to clean this cache. This can be done using yarn which is located into the web/.gradle/yarn/yarn-v1.19.0/bin folder:

$ cd web
$ .gradle/yarn/yarn-v1.19.0/bin/yarn cache clean

Once the cache has been cleaned, you should be able to run the gradlew build command successfully.

'Module not found: Error: Can't resolve '@gene/web-frontend-base/lib/...''

This message appears when custom UI code import through an explicit path instead of using the module path:

// Wrong Import
import { GeneContext } from '@gene/web-frontend-base/lib/generated/execution';

// Correct Import
import { GeneContext } from '@gene/web-frontend-base';

During build, yarn_test is failing with an error

This message may appear when no Chrome environment is found to run the default tests of the web service.

A simple workaround consists in disabling web service tests by commenting out the following line in the
gradle/template/yarn.gradle file of your project:

...
apply from: "${rootDir}/gradle/templates/node-common.gradle"

...

assemble.dependsOn yarn_install
check.dependsOn assemble
// check.dependsOn yarn_test           <- Comment this line

...