Open threewebcode opened 1 year ago
Next.js Stack:
The objects and items can be exported from its definition file. The configuration object is the alias type of record type. The generic type can extend function type. The essence of type statement is to use one token pattern to replace another symbol pattern. That is to say, one thing has more than two formats of syntax. The type expression will be computed during the compilation time and determined its simple construction.
The type can be expressed by the combination of token elements. The concatenation of symbols has its constraints. When it is type declaration statement, it means that two production rules are equal and can be substituted once it is necessary.
The union type operator can give more types to the type name. The interface is used to stand for the options that can be used in the module configuration.
The configuration service is a class with get capability and is injectable as the dependency. The providers and exports are the construction elements of modular class.
The interface can have only fields in its body. The module can be static or dynamic type. The differences between static module and dynamic module is that dynamic module has more metadata in its decoration. The module factory has module type, module token and module metadata. The module has a unique key and the key is combination of module id and module name. The token is the hash value of module key. The module is expressed as a class written in TypeScript language. It does have imports, exports, providers, middlewares, controllers and injectables fields.
The module container is a map data structure and can store the declared modules.
There are some configuration items for the whole application. These items are represented by the fields of a configuration class in typescript language. The items contain filters, pipes, guards and interceptors. The value of messages and keys can be defined as constant variables. The hooks are the phases of application lifecycle. Some extra actions can be performed during the certain stage of the application. The application context can be specific for each module.
The factory design pattern is used for application creation. The application implements the interface constraint and has the application context. The module, microservice and http server are its member fields. The dependency is managed by graph data structure. The node is the metadata of the module and the edge is the relationship between the module.
Table of Contents