Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

JavaScript file building method and device

A construction method and file technology, which is applied in the field of JavaScript file construction, can solve problems such as obvious impact, impact on user experience, and reduced operating efficiency of front-end files and back-end files, so as to avoid performance damage and reduce file size.

Active Publication Date: 2017-03-29
ADVANCED NEW TECH CO LTD
View PDF11 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the front-end files obtained by adopting this construction scheme need to execute the module definition operation first, and then execute the module loading operation at runtime, resulting in a lower operating efficiency of the front-end files compared to the back-end files, and the more modules involved in dependencies, The more obvious the effect
In addition, since the introduction of the loader requires adding a lot of auxiliary code, the volume of the front-end file increases, and the user needs to consume more costs (time, network bandwidth, etc.) to download the file, which also affects the user experience.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JavaScript file building method and device
  • JavaScript file building method and device
  • JavaScript file building method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only It is a part of the embodiments of this application, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application shall fall within the protection scope of this application.

[0030] Firstly, briefly explain the method of introducing a loader to construct a front-end file in the prior art. Suppose a developer writes two script files a.js and b.js in the back-end, and the code contents of the files are as follows:

[0031] a.js content:

[0032] var b = require('. / b.js');

[0033] console.log('a'+b);

[0034] b.js content:

[0035] module.exports = 'b';

...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a JavaScript file building method and device. The JavaScript file building method comprises the steps of: acquiring files to be processed; determining a dependence chain of the files to be processed according to dependence keywords in codes of the files to be processed; performing code conversion on each file included in the dependence chain respectively; combining all segments of codes obtained by the conversion according to the sequence of the dependence chain in such a way that the code conversion result of the independent file is located ahead of the code conversion result of the dependent file, thus obtaining built files. By adopting the technical solution, performance damage to the built files with the use of a loader can be avoided, and the volume of the built files can also be effectively reduced.

Description

technical field [0001] The present application relates to the technical field of computer applications, and in particular to a JavaScript file construction method and device. Background technique [0002] JavaScript is a literal scripting language that is currently widely used in web application development. Early JavaScript did not support modular programming. With the increasing complexity of Web application functions, modular programming has become an urgent need, and many solutions that can achieve modular effects in the existing JavaScript environment have also emerged. [0003] If the script file written by the developer on the backend needs to be referenced by the page as a front-end file, then before the page goes online, the corresponding front-end version needs to be built based on the back-end version of the file so that the file can run correctly on the front-end . In the existing modular development scheme, if a backend file depends on other modules, then the ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
Inventor 陈成
Owner ADVANCED NEW TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products