CN116339727A - Application development method and device based on micro front end - Google Patents

Application development method and device based on micro front end Download PDF

Info

Publication number
CN116339727A
CN116339727A CN202310027433.5A CN202310027433A CN116339727A CN 116339727 A CN116339727 A CN 116339727A CN 202310027433 A CN202310027433 A CN 202310027433A CN 116339727 A CN116339727 A CN 116339727A
Authority
CN
China
Prior art keywords
application
sub
current main
information
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310027433.5A
Other languages
Chinese (zh)
Inventor
毕建浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202310027433.5A priority Critical patent/CN116339727A/en
Publication of CN116339727A publication Critical patent/CN116339727A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure relates to the technical field of internet, and in particular relates to an application development method and device based on a micro front end. The application development method based on the micro front end comprises the following steps: acquiring a software development kit corresponding to a current main application according to frame information corresponding to the current main application; acquiring access operation information corresponding to the current main application according to the service requirement of the current main application and the software development kit; and executing an operation corresponding to the access operation information on the page block of at least one sub-application of the current main application, so as to access the at least one sub-application to the micro front-end system. By adopting the method and the device, the cost of accessing the sub-application into the micro front-end system can be reduced, and the application development convenience of the micro front-end system is improved.

Description

Application development method and device based on micro front end
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to an application development method and device based on a micro front end.
Background
With the development of science and technology, the micro front end is a means for converting a global Wide area network (World Wide Web) application from a single application to a plurality of small front end applications to be aggregated into one, that is, the micro front end is a technical means and a method strategy for jointly constructing a modern Web application by a plurality of teams through independent release functions. For example, a cloud product unified access platform based on a micro front end architecture can be used for extracting and sourcing the micro front end kernel of the cloud product unified access platform, or a plurality of front end applications which are independently delivered can be integrated from the architecture level, and the architecture is still a cohesive single product. However, when the product frames are not uniform, the access steps of the micro front end are complicated, and the access cost is high, so that the convenience of application development is poor.
Disclosure of Invention
The disclosure provides an application development method and device based on a micro front end, so as to at least solve the problem of poor application development convenience in related technologies. The technical scheme of the present disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided an application development method based on a micro front end, including:
acquiring a software development kit corresponding to a current main application according to frame information corresponding to the current main application;
acquiring access operation information corresponding to the current main application according to the service requirement of the current main application and the software development kit;
and executing an operation corresponding to the access operation information on the page block of at least one sub-application of the current main application, so as to access the at least one sub-application to the micro front-end system.
Optionally, before obtaining the software development kit corresponding to the current main application according to the frame information corresponding to the current main application, the method further includes:
acquiring a selection instruction input for a current main application in a frame information set display page;
and determining frame information corresponding to the current main application according to the selection instruction.
Optionally, the executing, on the page block of at least one sub-application of the current main application, an operation corresponding to the access operation information on the at least one sub-application includes:
acquiring and caching sub-application resources corresponding to the at least one sub-application according to the access operation information;
loading the sub-application resources on a page block corresponding to the at least one sub-application;
and rendering the page element corresponding to the at least one sub-application according to the sub-application resource.
Optionally, after rendering the page element corresponding to the at least one sub-application according to the sub-application resource, the method further includes:
triggering a life cycle hook function corresponding to at least one sub-application when the fact that the page element corresponding to the at least one sub-application is rendered is determined to be completed, and sending first notification information to the current main application, wherein the first notification information is used for indicating the at least one sub-application to access the micro front-end system.
Optionally, the obtaining and caching the sub-application resource corresponding to the at least one sub-application includes:
determining an application programming component corresponding to the at least one sub-application;
and controlling the application programming component to acquire and cache sub-application resources corresponding to the at least one sub-application according to the field information of the current main application.
Optionally, the determining an application programming component corresponding to the at least one sub-application includes:
acquiring access level information corresponding to the at least one sub-application, wherein the access level information comprises component level access information or route level access information;
and determining an application programming component corresponding to the at least one sub-application according to the access level information.
Optionally, the method further comprises:
responding to the acquired unloading operation information, and determining at least one sub-application corresponding to the unloading operation information in the current main application;
controlling the current main application to unload sub-application resources corresponding to the at least one sub-application on a page block of the at least one sub-application;
triggering an unloading hook function corresponding to the at least one sub-application when the sub-application resource corresponding to the at least one sub-application is completely unloaded, and sending second notification information to the current main application, wherein the second notification information is used for indicating that the at least one sub-application in the micro front-end system is unloaded.
According to a second aspect of the embodiments of the present disclosure, there is provided an application development apparatus based on a micro front end, including:
a tool pack obtaining unit configured to obtain a software development tool pack corresponding to a current main application according to frame information corresponding to the current main application;
the information acquisition unit is configured to execute the operation information corresponding to the current main application according to the service requirement of the current main application and the software development kit;
and the operation execution unit is configured to execute an operation corresponding to the access operation information on at least one sub-application on the page block of the current main application so as to access the at least one sub-application to the micro front-end system.
According to a third aspect of embodiments of the present disclosure, there is provided a server comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the micro front end based application development method of any one of the preceding aspects.
According to a fourth aspect of the present application, there is provided a storage medium, which when executed by a processor of a server, enables the server to perform the micro front end based application development method of any one of the preceding aspects.
According to a fifth aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of any one of the preceding aspects.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in some or related embodiments, the software development kit corresponding to the current main application is obtained by according to the frame information corresponding to the current main application; acquiring access operation information corresponding to the current main application according to the service requirements of the current main application and the software development kit; and executing an operation corresponding to the access operation information on the at least one sub-application on the page block of the at least one sub-application of the current main application, so as to access the at least one sub-application into the micro front-end system or unload the at least one sub-application in the micro front-end system. Therefore, based on the frame information, the software development kit is obtained, the operation corresponding to the access operation information can be executed for at least one sub-application according to different service requirements, the non-uniformity of different frame information is reduced, the access steps of the micro front-end system are complicated, the situation that the operation corresponding to the access operation information cannot be executed for at least one sub-application is caused, the operation steps can be simplified, the cost of accessing the sub-application into the micro front-end system is reduced, and the application development convenience of the micro front-end system is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a flowchart illustrating a micro-front-end based application development method, according to an example embodiment;
FIG. 2 is a flowchart illustrating a micro-front-end based application development method, according to an example embodiment;
FIG. 3 is a schematic diagram of a framework of a micro front end based application development method, according to an example embodiment;
FIG. 4 is an interactive flow diagram illustrating development of a micro-front-end based application, according to an example embodiment;
FIG. 5 is a block diagram of a micro front end based application development device, according to an example embodiment;
FIG. 6 is a block diagram of a micro front end based application development device, according to an example embodiment;
FIG. 7 is a block diagram of a micro front end based application development device, according to an example embodiment;
FIG. 8 is a block diagram of a micro front end based application development device, according to an example embodiment;
FIG. 9 is a block diagram of a micro front end based application development device, according to an example embodiment;
fig. 10 is a block diagram of a server, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Fig. 1 is a flowchart illustrating a micro-front-end based application development method, as shown in fig. 1, which may be used in an application access micro-front-end system, according to an exemplary embodiment, comprising the steps of:
in step S11, according to the frame information corresponding to the current main application, acquiring a software development kit corresponding to the current main application;
according to some embodiments, the current master application refers to being accessed to the micro front end system. The current master application is not specific to a certain fixed application. For example, when the application name of the current host application changes, the current host application may also change accordingly. For example, when the frame information corresponding to the current main application changes, the current main application may also change accordingly.
It is easy to understand that the frame information refers to frame information corresponding to the current main application. The frame information is not particularly limited to a certain fixed information. For example, when the current host application changes, the framework information may also change accordingly.
In some embodiments, a software development kit (Software Development Kit, SDK) package builds a collection of development tools for application software for a particular software package, software framework, hardware platform, operating system, or the like. The SDK package of the embodiments of the present disclosure refers to a collection of development tools in the micro platform system that are built with the current application. The SDK package is not specific to a particular fixed SDK package. For example, when the number of development tools included in an SDK package changes, the SDK package may also change accordingly. For example, when the current host application changes, the SDK package may also change accordingly.
According to some embodiments, a software development kit corresponding to a current host application may be obtained from the framework information corresponding to the current host application.
In step S12, access operation information corresponding to the current main application is obtained according to the service requirement of the current main application and the software development kit;
according to some embodiments, business requirements refer to the goals that are planned for the needs of the current host application. The traffic demand is not specific to a certain fixed traffic demand. The business requirements may include, for example, but are not limited to, stand-alone deployment, stand-alone operation, stand-alone testing, and the like.
It is easy to understand that the access operation information refers to specific information for operating the current main application, and the access operation information does not refer to certain fixed operation information. The access operation information is used for indicating at least one sub-application of the current main application to be accessed to the micro front-end system.
According to some embodiments, a software development kit corresponding to a current host application may be obtained from the framework information corresponding to the current host application. According to the service requirement of the current main application and the software development kit, access operation information corresponding to the current main application can be obtained.
In step S13, an operation corresponding to the access operation information is performed on at least one sub-application on the page block of at least one sub-application of the current main application, so as to access the at least one sub-application to the micro front-end system.
According to some embodiments, a sub-application refers to a sub-application included in a current main application. The sub-application may be, for example, a web application specific to something. For example, when the current main application is a video-like application, the sub-application may be, for example, a web application for only television shows. The sub-application is not specific to a particular stator application. For example, when a modification instruction is received for the sub-application, the sub-application may also change accordingly.
It is easy to understand that at least one sub-application refers to a sub-application to be operated in the current main application. The at least one sub-application is not specific to a certain class of fixed sub-applications. For example, when the number of applications corresponding to at least one sub-application changes, the at least one sub-application may also change accordingly. For example, when the application type corresponding to at least one sub-application changes, the at least one sub-application may also change accordingly. For example, when the application identifier corresponding to at least one sub-application changes, the at least one sub-application may also change accordingly.
According to some embodiments, a software development kit corresponding to a current host application may be obtained from the framework information corresponding to the current host application. According to the service requirement of the current main application and the software development kit, access operation information corresponding to the current main application can be obtained, and operations corresponding to the access operation information can be executed on at least one sub-application on a page block of at least one sub-application of the current main application, so that at least one sub-application is accessed to the micro front-end system.
In some or related embodiments, the software development kit corresponding to the current main application is obtained by according to the frame information corresponding to the current main application; acquiring access operation information corresponding to the current main application according to the service requirements of the current main application and the software development kit; and executing an operation corresponding to the access operation information on the at least one sub-application on the page block of the at least one sub-application of the current main application, so as to access the at least one sub-application into the micro front-end system or unload the at least one sub-application in the micro front-end system. Therefore, based on the frame information, the software development kit is obtained, the operation corresponding to the access operation information can be executed for at least one sub-application according to different service requirements, the non-uniformity of different frame information is reduced, the access steps of the micro front-end system are complicated, the situation that the operation corresponding to the access operation information cannot be executed for at least one sub-application is caused, the operation steps can be simplified, the cost of accessing the sub-application into the micro front-end system is reduced, and the application development convenience of the micro front-end system is improved.
Fig. 2 is a flowchart illustrating a micro front-end based application development method, which may be used for an application to access a micro front-end system, as shown in fig. 2, according to an exemplary embodiment, comprising the steps of:
in step S21, a selection instruction input for the current main application is acquired in the frame information set display page;
in one embodiment of the present disclosure, the micro front end based application development method may be applied to various scenarios, for example, the micro front end based application development method may be applied to sub-application access micro front end system scenarios.
According to some embodiments, the set of frame information refers to a collective body formed by aggregation of at least one frame information. The set of frame information does not refer specifically to a fixed set. For example, when the number of frame information included in the frame information set changes, the frame information set may also change accordingly. For example, when the frame information included in the frame information set changes, the frame information may also change accordingly.
According to some embodiments, the selection instruction is for selecting frame information corresponding to a current host application. The selection instruction does not refer to a fixed instruction. When the current master application changes, the selection instruction may also change accordingly. The selection instruction includes, but is not limited to, a voice selection instruction, a click selection instruction, and the like. Or when the current main application is acquired, the frame information of the current main application can be identified, and confirmation prompt information is sent out, and the selection instruction can be, for example, the received selection instruction for the confirmation prompt information.
According to some embodiments, a selection instruction input for a current main application can be acquired in a frame information set presentation page. For example, in a frame information set presentation page, a voice selection instruction input for a current main application is acquired. The voice selection instruction may be, for example, selecting the frame information of the current main application as a-frame information.
In step S22, according to the selection instruction, determining frame information corresponding to the current main application;
the specific procedure is as described above and will not be repeated here.
According to some embodiments, when a selection instruction input for a current main application is acquired, frame information corresponding to the current main application may be determined according to the selection instruction. For example, when a voice selection instruction input for the current main application is acquired, and the voice selection instruction may be, for example, selecting the frame information of the current main application as the a-frame information, it may be determined that the frame information corresponding to the current main application is the a-frame information. Therefore, the method can support the autonomous selection of the frame information, support the access of the multi-frame information to the micro front-end system and improve the efficiency of the sub-application to the micro front-end system.
In step S23, access operation information corresponding to the current main application is obtained according to the service requirement of the current main application and the software development kit;
the specific procedure is as described above and will not be repeated here.
In step S24, according to the access operation information, sub-application resources corresponding to at least one sub-application are obtained and cached;
according to some embodiments, according to the access operation information, at least one sub-application in the current main application may be acquired, i.e. at least one sub-application to be accessed to the micro front-end system may be determined. When at least one sub-application is determined, sub-application resources corresponding to the at least one sub-application may be acquired and cached. The sub-application resource is used to indicate the important components that make up the sub-application. The sub-application resources are not specific to a certain fixed resource, e.g. when at least one sub-application changes, the sub-application resources may also change accordingly.
In one embodiment of the present disclosure, the current host application may be, for example, a video application. The at least one sub-application may be, for example, an A sub-application, a B sub-application, and a C sub-application. Sub-application resources corresponding to the A sub-application, the B sub-application and the C sub-application can be obtained.
According to some embodiments, when the sub-application resource corresponding to the at least one sub-application is acquired and cached, an application programming component corresponding to the at least one sub-application may be determined; the control application programming component acquires and caches sub-application resources corresponding to at least one sub-application according to field information of the current main application, so that accuracy of determining the sub-application resources can be improved, and convenience of accessing the sub-application into the micro front-end system is improved.
It is readily understood that the application programming component may be, for example, an application programming interface (Application Programming Interface, API) component. Wherein the different framework information and the different access level information correspond to different API components. For example, the API component may be controlled to obtain and cache sub-application resources corresponding to at least one sub-application according to fields such as name, key, env, and the like, and according to field information of the current main application, that is, sub-application resources that need to be accessed currently may be obtained. Wherein env is an external command for displaying the environment variable of the current user. Therefore, the API can be in butt joint according to the corresponding code program, and the condition that different sub-applications need different API components is not needed, so that the development cost of the application program can be reduced. The code multiplexing of the base library can be completed by different sub-applications, incremental upgrading and gray level version control are achieved, and authority control of each sub-application is unified.
According to some embodiments, when determining an application programming component corresponding to at least one sub-application, access level information corresponding to the at least one sub-application may be obtained, where the access level information includes component level access information or route level access information; an application programming component corresponding to the at least one sub-application is determined based on the access level information.
It will be readily appreciated that component level access information or route level access information may differ in writing, storage location, and received tips. Wherein tips are used primarily for component value transfer.
In step S25, sub-application resources are loaded on the page block corresponding to at least one sub-application;
according to some embodiments, when a sub-application resource of at least one sub-application is acquired, the sub-application resource may be loaded on a page block of at least one sub-application pair.
In step S26, rendering at least one page element corresponding to the sub-application according to the sub-application resource;
it is readily understood that page elements refer to all objects used in a web page for organizing structures including, but not limited to, forms, layers, navigation bars, links, and the like, and expressing content. The expression includes, but is not limited to, text, images, video, etc. Wherein page elements corresponding to different sub-applications are different. For example, when a sub-application changes, the page element may also change accordingly.
According to some embodiments, when a sub-application resource of at least one sub-application is obtained, a page element corresponding to the at least one sub-application may be rendered according to the sub-application resource.
In step S27, when it is determined that rendering of the page element corresponding to the at least one sub-application is completed, a lifecycle hook function corresponding to the at least one sub-application is triggered, and the first notification information is sent to the current main application.
According to some embodiments, a lifecycle hook function refers to a function that can be automatically invoked throughout the lifecycle of a component to represent the process of sub-application creation to destruction.
It is easy to understand that the first notification information is used to instruct at least one sub-application to access the micro front-end system. The first notification message is not specific to a certain fixed message. The first notification message includes, but is not limited to, a text notification message, a voice notification message, a vibration notification message, a fixed indication value notification message, and the like. The fixed indication value notification message may be, for example, 1 indicating that rendering of the page element corresponding to the at least one sub-application is completed, and 0 indicating that rendering of the page element corresponding to the at least one sub-application fails. The first of the first notification messages is only used to distinguish from the remaining notification messages.
According to some embodiments, when it is determined that rendering of the page element corresponding to the at least one sub-application is completed, a lifecycle hook function corresponding to the at least one sub-application is triggered, and the first notification information is sent to the current main application. Therefore, the method can support independent development, independent test and independent operation of the sub-application, and can reduce time cost and labor cost.
Fig. 3 is a schematic diagram of a framework illustrating a micro-front-end based application development method, according to some embodiments. As shown in fig. 3, the micro front end based application development method framework includes Command Line Interface (CLI), SDK, micro front end module, micro front end development platform, dependent services, and the like. Wherein different framework information corresponds to different SDKs.
According to some embodiments, when the frame information is the a-route level access scenario, a main application name registered on the management platform and a Key word Key field used when the main application is registered on the management platform may be used to determine sub-application resources of at least one sub-application.
According to some embodiments, when the frame information is a B-route level access scene, an application name when the main application is created may be obtained, and a Key word Key field automatically generated after the main application is created may be obtained, so as to determine sub-application resources of at least one sub-application.
In summary, according to the method provided by the embodiment of the disclosure, the selection instruction input for the current main application is obtained in the frame information set display page, and the frame information corresponding to the current main application is determined according to the selection instruction, so that the autonomous selection of the frame information can be supported, the multi-frame information is supported to be accessed into the micro front-end system, and the efficiency of accessing the sub-application into the micro front-end system is improved. Secondly, according to the service requirement of the current main application, access operation information corresponding to the current main application is obtained, and according to the access operation information, sub-application resources corresponding to at least one sub-application can be obtained and cached; the method comprises the steps of loading sub-application resources on a page block corresponding to at least one sub-application, rendering page elements corresponding to at least one sub-application according to the sub-application resources, executing operation corresponding to at least one sub-application, acquiring a software development kit based on frame information, executing operation corresponding to operation information on at least one sub-application according to different business requirements, reducing non-uniformity of different frame information, enabling micro front-end access steps to be complicated, enabling the situation that the operation corresponding to the operation information cannot be executed on at least one sub-application to be caused, simplifying operation steps, reducing access cost, and improving application development convenience of a micro front-end system. In addition, when the rendering of the page element corresponding to at least one sub-application is determined to be completed, the life cycle hook function corresponding to at least one sub-application is triggered, and the first notification information is sent to the current main application, so that the confirmation time can be reduced, and the convenience of the current main application in acquiring the information that the sub-application has been accessed to the micro front-end system is improved.
Fig. 4 is a flowchart illustrating a micro-front-end based application development method, which may be used for an application to access a micro-front-end system, as shown in fig. 4, according to an exemplary embodiment, comprising the steps of:
in step S31, according to the frame information corresponding to the current main application, a software development kit corresponding to the current main application is obtained;
the specific procedure is as described above and will not be repeated here.
According to some embodiments, the current host application refers to an application that is being offloaded from the micro front-end system.
In step S32, access operation information corresponding to the current main application is obtained according to the service requirement of the current main application and the software development kit;
the specific procedure is as described above and will not be repeated here.
In step S33, on the page block of at least one sub-application of the current main application, performing an operation corresponding to the access operation information on the at least one sub-application;
the specific procedure is as described above and will not be repeated here.
In step S34, at least one sub-application corresponding to the unloading operation information in the current main application is determined in response to the acquired unloading operation information;
according to some embodiments, in response to the obtained unloading operation information, at least one sub-application in the current main application may be obtained, that is, at least one sub-application to be unloaded in the micro front-end system may be determined, that is, when the operation information is unloading operation information, at least one sub-application corresponding to the unloading operation information in the current main application is determined. When at least one sub-application is determined, sub-application resources corresponding to the at least one sub-application may be acquired and cached. The sub-application resource is used to indicate the important components that make up the sub-application. The sub-application resources are not specific to a certain fixed resource, e.g. when at least one sub-application changes, the sub-application resources may also change accordingly.
In one embodiment of the present disclosure, the current host application may be, for example, a video application. The at least one sub-application may be, for example, an A sub-application, a B sub-application, and a C sub-application. Sub-application resources corresponding to the A sub-application, the B sub-application and the C sub-application can be obtained.
In step S35, the current main application is controlled to unload the sub-application resource corresponding to at least one sub-application on the page block of the at least one sub-application;
according to some embodiments, when the operation information is unloading operation information, at least one sub-application in the current main application may be acquired, i.e. at least one sub-application to be unloaded from the micro front-end system may be determined. When at least one sub-application is determined, sub-application resources corresponding to the at least one sub-application may be acquired and cached. The sub-application resource is used to indicate the important components that make up the sub-application. The sub-application resources are not specific to a certain fixed resource, e.g. when at least one sub-application changes, the sub-application resources may also change accordingly.
In one embodiment of the present disclosure, the current host application may be, for example, a video application. The at least one sub-application may be, for example, an a sub-application, a B sub-application, and a C sub-application, and sub-application resources corresponding to the a sub-application, the B sub-application, and the C sub-application may be obtained. The current main application can be controlled to unload the sub-application resources corresponding to the at least one sub-application on the page block of the at least one sub-application.
In step S36, when it is determined that the unloading of the sub-application resource corresponding to the at least one sub-application is completed, an unloading hook function corresponding to the at least one sub-application is triggered, and second notification information is sent to the current main application, where the second notification information is used to indicate that the at least one sub-application in the micro front-end system has been unloaded.
According to some embodiments, the uninstall hook function refers to a function that can be automatically invoked when the component uninstalls the sub-application, and is used to indicate the process from the start of uninstallation of the sub-application to the completion of uninstallation.
It is readily understood that the second notification information is used to indicate that at least one sub-application in the micro front-end system has been uninstalled, i.e. that the at least one sub-application has been uninstalled from the micro front-end system. The second notification message is not specific to a certain fixed message. The second notification message includes, but is not limited to, a text notification message, a voice notification message, a vibration notification message, a fixed indication value notification message, and the like. The fixed indication value notification message may be, for example, 1 indicating that at least one sub-application in the micro-front-end system has been offloaded, 0 indicating that at least one sub-application in the micro-front-end system has failed to be offloaded. The second of the second notification messages is only used to distinguish from the rest of the notification messages.
According to some embodiments, when it is determined that the unloading of the sub-application resource corresponding to the at least one sub-application is completed, triggering an unloading hook function corresponding to the at least one sub-application, and sending second notification information to the current main application, where the second notification information is used to indicate that the at least one sub-application in the micro front-end system has been unloaded.
In summary, according to the method provided by the embodiment of the present disclosure, by determining at least one sub-application corresponding to the offloading operation information in the current main application in response to the obtained offloading operation information, controlling the current main application to offload sub-application resources corresponding to the at least one sub-application on a page block of the at least one sub-application, triggering an offloading hook function corresponding to the at least one sub-application when determining that offloading of the sub-application resources corresponding to the at least one sub-application is completed, and sending second notification information to the current main application, where the second notification information is used to indicate that the at least one sub-application in the micro front-end system has been offloaded, so that a duration of the current main application for obtaining the offloading information of the sub-application can be reduced, and convenience of the current main application for obtaining the offloading information from the micro front-end system is improved.
FIG. 5 is a block diagram of a micro front end based application development device, according to an example embodiment. Referring to fig. 5, the apparatus 500 includes a tool pack acquiring unit 501, an information acquiring unit 502, and an operation executing unit 503.
A tool pack obtaining unit 501 configured to obtain a software development tool pack corresponding to a current main application according to frame information corresponding to the current main application;
an information obtaining unit 502, configured to obtain access operation information corresponding to a current main application according to a service requirement of the current main application and a software development kit;
an operation execution unit 503 is configured to execute an operation corresponding to the access operation information on at least one sub-application on a page block of at least one sub-application of the current main application, so as to access the at least one sub-application to the micro front-end system.
Fig. 6 is a block diagram of a micro-front-end based application development device, according to some embodiments, shown in accordance with an exemplary embodiment. Referring to fig. 6, the micro front end based application development apparatus 500 further includes a frame information obtaining unit 504 configured to perform specific execution before obtaining a software development kit corresponding to a current main application according to frame information corresponding to the current main application:
acquiring a selection instruction input for a current main application in a frame information set display page;
and determining the frame information corresponding to the current main application according to the selection instruction.
Fig. 7 is a block diagram of a micro-front-end based application development device, according to some embodiments, shown in accordance with an exemplary embodiment. Referring to fig. 7, the operation execution unit 503 includes a resource acquisition subunit 513, a resource loading subunit 523, and an element rendering subunit 533, and the operation execution unit 503 is configured to execute, on a page block of at least one sub-application of the current main application, an operation corresponding to the access operation information on the at least one sub-application, when:
a resource obtaining sub-unit 513 configured to obtain and cache sub-application resources corresponding to at least one sub-application according to the access operation information;
a resource loading subunit 523 configured to perform loading of sub-application resources on a page block corresponding to at least one sub-application;
an element rendering subunit 533 configured to perform rendering of the page element corresponding to the at least one sub-application according to the sub-application resource.
Fig. 8 is a block diagram of a micro-front-end based application development device, according to some embodiments, shown in accordance with an exemplary embodiment. Referring to fig. 8, the operation execution unit 503 further includes a notification information sending subunit 543 configured to trigger, after rendering the page element corresponding to the at least one sub-application according to the sub-application resource, a lifecycle hook function corresponding to the at least one sub-application when determining that the rendering of the page element corresponding to the at least one sub-application is completed, and send first notification information to the current main application, where the first notification information is used to instruct the at least one sub-application to access the micro front-end system.
According to some embodiments, the resource obtaining subunit 513 is configured, when configured to obtain and cache the sub-application resource corresponding to the at least one sub-application, to specifically configured to:
determining an application programming component corresponding to the at least one sub-application;
and the control application programming component acquires and caches sub-application resources corresponding to at least one sub-application according to the field information of the current main application.
According to some embodiments, the resource obtaining subunit 513 is configured, when executing the determining an application programming component corresponding to the at least one sub-application, to:
acquiring access level information corresponding to at least one sub-application, wherein the access level information comprises component level access information or route level access information;
an application programming component corresponding to the at least one sub-application is determined based on the access level information.
Fig. 9 is a block diagram of a micro-front-end based application development device, according to some embodiments, shown in accordance with an exemplary embodiment. Referring to fig. 9, the operation execution unit 503 includes a sub-application determination sub-unit 553, a resource offloading sub-unit 563, and a notification information transmission sub-unit 543, and the operation execution unit 503 is configured to execute, on a page block of at least one sub-application of a current main application, an operation corresponding to operation information on the at least one sub-application, when:
a sub-application determining subunit 553 configured to perform determining at least one sub-application corresponding to the offloading operation information in the current main application in response to the obtained offloading operation information;
a resource offloading subunit 563 configured to perform control to offload, by the current main application, sub-application resources corresponding to at least one sub-application on a page block of the at least one sub-application;
and the notification information sending subunit 543 is configured to trigger an unloading hook function corresponding to the at least one sub-application to send second notification information to the current main application when it is determined that the unloading of the sub-application resource corresponding to the at least one sub-application is completed, where the second notification information is used to indicate that the at least one sub-application in the micro front-end system is unloaded.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In summary, according to the device provided by the embodiment of the present disclosure, a tool kit obtaining unit obtains a software development tool kit corresponding to a current main application according to frame information corresponding to the current main application; the information acquisition unit acquires access operation information corresponding to the current main application according to the service requirement of the current main application and the software development kit; the operation execution unit executes an operation corresponding to the access operation information on at least one sub-application on a page block of at least one sub-application of the current main application, so as to access the at least one sub-application to the micro front-end system. Therefore, based on the frame information, the software development kit is obtained, the operation corresponding to the access operation information can be executed for at least one sub-application according to different service requirements, and the non-uniformity of different frame information is reduced, so that the access steps of the micro front-end system are complicated, the situation that the operation corresponding to the access operation information cannot be executed for at least one sub-application is caused, the operation steps can be simplified, the access cost is reduced, and the application development convenience of the micro front-end system is improved.
Fig. 10 shows a schematic structural diagram of a server 1000 disclosed in an embodiment of the present application, where the server 1000 may implement the foregoing method for controlling task objects according to an embodiment of the present application.
As shown in fig. 10, the server 1000 includes a processor 1001 and a memory 1002, wherein the server 1000 may further include a bus 1003, the processor 1001 and the memory 1002 may be connected to each other through the bus 1003, and the bus 1003 may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The bus 1003 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one line is shown in fig. 10, but not only one bus or one type of bus. Memory 1002 is used to store one or more programs that include instructions; the processor 1001 is configured to scan the instructions 1011 stored in the memory 1002 to perform the steps of the micro front end based application development method described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. The application development method based on the micro front end is characterized by comprising the following steps of:
acquiring a software development kit corresponding to a current main application according to frame information corresponding to the current main application;
acquiring access operation information corresponding to the current main application according to the service requirement of the current main application and the software development kit;
and executing an operation corresponding to the access operation information on the page block of at least one sub-application of the current main application, so as to access the at least one sub-application to the micro front-end system.
2. The method according to claim 1, wherein before obtaining the software development kit corresponding to the current main application according to the frame information corresponding to the current main application, further comprises:
acquiring a selection instruction input for a current main application in a frame information set display page;
and determining frame information corresponding to the current main application according to the selection instruction.
3. The method of claim 1, wherein the performing an operation corresponding to the access operation information on the at least one sub-application on the page block of the at least one sub-application of the current main application comprises:
acquiring and caching sub-application resources corresponding to the at least one sub-application according to the access operation information;
loading the sub-application resources on a page block corresponding to the at least one sub-application;
and rendering the page element corresponding to the at least one sub-application according to the sub-application resource.
4. The method of claim 3, wherein after rendering the page element corresponding to the at least one sub-application according to the sub-application resource, further comprising:
triggering a life cycle hook function corresponding to at least one sub-application when the fact that the page element corresponding to the at least one sub-application is rendered is determined to be completed, and sending first notification information to the current main application, wherein the first notification information is used for indicating the at least one sub-application to access the micro front-end system.
5. The method of claim 3, wherein the obtaining and caching the sub-application resource corresponding to the at least one sub-application comprises:
determining an application programming component corresponding to the at least one sub-application;
and controlling the application programming component to acquire and cache sub-application resources corresponding to the at least one sub-application according to the field information of the current main application.
6. The method of claim 5, wherein the determining an application programming component corresponding to the at least one sub-application comprises:
acquiring access level information corresponding to the at least one sub-application, wherein the access level information comprises component level access information or route level access information;
and determining an application programming component corresponding to the at least one sub-application according to the access level information.
7. The method according to claim 1, wherein the method further comprises:
responding to the acquired unloading operation information, and determining at least one sub-application corresponding to the unloading operation information in the current main application;
controlling the current main application to unload sub-application resources corresponding to the at least one sub-application on a page block of the at least one sub-application;
triggering an unloading hook function corresponding to the at least one sub-application when the sub-application resource corresponding to the at least one sub-application is completely unloaded, and sending second notification information to the current main application, wherein the second notification information is used for indicating that the at least one sub-application in the micro front-end system is unloaded.
8. An application development device based on a micro front end, comprising:
a tool pack obtaining unit configured to obtain a software development tool pack corresponding to a current main application according to frame information corresponding to the current main application;
the information acquisition unit is configured to execute the operation information corresponding to the current main application according to the service requirement of the current main application and the software development kit;
and the operation execution unit is configured to execute an operation corresponding to the access operation information on at least one sub-application on the page block of the current main application so as to access the at least one sub-application to the micro front-end system.
9. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 7.
10. A storage medium, which when executed by a processor of a server, enables the server to perform the method of any one of claims 1 to 7.
CN202310027433.5A 2023-01-09 2023-01-09 Application development method and device based on micro front end Pending CN116339727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310027433.5A CN116339727A (en) 2023-01-09 2023-01-09 Application development method and device based on micro front end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310027433.5A CN116339727A (en) 2023-01-09 2023-01-09 Application development method and device based on micro front end

Publications (1)

Publication Number Publication Date
CN116339727A true CN116339727A (en) 2023-06-27

Family

ID=86886527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310027433.5A Pending CN116339727A (en) 2023-01-09 2023-01-09 Application development method and device based on micro front end

Country Status (1)

Country Link
CN (1) CN116339727A (en)

Similar Documents

Publication Publication Date Title
US7287190B2 (en) Simultaneous execution of test suites on different platforms
US9798555B2 (en) Application implementation method and apparatus
EP3333704A1 (en) Method and apparatus for repairing kernel vulnerability
CN109558320B (en) System testing method, device, system, equipment and computer readable storage medium
CN110825399B (en) Deployment method and device of application program
CN110968331B (en) Method and device for running application program
CN110196809B (en) Interface testing method and device
CN111290951B (en) Test method, terminal, server, system and storage medium
CN112765023A (en) Test case generation method and device
CN103324517A (en) Off-line application generation and call method, terminal and system
CN111064621A (en) Service data docking method and device
CN112783761A (en) Method, device and system for testing cold start duration of application program
CN111352836A (en) Pressure testing method and related device
CN111414303B (en) Auxiliary system and method for script performance test
CN112149035A (en) Website static resource processing method and device
CN113448988A (en) Method and device for training algorithm model, electronic equipment and storage medium
CN111126604B (en) Model training method, device, server and storage medium
CN112230978A (en) Multi-data-source dynamic switching method, electronic equipment and storage medium
CN116339727A (en) Application development method and device based on micro front end
CN113626099B (en) Application program starting method and device and electronic equipment
CN110968471A (en) Program crash problem reporting method, storage medium, electronic device and system
CN114610446A (en) Method, device and system for automatically injecting probe
CN114679491A (en) Micro front-end service application method and device, storage medium and electronic equipment
CN107045549B (en) Method and device for acquiring page number of electronic book
US9553935B2 (en) Mechanism for configuring service endpoints in native client applications at runtime

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination