Font Size: a A A

Design And Research Of Front-end MVVM Framework Based On TypeScript

Posted on:2022-04-04Degree:MasterType:Thesis
Country:ChinaCandidate:D W FanFull Text:PDF
GTID:2518306341953869Subject:Electronics and Communications Engineering
Abstract/Summary:PDF Full Text Request
Framework is an important tool for front-end development.Using a suitable framework in the production process can reduce coupling and improve work efficiency.This article designs and implements a front-end framework that can help developers quickly develop front-end applications.The operating core of the framework is based on the component mechanism and adopts the MVVM two-way binding model.Users can use the TypeScript language to develop and perform static type checking.The framework provides the realization of the component view layer,the view model layer and the realization architecture of the model layer.The view layer provides component template development,compilation and rendering functions.The development process uses tag syntax to write component templates;the compilation process first converts the template into an abstract syntax tree,which is statically optimized to generate a rendering function;the rendering process uses virtual node technology and compare algorithms to reduce the performance caused by traditional direct manipulation of DOM loss.In the implementation of the view model layer,the Proxy API is used to implement responsive data,which triggers the update of the view layer when the model layer is updated.In the model layer,the structure of the data in a component and the built-in data embedding and reporting functions are implemented,and an algorithm for analyzing user behavior data based on Kmeans is introduced.The framework also implements three auxiliary modules:the routing management module monitors and manages routing jumps,the data management module centrally manages application data,and the network request module manages network requests between the front and back ends.In addition,this framework provides protection against common network vulnerabilities such as XSS and CSRF during operation,ensuring the safety of users.In order to show the practicality of the framework,this article develops an e-book reader application based on this framework.In the development process,the advantages of the framework are fully utilized,the basic components used internally are encapsulated,the two-way binding mechanism is used to maintain the interaction between the view layer and the model layer,and the routing management module,data management module,and network request module are used to manage the application Routing,data and interfaces realize a complete set of applications.Finally,the various functions of the e-book reader are tested,and a simple application is used as an example to compare the framework on the market and this framework horizontally.Various test data prove that using this framework can improve the operating efficiency and user experience of the application.Based on this framework,low-coupling and high-availability applications can be built.
Keywords/Search Tags:MVVM, TypeScript, AST, Virtual-DOM, Diff
PDF Full Text Request
Related items