This extension was previously (in version 1.0, 1.1, and 1.2) known as TypeScript and Angular. |
On this page: Target audience: Users of the extension providing support for the TypeScript language. It also includes support for Angular, React , React-Native and some of the main frameworks for Node.js Web applications such as Express (when they are used within typescript source code). |
Summary: This document provides information about the extension providing TypeScript, Angular, React and Node support for Web applications. |
See TypeScript and Frameworks - 1.3 - Release Notes for more information.
This extension provides support for the TypeScript language. It also includes support for Angular, React, React-Native and some of the main frameworks for Node.js Web applications such as Express (when they are used within typescript source code).
Note that:
|
The typical use case would be a full-stack web application developed entirely in TypeScript using Angular framework and Node.js. However, this extension should be used whenever any sub-set of the application is implemented using TypeScript (provided that you want to view the call-graph of that part of the application).
Angular/TypeScript Front-end connected to Node.js/Express/MongoDB back-end |
The following tables display the list of versions that this extension supports. It also gives a list of the supported frameworks for Node.js.
Version | Supported |
---|---|
1.x |
|
2.x | |
3.x | |
4.x |
Version | Supported |
---|---|
2 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 |
Version | Supported |
---|---|
15.x | |
16.x |
Version | Supported |
---|---|
0.x |
Version | Support | Comment |
---|---|---|
v0.x | No longer supported | |
v4.x | | LTS |
v5.x | | Based on Javascript ES6 |
v6.x | | Based on Javascript ES6 |
v7.x | Based on Javascript ES6 | |
v8.x | ||
v9.x |
| |
v10.x | ||
v11.x | ||
v12.x | ||
v13.x | ||
v14.x |
Library | Comment | Data Access | Web Service | Supported versions |
---|---|---|---|---|
Express | Node.js application framework | 4.x | ||
Mongoose | MongoDB access | 5.x | ||
Sequelize | Node.js application framework | 5.x; 6.x | ||
TypeORM | ORM | 0.2.x | ||
Fastify | Node.js server | 3.x | ||
Axios | Promise based HTTP client | 0.x | ||
Node-mongodb-native | MongoDB access | 3.x | ||
nestjs | Node.js application framework | 6.x; 7.x | ||
https | Node.js web service | |||
fetch | JavaScript builtin web service | |||
request | HTTP request client 'request' | 2.x | ||
request-promise | HTTP request client 'request' | 4.x | ||
request-promise-native | HTTP request client 'request' | 1.x | ||
request-promise-any | HTTP request client 'request' | 1.x | ||
Mongo-client | MongoDB access | |||
Couchdb | Couchdb access | |||
Node-couchdb | Couchdb access | |||
Couchdb-nano | Couchdb access | |||
Marklogic | Marklogic access | |||
my_connection | MySQL access | 0.x | ||
pg | PostgreSQL access | 7.x; 8.x | ||
oracledb | Oracle Database access | 4.x; 5.x | ||
node-sqlserver | MsnodeSQL access | 0.x | ||
mssql | MsSQL access | 5.x; 6.x | ||
Hapi | Node.js application framework | |||
Sails | Node.js application framework | |||
Loopback | Node.js application framework | |||
Koa | Node.js application framework | |||
Knex | Node.js SQL query builder | |||
Memcached | Storage framework | |||
AWS.DynamoDB | Amazon database access | SDK 2.x | ||
AWS.S3 | Amazon storage service | SDK 2.x | ||
AWS.Lambda | Amazon routing solution | Cloudformation, Serverless framework, SAM | ||
AWS.SQS | Amazon Simple Queue Service | SDK 2.x |
Supported Emailing frameworks: @sendgrid/mail, nodemailer
Icon(s) | File | Extension |
---|---|---|
TypeScript | .ts | |
TypeScript | .tsx |
The TypeScript analyzer will automatically skip files inside folders (or sub-folders) that by convention pertain to either external libraries or unit-testing. Currently the following are skipped:
As mentioned in the introduction, TypeScript is a language that will be compiled to generate JavaScript files. Sometimes, the delivery will include these files, this is why the analyzer will skip the generated JavaScript files if we find their original TypeScript file. |
Function Points (transactions) | Quality and Sizing | |
---|---|---|
TypeScript | ||
Angular | ||
React | ||
Express | ||
Mongoose | ||
Sequelize | ||
TypeORM |
CAST AIP release | Supported |
---|---|
8.3.x | |
8.2.x |
This extension is compatible with the following DBMS servers:
CAST AIP release | CSS/PostgreSQL | Oracle | Microsoft |
---|---|---|---|
All supported releases |
An installation of any compatible release of CAST AIP (see table above) |
Some CAST extensions require the presence of other CAST extensions in order to function correctly. The TypeScript and frameworks extension requires that the following other CAST extensions are also installed:
Note that when using the CAST Extension Downloader to download the extension and the Manage Extensions interface in CAST Server Manager to install the extension, the HTML5/JavaScript, ReactJS and NodeJS extensions will be installed automatically. You do not need to do anything. |
Please see:
The latest release status of this extension can be seen when downloading it from the CAST Extend server. |
Once the extension is downloaded and installed, you can now package your source code and run an analysis. The process of packaging, delivering and analyzing your source code is described below:
Once the analysis/snapshot generation has completed, you can view the results in the normal manner:
In this full-stack example, the front-end is implemented in TypeScript and uses Angular and the back-end is implemented in JavaScript and uses Express and MongoDB. If analyzing a web-application with the back-end implemented in TypeScript, the data-base access would be missing since this extension does not yet support any database access framework.
The following objects are identified:
Icon | Metamodel name | Code Reference (example) | |
---|---|---|---|
Typescript Module | |||
Typescript Namespace |
| ||
Typescript Class |
| ||
Class Initializer |
| ||
Typescript Method |
| ||
Typescript Interface |
| ||
Typescript Function |
| ||
Angular Component | |||
Angular Directive | |||
Angular GET http service | |||
Angular POST http service | |||
Angular PUT http service | |||
Angular DELETE http service | |||
HTML5 HTML fragment | |||
ReactJS Application | |||
ReactJS Component | |||
ReactJS Form | |||
Node.js Delete Operation Service | |||
Node.js Get Operation Service | |||
Node.js Post Operation Service | |||
Node.js Put Operation Service | |||
Node.js MongoDB connection | |||
Node.js MongoDB collection |
Support of arrow functions and methodsArrow functions which have been introduced in typescript following ES6 standard (also known as ES2015) are supported. Since arrow functions are equivalent to standard functions, the same function objects are created by the analyzer for both standard functions and arrow functions. Arrow functions can also define methods in which case method objects are created by the analyzer. Examples of arrow functions and methods are provided in the Objects section of this documentation. Support of anonymous functionsFor anonymous functions, the analyzer creates function objects named <Anonymous$i> where $i is incremented such that each anonymous function object has a unique fullname. |
Web ServicesAngular web services are supported for both the older Http and new HttpClient (Angular ≥4.3) libraries. The method calls get, post, put, delete, jsonp, and request are recognized.
The results of this code snippet are shown below.: Finally the use of the rxjs/ajax API as web service call is also supported. The different types of web services (GET, POST, PUT, DELELTE) are represented with the same Angular objects we have used above, despite they are not restricted to the Angular framework. Angular components and HTML fragmentsIn addition to the basic TypeScript objects the analyzer will generate specific objects and links for the Angular framework. In the following example the analyser creates a TypeScript module object associated to the file and a TypeScript class object associated to the decorated class MyComponent. Angular components objects are created when finding special class decorators with name Component. The view of Angular components is described in HTML language and the associated code can be either found in an external .html file or embedded in the decorator metadata.
For embedded data, the analyzer creates an HTML5 HTML Fragment belonging to the component, and will automatically generate a use (U) link between the Component and the HTML fragment: The generation of these links is necessary to describe the higher level call flow abstracted in the Angular framework and thus to retrieve transactions. Environment variablesIn our analysis we consider a production deployment scenario. Thus we mimic the behavior of Angular when overloading behind-the-scenes the variables declared inside the exported environment dictionary defined in environment.ts by those defined in environment.prod.ts. Global variables might be used to connect different technology layers (via URLs for example), thus retrieving them correctly can be critical for full transactions. Latest versions of Angular allows using many different production files. We only support a single production environment file, the standard environment.prod.ts. When using a no-production environment file a warning message will be logged.
|
ReactJS ApplicationThis declaration will create a ReactJS application named App:
ReactJS ComponentThis declaration will create a ReactJS component named Sequence because the class inherits from Component (a class which inherits from PureComponent would also induce the creation of a ReactJS component). A component must contain a render method. The render method is automatically called when the component is refered to in an HTML fragment:
ReactJS FormThis declaration will create a ReactJS form named contact:
HTML fragmentThis declaration will create a HTML fragment named render_fragment_1 starting with "<g>" and ending with "</g>". There can be several fragments in any function/method:
LinksLinks from the ReactJS application
Please remember that components are called mainly from html fragments, and render methods are implicitly called from ReactJS components. Links from a HTML fragmentHTML tags present in HTML fragments are linked to ReactJS components if they exist:
HTML tags present in HTML fragments can also be linked to a Typescript function. HTML fragments are linked to functions or methods when they are represented between { ... }:
|
The analysis of the following code will create a Node.js Get Operation named /login with a call link from the operation to the handler function f:
Routers are also supported and the analysis of the following code will create a Node.js Get Operation named /foo1/foo2:
|
In the following code:
the User class defines a model which is linked with the table named 'users' (through the User.init() call). The name of the table is defined by the tableName value which if not defined is set to the pluralized (if freezeTableName is not set to true) value of modelName which is itself set to the class name when it is not explicitly defined. The User.findAll() call then selects elements from that table 'users'. In this example, this extension creates a useSelect link to the table 'users'. |
See MongoDB support for Node.js source code
See AWS S3 support for Node.js source code
Analysis of the TypeScript application will result in the following links:
The following rules are shipped with this extension: