Method, device, equipment and readable medium for packaging and deployment under micro-frontend architecture
By storing application configuration information in the configuration center under the micro front-end architecture, judging the application construction type and generating corresponding compiled code, the problem of low packaging and deployment efficiency in the existing technology is solved, and rapid hot deployment and online service is achieved with fine-grained business Speed improvement.
Patent Information
- Application Number
- CN202110934133.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-13
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-08-13
AI Technical Summary
The packaging and deployment process under the existing micro front-end architecture is inefficient, resulting in slow update and iteration process for business online, and relies on the OS architecture, affecting the rapid recovery and startup of applications.
By storing the configuration information of each application into the configuration center, and determining whether the application under the micro front-end architecture is fully constructed, generating corresponding compiled code in response to different build types, and outputting it to the corresponding container to achieve business details Rapid thermal deployment of granularity.
It improves the efficiency of front-end packaging and development, realizes rapid hot deployment of fine-grained services, and improves the online update and iteration process of business in the production environment and the speed of business going online.
Smart Images

Figure CN113641395B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and more specifically to a method, apparatus, device and readable medium for packaging and deploying under a micro-frontend architecture. Background Art
[0002] Micro frontend is a microservices Web frontend architecture that applies the concept of microservices to the browser side, transforming Web applications from a single monolithic application to an application that aggregates multiple small frontend applications. Each frontend application can be independently developed, deployed, and run, thereby improving the development and maintenance efficiency of the entire software system. The packaging and deployment process in the micro frontend system is also a common item in the project release process. Conventional packaging and deployment is that all large frontend project applications are deployed on the server side. Packaging and release require recompiling the entire project. With the increase in business volume, the whole process becomes longer and longer. At the same time, deployment on the server side is not conducive to the rapid recovery and startup of the application, and the deployment also depends on the relevant OS architecture.
[0003] Front-end containerization is a method of software development in which the program and its dependent components and collection packages as well as related environment variable configuration files are completely packaged into container images and unit tested, and finally the container is deployed to the server's operating system. The program containers are also standard units. It has nothing to do with the dependencies of their code, language, software, and framework. This allows programmers and IT operations specialists to not configure their configuration information separately in each environment. Cross-environment transmission can be achieved by not modifying or making few modifications during the deployment process of the program, and the programs in each container are isolated from each other. Summary of the invention
[0004] In view of this, the purpose of the embodiments of the present invention is to propose a method, device, equipment and readable medium for packaging and deployment under a micro-front-end architecture. By using the technical solution of the present invention, the packaging development efficiency of the front-end can be improved, and fine-grained rapid hot deployment of business can be achieved, thereby improving the online update iteration process and business online speed of the business in the production environment.
[0005] Based on the above purpose, one aspect of an embodiment of the present invention provides a method for packaging and deployment under a micro-frontend architecture, comprising the following steps:
[0006] Store the configuration information of each application in the configuration center and determine whether the application under the micro-frontend architecture is a full build;
[0007] In response to the full build of the application under the micro-frontend architecture, the compiled code of the main application is generated according to the dependency packages of the main application and the compilation and packaging of the main application;
[0008] Generate compiled code for each sub-application based on the dependency packages and sub-application compilation packages of each sub-application related to the main application;
[0009] Based on the basic image library under the micro-frontend architecture, the compiled code of the main application is output to the main application container, and the compiled code of each sub-application is output to each sub-application container respectively.
[0010] According to one embodiment of the present invention, it also includes:
[0011] In response to the application under the micro-frontend architecture not being fully built, obtain configuration information of the sub-application to be upgraded;
[0012] Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application;
[0013] Output the compiled code of the sub-application to the sub-application container.
[0014] According to one embodiment of the present invention, the configuration information of an application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of related sub-applications, the dependency package sources of related sub-applications, and other third-party dependency plug-in introduction scripts; the sub-application configuration information includes the sub-application dependency package information and project packaging script information.
[0015] According to one embodiment of the present invention, in response to the application under the micro-frontend architecture being fully built, generating the compiled code of the main application according to the dependency package of the main application and the compilation and packaging of the main application includes:
[0016] According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as source code that can be executed in the production environment.
[0017] Another aspect of an embodiment of the present invention further provides a device for packaging and deploying under a micro-frontend architecture, the device comprising:
[0018] A judgment module, which is configured to store the configuration information of each application in the configuration center and judge whether the application under the micro-frontend architecture is a full build;
[0019] A generation module, where the generation module is configured to generate the compiled code of the main application according to the dependency packages of the main application and the compilation and packaging of the main application in response to the application under the micro-frontend architecture being fully built;
[0020] A compilation module, wherein the compilation module is configured to compile and package the dependent packages of each sub-application related to the main application and generate compiled codes for each sub-application;
[0021] The output module is configured to output the compiled code of the main application to the main application container based on the basic image library under the micro-frontend architecture, and output the compiled code of each sub-application to each sub-application container respectively.
[0022] According to one embodiment of the present invention, it further includes an acquisition module, and the acquisition module is configured to:
[0023] In response to the application under the micro-frontend architecture not being fully built, obtain configuration information of the sub-application to be upgraded;
[0024] Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application;
[0025] Output the compiled code of the sub-application to the sub-application container.
[0026] According to one embodiment of the present invention, the configuration information of an application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of related sub-applications, the dependency package sources of related sub-applications, and other third-party dependency plug-in introduction scripts; the sub-application configuration information includes the sub-application dependency package information and project packaging script information.
[0027] According to one embodiment of the present invention, the generating module is further configured to:
[0028] According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as source code that can be executed in the production environment.
[0029] Another aspect of the embodiments of the present invention further provides a computer device, the computer device comprising:
[0030] at least one processor; and
[0031] The memory stores computer instructions executable on the processor, and the instructions implement the steps of any one of the above methods when executed by the processor.
[0032] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented.
[0033] The present invention has the following beneficial technical effects: the packaging and deployment method under the micro-frontend architecture provided by the embodiment of the present invention stores the configuration information of each application in the configuration center, and determines whether the application under the micro-frontend architecture is a full build; in response to the application under the micro-frontend architecture being a full build, generates the compiled code of the main application according to the dependency package of the main application and the compilation and packaging of the main application; generates the compiled code of each sub-application according to the dependency package and the compilation and packaging of each sub-application related to the main application; based on the basic image library under the micro-frontend architecture, the compiled code of the main application is output to the main application container, and the compiled code of each sub-application is output to each sub-application container respectively. The technical solution can improve the packaging and development efficiency of the front-end, realize fine-grained rapid hot deployment of the business, and improve the online update iteration process and business online speed of the business in the production environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A schematic flowchart of a packaging and deployment method under a micro-frontend architecture according to an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a packaging and deployment device under a micro-frontend architecture according to an embodiment of the present invention;
[0037] Figure 3 is a schematic diagram of a computer device according to an embodiment of the present invention;
[0038] Figure 4 FIG. 1 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0040] Based on the above objectives, a first aspect of an embodiment of the present invention proposes an embodiment of a packaging and deployment method under a micro-frontend architecture. Figure 1 Shown is a schematic flow chart of the method.
[0041] like Figure 1 As shown in , the method may include the following steps:
[0042] S1 stores the configuration information of each application in the configuration center and determines whether the application under the micro-frontend architecture is a full build.
[0043] The configuration center mainly stores the internal configuration information and script summary of the main application and sub-application. The main application configuration information includes the front-end dependency package information of the current main application, the configuration entry information of the related sub-applications, the source of the dependency package of the related sub-applications, and the scripts introduced by other third-party dependency plug-ins. The sub-application configuration information includes the dependency package information of the sub-application and its project packaging script information.
[0044] In response to the full build of the application under the micro-frontend architecture, S2 generates the compiled code of the main application based on the dependency packages of the main application and the compilation and packaging of the main application.
[0045] S3 generates compiled codes for each sub-application according to the dependency packages of each sub-application related to the main application and the sub-application compilation and packaging.
[0046] If the application of the micro-frontend architecture is a full build, the code of the main application and each sub-application related to the main application needs to be compiled and obfuscated to obtain code that can be executed in the production environment. First, the engineering code in the compilation and packaging of the main application is transcoded, compiled and obfuscated according to the dependency package of the main application and the engineering path information configured in the main application to output as source code that can be executed in the production environment. Then, the engineering code in the compilation and packaging of each sub-application is transcoded, compiled and obfuscated according to the dependency package of each sub-application related to the main application and the configured engineering path information to output as source code that can be executed in the production environment. In this way, the compiled code of the main application and the compiled code of multiple sub-applications related to the main application can be obtained.
[0047] Based on the basic image library under the micro-frontend architecture, S4 outputs the compiled code of the main application to the main application container, and outputs the compiled code of each sub-application to each sub-application container respectively.
[0048] Output the compiled code of the main application to the container of the main application. Relying on the basic image library of the front-end, the project code can be merged and output as an executable pod container image. At the same time, the entry address of the front-end application can be provided to run the main application in the container. The compiled code of each sub-application related to the main application can be added to each sub-application container respectively, so that different sub-applications can be run in different sub-application containers.
[0049] Since the traditional front-end application is a single front-end application, as the complexity of the project business increases, the amount of code in the entire front-end project becomes larger and larger as the business is added, and it gradually becomes a monolithic application. In the later stage, the time cost of the development of the entire front-end project and its packaging and compilation process continues to rise. At the same time, the update of a sub-function in the business requires repeated synchronous updates of the entire large front-end application, which affects the interruption of the entire front-end business. For medium and large front-end applications, the entire packaging and deployment process is not flexible and efficient enough. Therefore, through the technical solution of the present invention, the packaging development efficiency of the front end can be improved, and the fine-grained rapid hot deployment of the business can be realized, which can improve the online update iteration process and the speed of business online in the production environment.
[0050] In a preferred embodiment of the present invention, it also includes:
[0051] In response to the application under the micro-frontend architecture not being fully built, obtain configuration information of the sub-application to be upgraded;
[0052] Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application;
[0053] Output the compiled code of the sub-application to the sub-application container. If the application under the micro-frontend architecture is not fully built, that is, only a single sub-application is upgraded, you only need to perform the above steps to upgrade the single sub-application, and finally push the container of the sub-application to the relevant environment. The update and release of the sub-application container will not affect the use of other sub-applications, and the basic business and unrelated business sub-module business will not be interrupted.
[0054] In a preferred embodiment of the present invention, the configuration information of the application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of the related sub-applications, the dependency package sources of the related sub-applications, and other third-party dependency plug-in introduction scripts, and the sub-application configuration information includes the sub-application dependency package information and the project packaging script information.
[0055] In a preferred embodiment of the present invention, in response to the application under the micro-frontend architecture being fully built, generating the compiled code of the main application according to the dependency package of the main application and the compilation and packaging of the main application includes:
[0056] According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as source code that can be executed in the production environment.
[0057] Through the technical solution of the present invention, the packaging development efficiency of the front-end can be improved, the rapid hot deployment of services with fine-grainedness can be realized, and the online update iteration process and service online speed of the services in the production environment can be improved.
[0058] It should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiment can achieve the same or similar effect as any of the above-mentioned method embodiments corresponding thereto.
[0059] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a CPU, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the method disclosed in the embodiment of the present invention are performed.
[0060] Based on the above purpose, the second aspect of the embodiment of the present invention proposes a packaging deployment device under a micro-frontend architecture, such as Figure 2 As shown, the device 200 includes:
[0061] The judgment module 201 is configured to store the configuration information of each application in the configuration center, and judge whether the application under the micro-frontend architecture is a full build;
[0062] A generation module 202, where the generation module 202 is configured to generate a compiled code of the main application according to the dependency packages of the main application and the compilation and packaging of the main application in response to the application under the micro-frontend architecture being a full build;
[0063] Compilation module 203, the compilation module 203 is configured to generate compiled codes of each sub-application according to the dependency packages and sub-application compilation packages of each sub-application related to the main application;
[0064] Output module 204, output module 204 is configured to output the compiled code of the main application to the main application container based on the basic image library under the micro-frontend architecture, and output the compiled code of each sub-application to each sub-application container respectively.
[0065] In a preferred embodiment of the present invention, it further includes an acquisition module, which is configured as follows:
[0066] In response to the application under the micro-frontend architecture not being fully built, obtain configuration information of the sub-application to be upgraded;
[0067] Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application;
[0068] Output the compiled code of the sub-application to the sub-application container.
[0069] In a preferred embodiment of the present invention, the configuration information of the application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of the related sub-applications, the dependency package sources of the related sub-applications, and other third-party dependency plug-in introduction scripts, and the sub-application configuration information includes the sub-application dependency package information and the project packaging script information.
[0070] In a preferred embodiment of the present invention, the generation module 202 is further configured to:
[0071] According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as executable source code in the production environment.
[0072] Based on the above purpose, a third aspect of an embodiment of the present invention provides a computer device. Figure 3 FIG. 2 is a schematic diagram of an embodiment of a computer device provided by the present invention. Figure 3 As shown, the embodiment of the present invention includes the following apparatus: at least one processor S21; and a memory S22, the memory S22 stores computer instructions S23 that can be run on the processor, and when the instructions are executed by the processor, the following method is implemented:
[0073] Store the configuration information of each application in the configuration center and determine whether the application under the micro-frontend architecture is a full build;
[0074] In response to the full build of the application under the micro-frontend architecture, the compiled code of the main application is generated according to the dependency packages of the main application and the compilation and packaging of the main application;
[0075] Generate compiled code for each sub-application based on the dependency packages and sub-application compilation packages of each sub-application related to the main application;
[0076] Based on the basic image library under the micro-frontend architecture, the compiled code of the main application is output to the main application container, and the compiled code of each sub-application is output to each sub-application container respectively.
[0077] In a preferred embodiment of the present invention, it also includes:
[0078] In response to the application under the micro-frontend architecture not being fully built, the configuration information of the sub-application to be upgraded is obtained;
[0079] Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application;
[0080] Output the compiled code of the sub-application to the sub-application container.
[0081] In a preferred embodiment of the present invention, the configuration information of the application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of the related sub-applications, the dependency package sources of the related sub-applications, and other third-party dependency plug-in introduction scripts, and the sub-application configuration information includes the sub-application dependency package information and the project packaging script information.
[0082] In a preferred embodiment of the present invention, in response to the application under the micro-frontend architecture being fully built, generating the compiled code of the main application according to the dependency package of the main application and the compilation and packaging of the main application includes:
[0083] According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as source code that can be executed in the production environment.
[0084] Based on the above purpose, a fourth aspect of an embodiment of the present invention provides a computer-readable storage medium. Figure 4 FIG. 2 is a schematic diagram of an embodiment of a computer-readable storage medium S31 provided by the present invention. Figure 4 As shown, the computer readable storage medium S31 stores a computer program S32 that performs the following method when executed by the processor:
[0085] Store the configuration information of each application in the configuration center and determine whether the application under the micro-frontend architecture is a full build;
[0086] In response to the full build of the application under the micro-frontend architecture, the compiled code of the main application is generated according to the dependency packages of the main application and the compilation and packaging of the main application;
[0087] Generate compiled code for each sub-application based on the dependency packages and sub-application compilation packages of each sub-application related to the main application;
[0088] Based on the basic image library under the micro-frontend architecture, the compiled code of the main application is output to the main application container, and the compiled code of each sub-application is output to each sub-application container respectively.
[0089] In a preferred embodiment of the present invention, it also includes:
[0090] In response to the application under the micro-frontend architecture not being fully built, obtain configuration information of the sub-application to be upgraded;
[0091] Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application;
[0092] Output the compiled code of the sub-application to the sub-application container.
[0093] In a preferred embodiment of the present invention, the configuration information of the application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of the related sub-applications, the dependency package sources of the related sub-applications, and other third-party dependency plug-in introduction scripts, and the sub-application configuration information includes the sub-application dependency package information and the project packaging script information.
[0094] In a preferred embodiment of the present invention, in response to the application under the micro-frontend architecture being fully built, generating the compiled code of the main application according to the dependency package of the main application and the compilation and packaging of the main application includes:
[0095] According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as executable source code in the production environment.
[0096] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a processor, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the above functions defined in the method disclosed in the embodiment of the present invention are performed.
[0097] In addition, the above method steps and system units may also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
[0098] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0099] In one or more exemplary designs, the function can be implemented in hardware, software, firmware or any combination thereof. If implemented in software, the function can be stored on a computer-readable medium or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transfer a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special computer. As an example and not limiting, the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of an instruction or data structure and can be accessed by a general or special computer or a general or special processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are all included in the definition of the medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disks usually reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0100] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0101] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0102] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0103] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0104] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A packaging and deployment method under a micro-frontend architecture, characterized in that: The following steps are involved: Store the configuration information of each application in the configuration center and determine whether the application under the micro-frontend architecture is a full build; In response to the full build of the application under the micro-frontend architecture, the compiled code of the main application is generated according to the dependency packages of the main application and the compilation and packaging of the main application; Generate compiled code for each sub-application based on the dependency packages and sub-application compilation packages of each sub-application related to the main application; Based on the basic image library under the micro-frontend architecture, the compiled code of the main application is output to the main application container, and the compiled code of each sub-application is output to each sub-application container respectively; Among them, the configuration information of the application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of related sub-applications, the dependency package source of related sub-applications, and other third-party dependency plug-in introduction scripts; the sub-application configuration information includes the sub-application dependency package information and project packaging script information.
2. The method according to claim 1, characterized in that Also includes: In response to the application under the micro-frontend architecture not being fully built, the configuration information of the sub-application to be upgraded is obtained; Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application; Output the compiled code of the sub-application to the sub-application container.
3. The method according to claim 1, characterized in that In response to the fact that the application under the micro-frontend architecture is a full build, the compiled code of the main application is generated according to the dependency packages of the main application and the compilation and packaging of the main application, including: According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as executable source code in the production environment.
4. A packaging and deployment device under a micro-frontend architecture, characterized in that: The device comprises: A judgment module, wherein the judgment module is configured to store the configuration information of each application in the configuration center and judge whether the application under the micro-frontend architecture is a full build; A generation module, wherein the generation module is configured to generate a compiled code of the main application according to the dependency packages of the main application and the compilation and packaging of the main application in response to the application under the micro-frontend architecture being fully built; A compiling module, wherein the compiling module is configured to compile and package the dependent packages of each sub-application related to the main application and generate compiled codes for each sub-application; An output module, wherein the output module is configured to output the compiled code of the main application to the main application container based on the basic image library under the micro-frontend architecture, and output the compiled code of each sub-application to each sub-application container respectively; Among them, the configuration information of the application includes main application configuration information and sub-application configuration information, wherein the main application configuration information includes the front-end dependency package information of the main application, the configuration entry information of related sub-applications, the dependency package source of related sub-applications, and other third-party dependency plug-in introduction scripts; the sub-application configuration information includes the sub-application dependency package information and project packaging script information.
5. The device according to claim 4, characterized in that It also includes an acquisition module, wherein the acquisition module is configured as follows: In response to the application under the micro-frontend architecture not being fully built, the configuration information of the sub-application to be upgraded is obtained; Generate the compiled code of the sub-application based on the configuration information of the sub-application to be upgraded and according to the dependent packages of the sub-application and the compilation and packaging of the sub-application; Output the compiled code of the sub-application to the sub-application container.
6. The device according to claim 4, characterized in that The generation module is also configured to: According to the dependent packages of the main application and the project path information configured in the main application, the project code in the compilation and packaging of the main application is transcoded, compiled and obfuscated to output as executable source code in the production environment.
7. A computer device, characterized in that: include: at least one processor; as well as A memory, wherein the memory stores computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 3.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Front-end container mirror image generation method and system
CN111880894A
High-availability implementation method and system based on micro front-end architecture
CN112306755A