Supercharge Your Innovation With Domain-Expert AI Agents!

Method for constructing front-end code based on native ES module

A module construction and code technology, applied in the computer field, can solve problems such as slowness and affect the development efficiency of developers, and achieve the effect of accelerating reloading

Pending Publication Date: 2022-05-27
TIANYI ELECTRONICS COMMERCE
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In such a cycle, slow feedback can greatly affect developer productivity

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
  • Method for constructing front-end code based on native ES module
  • Method for constructing front-end code based on native ES module
  • Method for constructing front-end code based on native ES module

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0027] like Figure 1-4 , the present invention provides a method for constructing front-end code based on native ES module, comprising the following steps:

[0028] (1) The modules in the application are divided into two categories: dependencies and source codes, which improves the startup time of the development server;

[0029] Dependencies are mostly pure JavaScript that will not change during development; some larger dependencies (such as a component library with hundreds of modules) are also expensive to process; dependencies usually exist in multiple modular formats (such as ESM or CommonJS);

[0030] (2) Use pre-build dependencies; pre-builds can be 10-100 times faster than bundler pre-build dependencies written in JavaScript;

[0031] The source code usually contains some files that are not directly JavaScript, need to be transformed (such as JSX, CSS or Vue / Svelte components), and are often edited; at the same time, not all source code needs to be loaded at the sam...

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 method for constructing a front-end code based on a native ES module, and the method comprises the following steps: (1) dividing a module region in an application into a dependency type and a source code type, and improving the starting time of a development server; the dependence is mostly pure JavaScript which is not changed during development; the processing cost of some larger dependence (such as a component library with hundreds of modules) is also very high; the dependency also usually has a plurality of modular formats (such as ESM or CommonJS); (2) using pre-construction dependence; and the pre-construction dependency is 10 to 100 times faster than that of a packer written by JavaScript. The method for developing the starting time of the server is improved; providing a source code in a native ESM mode; developing a method for quickly updating the source code of the server; the browser cache is used for accelerating reloading of the page; the dependency is pre-constructed.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a method for constructing front-end code based on native ES modules. Background technique [0002] Before browsers support ES modules, you need to use front-end build (packaging) tools to process source code modules to generate one or more bundles (packaging modules). Because JavaScript does not provide a native mechanism for developers to develop in a modular way; now mainstream construction (packaging) tools, such as webpack, Rollup, Parcel, etc., have greatly improved the front-end development experience. [0003] However, as we started building larger and larger applications, the amount of JavaScript code that needed to be processed grew exponentially. Large projects with thousands of modules are common. We started hitting performance bottlenecks - tools developed in JavaScript often took a long time, even minutes, to start the development server. Even with HMR (...

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
IPC IPC(8): G06F8/30G06F8/38G06F8/41G06F8/656G06F16/957G06F9/455
CPCG06F8/315G06F8/38G06F8/433G06F8/656G06F16/9574G06F9/45529
Inventor 童长胜丁丹丹鲁嘉睿
Owner TIANYI ELECTRONICS COMMERCE
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More