CN116954669A - Sub-application development method and device - Google Patents

Sub-application development method and device Download PDF

Info

Publication number
CN116954669A
CN116954669A CN202310995135.5A CN202310995135A CN116954669A CN 116954669 A CN116954669 A CN 116954669A CN 202310995135 A CN202310995135 A CN 202310995135A CN 116954669 A CN116954669 A CN 116954669A
Authority
CN
China
Prior art keywords
application
sub
resource
module
script
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
CN202310995135.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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202310995135.5A priority Critical patent/CN116954669A/en
Publication of CN116954669A publication Critical patent/CN116954669A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The disclosure provides a sub-application development method and device, relates to the technical field of computers, and particularly relates to the technical field of application development, and can be applied to an intelligent applet developer platform. One embodiment of the method comprises the following steps: acquiring a target service module; creating a sub-application based on the target business module; the sub-application is online, and version configuration information of the sub-application is generated through analysis; mounting the sub-application into the main application; the sub-application is rendered such that the sub-application is displayed in the main application. This embodiment can ensure that the system is in a maintainable, scalable, highly available state.

Description

Sub-application development method and device
Technical Field
The disclosure relates to the field of computer technology, and in particular relates to the field of application development technology, which can be applied to an intelligent applet developer platform.
Background
The intelligent applet developer platform is a personal computer platform application in which single pages and multiple pages coexist. Currently, the overall code amount of business related codes of an intelligent applet developer platform exceeds 30 ten thousand lines, and the number of platform pages exceeds 100, so that the intelligent applet developer platform has been developed into a large enterprise-level boulder project. As project iteration complexity increases, intelligent applet developer platforms are difficult to maintain. The modification and change are very large, and the time consumption is long, so that the stability of the online service can be influenced.
Disclosure of Invention
The embodiment of the disclosure provides a sub-application development method, a device, equipment, a storage medium and a program product.
In a first aspect, an embodiment of the present disclosure provides a method for developing an application, including: acquiring a target service module; creating a sub-application based on the target business module; the sub-application is online, and version configuration information of the sub-application is generated through analysis; mounting the sub-application into the main application; the sub-application is rendered such that the sub-application is displayed in the main application.
In a second aspect, an embodiment of the present disclosure provides a sub-application development apparatus, including: the acquisition module is configured to acquire the target service module; a creation module configured to create a sub-application based on the target business module; the analysis module is configured to bring the sub-application on line and analyze and generate version configuration information of the sub-application; a mounting module configured to mount the sub-application into the main application; and the rendering module is configured to render the sub-application so that the sub-application is displayed in the main application.
In a third aspect, an embodiment of the present disclosure proposes an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method as described in the first aspect.
In a fifth aspect, embodiments of the present disclosure propose a computer program product comprising a computer program which, when executed by a processor, implements a method as described in the first aspect.
The sub-application development method provided by the embodiment of the disclosure realizes the development of the newly added service module and the reconstruction of part of old service modules on the premise of not influencing the old codes. At the same time, common components and capabilities can be extracted to realize multiplexing. The coexistence of multi-framework sub-applications is realized, modification and change are small, time consumption is shortened, the influence on the stability of on-line service is reduced, and the system can be ensured to be in a maintainable, extensible and high-availability state.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of one embodiment of a sub-application development method according to the present disclosure;
FIG. 2 is an architecture diagram of sub-application development;
FIG. 3 is a flow chart of yet another embodiment of a sub-application development method according to the present disclosure;
FIG. 4 is a flow chart of adding a request in a domready event of a host application;
FIG. 5 is a schematic structural diagram of one embodiment of a sub-application development apparatus according to the present disclosure;
fig. 6 is a block diagram of an electronic device used to implement a sub-application development method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates a flow 100 of one embodiment of a sub-application development method according to the present disclosure. The sub-application development method comprises the following steps:
and step 101, acquiring a target service module.
In this embodiment, the sub-application development method may acquire the target service module.
Since the intelligent applet developer platform adopts the project management mode of Monorepo (monolithic repositories, single code library), all projects are partitioned into small modules by using Buck/Bazel in one code warehouse.
The target traffic module may be a code in a Monorepo that is split into one module. For example, the target business module may be an old business module to be modified obtained from the intelligent applet developer platform, thereby implementing modification of the old business module in the intelligent applet developer platform. For another example, the target business module may be to create a new business module in the smart applet developer platform, thereby enabling the development of the new business module in the smart applet developer platform.
Aiming at a new service module, the new service module can be constructed in a weback (module packer) construction mode, and different JS (JavaScript, script) files are constructed by supporting different commands. For example, executing npm run build, brand is packaged to yield js files for brand pages under src/page/brand. For another example, executing npm run build nav is for the navigation module under src/page/nav to package and yield js file.
Step 102, creating sub-applications based on the target business module.
In this embodiment, the execution body may create the sub-application based on the target service module.
In general, the target business module may be directly applied as a sub-application. Either the old business module to be rebuilt or the new business module created can be put under the new catalog packages/smart program-development-multi app as a child application. Then, the micro front end framework universe is imported to perform JS isolation and CSS (Cascading Style Sheets, cascading style sheet) isolation on the sub-application, and the sub-application is modified by using an API (Application Programming Interface ) of the micro front end, so that the sub-application is mounted after the main application is called. The front-end application framework is used as a micro front-end application framework, and the modular design, code multiplexing and maintainability of the front-end application program can be effectively realized. JS quarantine refers to that the execution of the child applications 'JS's within its scope does not affect parent and sibling applications. CSS quarantine is to limit the scope of influence of styles with the priority and scope of the CSS selector. In the CSS, the priority of the selector is determined according to the specificity, weight and order of the selector. When a plurality of selectors act on the same element, a pattern of a selector with a high priority will override a pattern of a selector with a low priority. CSS style quarantine may also be implemented by CSS scopes. CSS scope refers to a style that acts only on a specified element or component, without affecting other elements or components. Here, CSS quarantine is a default built-in quarantine mode in a micro front end such as a micr, and only needs to be referred to.
Step 103, the sub-application is online, and version configuration information of the sub-application is generated through analysis.
In this embodiment, the execution body may bring the sub-application into line, and analyze and generate version configuration information of the sub-application.
After the whole main application and the sub application are constructed, the sub application can be online, the sub application version management is designed, the packaging information of the sub application is uploaded, and further the information such as the version configuration of the output sub application is analyzed.
And 104, mounting the sub application into the main application.
In this embodiment, the execution body may mount the sub-application into the main application.
By adding a request in the domready event of the main application, the sub-application of the main application can be installed. Where domReady is a generic term for domsetloaded events, when the original HTML (Hyper Text Markup Language ) document is fully loaded and parsed, the domsetloaded event is triggered without waiting for full loading of style sheets, images and subframes.
Step 105, rendering the sub-application so that the sub-application is displayed in the main application.
In this embodiment, the execution body may render the sub-application so that the sub-application is displayed in the main application.
For the rendering of sub-applications, two cases can be distinguished: firstly, for the sub-application (such as side navigation) without intercepting the route, the mounting of the sub-application can be directly called for rendering; secondly, for the sub-application needing to intercept the route, an interface (such as an API related to the micro front terminal application) can be called to render the mount of the sub-application.
The sub-application development method provided by the embodiment of the disclosure realizes the development of the newly added service module and the reconstruction of part of old service modules on the premise of not influencing the old codes. At the same time, common components and capabilities can be extracted to realize multiplexing. The coexistence of multi-framework sub-applications is realized, modification and change are small, time consumption is shortened, the influence on the stability of on-line service is reduced, and the system can be ensured to be in a maintainable, extensible and high-availability state.
According to the sub-application development method provided by the embodiment of the disclosure, the public components can be directly supported to be multiplexed in the subsystem by adopting the project management mode of Monorep, and the independent deployment and development of the system can be supported by aiming at the construction scheme of the subsystem design without influencing the operation of the main application, so that the method is suitable for iteratively developing large projects in a mode of coexistence of new and old versions.
According to the sub-application development method provided by the embodiment of the disclosure, a dynamic configurable subsystem loading scheme is designed, single fine-grained page module updating is supported, for example, the page can support that top navigation is an old version, and side navigation adopts a new version. And the dynamic configurable support can fall back to the old version at any time, and the old version can be accessed only by falling back the version to the previous version by the version configuration module of the sub-application.
With continued reference to FIG. 2, an architecture diagram of sub-application development is shown. As shown in fig. 2, first, a sub-application is built based on a target service module and brought online. And then analyzing the sub-application products to realize the mounting of the main application to the sub-application.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a child application development method according to the present disclosure is shown. The sub-application development method comprises the following steps:
step 301, acquiring a service module to be modified from a small program developer platform as a target service module; and/or creating a script file according to a preset command to serve as a target service module.
In this embodiment, the execution body of the sub-application development method may acquire a service module to be modified from the applet developer platform as a target service module; and/or creating a script file according to a preset command to serve as a target service module.
Since the intelligent applet developer platform adopts the project management mode of Monorepo, all projects are partitioned into small modules in a code warehouse by using Buck/Bazel.
The target traffic module may be a code in a Monorepo that is split into one module. For example, the target business module may be an old business module to be modified obtained from the intelligent applet developer platform, thereby implementing modification of the old business module in the intelligent applet developer platform. For another example, the target business module may be to create a new business module in the smart applet developer platform, thereby enabling the development of the new business module in the smart applet developer platform.
Aiming at a new service module, the new service module can be constructed in a weback construction mode, and different JS files are constructed by supporting different commands. For example, executing npm run build, brand is packaged to yield js files for brand pages under src/page/brand. For another example, executing npm run build nav is for the navigation module under src/page/nav to package and yield js file.
And 302, putting the target service module as a sub-application into a preset directory.
In this embodiment, the execution body may put the target service module as a sub-application into a preset directory.
In general, the target business module may be directly applied as a sub-application. Either the old business module to be rebuilt or the new business module created can be put under the new catalog packages/smart program-development-multi app as a child application.
Step 303, performing script isolation and cascading style isolation on the sub-application, and modifying the isolated sub-application so as to mount the isolated sub-application when the main application is called.
In this embodiment, the execution body may perform script isolation and cascading style isolation on the sub-application, and reform the isolated sub-application, so that the isolated sub-application is mounted when the main application is called.
The lead-in micro front end framework Qiankun can carry out JS isolation and CSS isolation on the sub-application, and the sub-application is modified by utilizing the API of the micro front end, so that the sub-application is mounted after the main application is called. The front-end application framework is used as a micro front-end application framework, and the modular design, code multiplexing and maintainability of the front-end application program can be effectively realized. JS quarantine refers to that the execution of the child applications 'JS's within its scope does not affect parent and sibling applications. CSS quarantine is to limit the scope of influence of styles with the priority and scope of the CSS selector. In the CSS, the priority of the selector is determined according to the specificity, weight and order of the selector. When a plurality of selectors act on the same element, a pattern of a selector with a high priority will override a pattern of a selector with a low priority. CSS style quarantine may also be implemented by CSS scopes. CSS scope refers to a style that acts only on a specified element or component, without affecting other elements or components. Here, CSS quarantine is a default built-in quarantine mode in a micro front end such as a micr, and only needs to be referred to.
Step 304, the sub-application is brought on-line.
In this embodiment, the execution body may bring the sub-application on line.
After the whole main application and the sub application are constructed, the sub application can be online, the sub application version management is designed, the packaging information of the sub application is uploaded, and further the information such as the version configuration of the output sub application is analyzed.
In step 305, a project file of the sub-application is obtained.
In this embodiment, the execution body may acquire the project file of the sub-application.
And pulling out the product from the agile, decompressing the product, and reading the decompressed sub-application project file content. The product is a front-end static resource after the target service module is constructed, including but not limited to an HTML file, a JS file, a CSS file, and the like.
And 306, analyzing script resource links and cascading style resource links from the project files of the sub-applications, and correspondingly storing the script resource links and the cascading style resource links into a script array and a cascading style array.
In this embodiment, the execution body may analyze the script resource link and the cascading style resource link from the project file of the sub-application, and store the script resource link and the cascading style resource link in the script array and the cascading style array correspondingly.
The JS resource link of the scrmit tag can be analyzed from the HTML file of the sub-application project file content and stored in the scrmit array. Similarly, CSS resource links can be analyzed from link tags of sub-application project file contents and stored in a CSS array.
Step 307, traversing the script array and the cascading style array, analyzing the name, version and resource type of the resource link, and searching the resource content according to the relative path, and storing the resource content in the code field.
In this embodiment, the execution body may traverse the script array and the cascading style array, analyze the name, version and resource type of the resource link, and search the resource content according to the relative path, and store the resource content in the code field.
Traversing the scrmit array, analyzing the name, version (hash value) and resource type of the resource link, finding the JS codes in the JS resource link according to the relative path, and storing the JS codes in the code field. Similarly, the CSS array is traversed, the name, version (hash value) and resource type of the resource link are analyzed, CSS codes in the CSS resource link are found according to the relative path, and the CSS codes are stored in the code field.
In step 308, the entry resources and the dependent resources are determined from the resource content in array insertion order.
In this embodiment, the execution body may determine the entry resource and the dependent resource from the resource content according to the array insertion order.
Typically, when parsing HTML files from top to bottom, the array insertion order is inserted sequentially. According to the array insertion sequence, the first resource can be used as an entry resource, and the rest resources can be used as dependencies.
And 309, returning the resource content according to the definition of the sub-application data model, and storing the resource content in the sub-application version management back end.
In this embodiment, the execution body may return the resource content according to the definition of the sub-application data model, and store the resource content in the sub-application version management back end. The associated sub-application information may then be accessed via the interface.
Wherein the code defined by the sub-application data model is as follows:
in step 310, a document object model content loading event is added.
In this embodiment, the execution body may add a domready event. Where domReady is a generic term for domsetloaded events, which are triggered after the initial HTML document is fully loaded and parsed, without waiting for the full loading of style sheets, images and subframes.
Step 311, the interface of the information of the sub-application is obtained.
In this embodiment, the execution body may acquire the interface of the information of the sub-application. Wherein, adding domready event, after triggering event, the interface for obtaining sub application information can be requested.
In step 312, the information of the sub-application is obtained through the interface of the information of the sub-application and stored in the global.
In this embodiment, the executing body may acquire information of the sub-application through an interface of the information of the sub-application, and store the information to the global.
Step 313, processing the information of the sub-application, recursively processing the dependent resources of the sub-application if the dependent resources exist in the sub-application, and obtaining the static resources of the sub-application and inserting the static resources into the main application if the dependent resources do not exist in the sub-application.
In this embodiment, the execution body may process information of the sub-application, and determine a state of the sub-application. Based on the state of the sub-application, it may be determined whether the sub-application has dependent resources. If the sub-application has dependent resources, recursively processing the dependent resources of the sub-application, and if the sub-application does not have dependent resources, acquiring static resources of the sub-application and inserting the static resources into the main application, thereby realizing the mounting of the sub-application by the main application.
Adding a request in a domready event of a host application may be accomplished by the following pseudocode:
step 314 renders the sub-application such that the sub-application is displayed in the main application.
In this embodiment, the execution body may render the sub-application so that the sub-application is displayed in the main application.
For the rendering of sub-applications, two cases can be distinguished: firstly, for the sub-application (such as side navigation) without intercepting the route, the mounting of the sub-application can be directly called for rendering; secondly, for the sub-application needing to intercept the route, an interface (such as an API related to the micro front terminal application) can be called to render the mount of the sub-application.
As can be seen from fig. 3, the sub-application development method in this embodiment highlights the acquisition step, the creation step, the analysis step, and the mounting step, as compared with the embodiment corresponding to fig. 1. Therefore, the scheme described in the embodiment not only can develop the newly added service module, but also can reform the old service module. JS quarantine and CSS quarantine of child applications can be implemented when the child applications are created. By analyzing version configuration information of the output sub-application, access to relevant sub-application information through the interface can be achieved. By adding the request in the domready event of the main application, the main application mounts the sub-application.
With further reference to FIG. 4, a flow chart for adding a request in a domready event of a host application is shown. As shown in fig. 4, the page is entered and dom resolution is performed. On the one hand, a domready event is added, and based on axios request configuration information, sub-application js and registration sub-application information are loaded. After loading the sub-application js, the sub-application may be notified of the mount. On the other hand, the master application js is loaded. A snoop event is added. After loading the sub-application js and notifying the sub-application mount, a snoop event is added. And finally, executing sub-application mounting based on the monitoring event and the sub-application information.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of a sub-application development apparatus, which corresponds to the method embodiment shown in fig. 1, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the sub-application development apparatus 500 of the present embodiment may include: acquisition module 501, creation module 502, analysis module 503, mounting module 504, and rendering module 505. Wherein, the obtaining module 501 is configured to obtain a target service module; a creation module 502 configured to create a sub-application based on the target business module; an analysis module 503 configured to bring the sub-application online and to analyze version configuration information of the generated sub-application; a mount module 504 configured to mount the sub-application into the main application; the rendering module 505 is configured to render the sub-application so that the sub-application is displayed in the main application.
In the present embodiment, in the sub-application development apparatus 500: specific processes of the obtaining module 501, the creating module 502, the analyzing module 503, the mounting module 504 and the rendering module 505 and technical effects thereof may refer to the relevant descriptions of steps 101-105 in the corresponding embodiment of fig. 1, and are not described herein again.
In some alternative implementations of the present embodiment, the acquisition module 501 is further configured to: acquiring a service module to be modified from a small program developer platform as a target service module; and/or creating a script file according to a preset command to serve as a target service module.
In some alternative implementations of the present embodiment, the creation module 502 is further configured to: putting the target service module as a sub-application into a preset directory; script isolation and cascading style isolation are carried out on the sub-applications, and modification is carried out on the isolated sub-applications, so that the isolated sub-applications are mounted when the main application is called.
In some alternative implementations of the present embodiment, the analysis module 503 is further configured to: acquiring a project file of a sub-application; analyzing script resource links and cascading style resource links from the project files of the sub-applications, and correspondingly storing the script resource links and the cascading style resource links into script arrays and cascading style arrays; traversing the script array and the cascading style array, analyzing the name, version and resource type of the resource link, searching the resource content according to the relative path, and storing the resource content in a code field; determining an entry resource and a dependent resource from the resource content according to the array insertion sequence; and returning the resource content according to the definition of the sub-application data model, and storing the resource content into a sub-application version management back end.
In some alternative implementations of the present embodiment, mounting module 504 is further configured to: adding a document object model content loading event; an interface for acquiring information of the sub-application; acquiring information of the sub-application through an interface of the information of the sub-application, and storing the information of the sub-application to the global; and processing the information of the sub-application, recursively processing the dependent resources of the sub-application if the sub-application has the dependent resources, and acquiring the static resources of the sub-application and inserting the static resources into the main application if the sub-application does not have the dependent resources.
In some optional implementations of the present embodiment, the rendering module 505 is further configured to: calling the mount of the sub-application to render for the sub-application without intercepting the route; and for the sub-application needing to intercept the route, the calling interface renders the mount of the sub-application.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, such as a sub-application development method. For example, in some embodiments, the sub-application development method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the sub-application development method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the sub-application development method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions provided by the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (15)

1. A seed application development method, comprising:
acquiring a target service module;
creating a sub-application based on the target business module;
the sub-application is online, and version configuration information of the sub-application is generated through analysis;
mounting the sub-application into the main application;
rendering the sub-application to enable the sub-application to be displayed in the main application.
2. The method of claim 1, wherein the acquiring the target traffic module comprises:
acquiring a service module to be modified from a small program developer platform as the target service module; and/or
And creating a script file according to a preset command to serve as the target service module.
3. The method of claim 1, wherein the creating a sub-application based on the target business module comprises:
the target service module is used as the sub-application to be placed under a preset directory;
and carrying out script isolation and cascading style isolation on the sub-applications, and modifying the isolated sub-applications so as to mount the isolated sub-applications when the main application is called.
4. The method of claim 1, wherein the analyzing generates version configuration information for the sub-application, comprising:
acquiring a project file of the sub-application;
analyzing script resource links and cascading style resource links from the project files of the sub-application, and correspondingly storing the script resource links and cascading style resource links into a script array and a cascading style array;
traversing the script array and the cascading style array, analyzing the name, version and resource type of the resource link, searching the resource content according to the relative path, and storing the resource content in a code field;
determining an entry resource and a dependent resource from the resource content according to the array insertion sequence;
and returning the resource content according to the definition of the sub-application data model, and storing the resource content to the sub-application version management back end.
5. The method of claim 4, wherein the mounting the sub-application into the main application comprises:
adding a document object model content loading event;
an interface for acquiring information of the sub-application;
acquiring information of the sub-application through an interface of the information of the sub-application, and storing the information of the sub-application to the global;
and processing the information of the sub-application, recursively processing the dependent resources of the sub-application if the dependent resources exist in the sub-application, and acquiring the static resources of the sub-application and inserting the static resources into the main application if the dependent resources do not exist in the sub-application.
6. The method of claim 1, wherein the rendering the sub-application comprises:
for a sub-application without intercepting a route, calling a mount of the sub-application to render;
and for the sub-application needing to intercept the route, calling an interface to render the mount of the sub-application.
7. A seed application development device, comprising:
the acquisition module is configured to acquire the target service module;
a creation module configured to create a sub-application based on the target business module;
an analysis module configured to bring the sub-application online and to analyze version configuration information of the sub-application;
a mount module configured to mount the sub-application into the main application;
and the rendering module is configured to render the sub-application so that the sub-application is displayed in the main application.
8. The apparatus of claim 7, wherein the acquisition module is further configured to:
acquiring a service module to be modified from a small program developer platform as the target service module; and/or
And creating a script file according to a preset command to serve as the target service module.
9. The apparatus of claim 7, wherein the creation module is further configured to:
the target service module is used as the sub-application to be placed under a preset directory;
and carrying out script isolation and cascading style isolation on the sub-applications, and modifying the isolated sub-applications so as to mount the isolated sub-applications when the main application is called.
10. The apparatus of claim 7, wherein the analysis module is further configured to:
acquiring a project file of the sub-application;
analyzing script resource links and cascading style resource links from the project files of the sub-application, and correspondingly storing the script resource links and cascading style resource links into a script array and a cascading style array;
traversing the script array and the cascading style array, analyzing the name, version and resource type of the resource link, searching the resource content according to the relative path, and storing the resource content in a code field;
determining an entry resource and a dependent resource from the resource content according to the array insertion sequence;
and returning the resource content according to the definition of the sub-application data model, and storing the resource content to the sub-application version management back end.
11. The apparatus of claim 10, wherein the mounting module is further configured to:
adding a document object model content loading event;
an interface for acquiring information of the sub-application;
acquiring information of the sub-application through an interface of the information of the sub-application, and storing the information of the sub-application to the global;
and processing the information of the sub-application, recursively processing the dependent resources of the sub-application if the dependent resources exist in the sub-application, and acquiring the static resources of the sub-application and inserting the static resources into the main application if the dependent resources do not exist in the sub-application.
12. The apparatus of claim 7, wherein the rendering module is further configured to:
for a sub-application without intercepting a route, calling a mount of the sub-application to render;
and for the sub-application needing to intercept the route, calling an interface to render the mount of the sub-application.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
CN202310995135.5A 2023-08-09 2023-08-09 Sub-application development method and device Pending CN116954669A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310995135.5A CN116954669A (en) 2023-08-09 2023-08-09 Sub-application development method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310995135.5A CN116954669A (en) 2023-08-09 2023-08-09 Sub-application development method and device

Publications (1)

Publication Number Publication Date
CN116954669A true CN116954669A (en) 2023-10-27

Family

ID=88447476

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310995135.5A Pending CN116954669A (en) 2023-08-09 2023-08-09 Sub-application development method and device

Country Status (1)

Country Link
CN (1) CN116954669A (en)

Similar Documents

Publication Publication Date Title
US10325012B2 (en) Filtered stylesheets
CN111221521A (en) Method and device for generating log code, computer system and readable storage medium
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
CN105683957A (en) Style sheet speculative preloading
CN111294395A (en) Terminal page transmission method, device, medium and electronic equipment
US10310965B2 (en) Dynamic virtual testing environment for webpages
CN111125057A (en) Service request processing method and device and computer system
CN104915404A (en) Method and device for accessing invalid website
CN113761871A (en) Rich text rendering method and device, electronic equipment and storage medium
CN113778393A (en) Component generation method, device, computer system and computer-readable storage medium
CN115543440A (en) Method for migrating android project to android-like system, electronic equipment and storage medium
CN111158777B (en) Component calling method, device and computer readable storage medium
US9058400B2 (en) HTTP performance enhancement based on delta transfer
CN113449216A (en) File processing method and device and storage medium
CN111191225A (en) Method, device, medium and electronic equipment for switching isolated objects
CN116954669A (en) Sub-application development method and device
CN110599112A (en) Method and device for developing and maintaining network page
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN113392311A (en) Field searching method, field searching device, electronic equipment and storage medium
CN113138767A (en) Code language conversion method, device, electronic equipment and storage medium
CN113515328A (en) Page rendering method and device, electronic equipment and storage medium
CN111241538B (en) Method, device, medium and electronic equipment for protecting node object variable
CN113642295B (en) Page typesetting method, device and computer program product
US11960560B1 (en) Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof
CN116009863B (en) Front-end page rendering method, device and storage medium

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