• Node series: 2. Modularization


    1、 Write on the front In order to unify the implementation of JavaScript outside the browser, commonjs was born. Commonjs tries to define a set of APIs used by common applications, so as to fill the shortage of JavaScript standard library which is too simple. Commonjs specification includes module, package, system, console, file system, unit […]

  • An alternative to ES6 module


    Module is a new feature of ES6, which is very convenient for large projects to call modular functions.But in the use of found that if only a simple call HTML5 do not use node.js There will be cross domain problems.As an alternative, it can be simply edited lib.js Just encapsulate it instead of using the […]

  • Modularization – commonjs, AMD, CMD, ES6


    1、 Modular understanding 1. What is module The complex program is divided into several modules (files) according to certain rules (specifications) The internal data and implementation of the module are private, but some interfaces (Methods) are exposed to communicate with other external modules 2. The evolution of modularity Global function: encapsulate different functions into different […]

  • The historical process of JavaScript modularization in a brief history of programming time series


    introduction Yesterday, I found an interesting question when I strolled on the Internet(Click here to send)。 Because of this problem, I came up with the idea of writing a series of articles, trying to look at the numerous problems and solutions in the programming world from a historical perspective. At present, the Chinese network is […]

  • How does commonjs increase the volume after packaging?


    Today’s article will introduce what commonjs is and why it causes the volume of our packaged files to increase. Summary of this article: in order to ensure that the packaging tools (such as webpack) can optimize your project code, please avoid using commonjs module in the project, and the whole project should use the module […]

  • Using vuex in Vue element admin


    reference resources: Official document of vuex https://vuex.vuejs.org/zh/   Vuex quick use https://mp.weixin.qq.com/s/OnVcgBQlSLHiR12WXN5nbQ   Modularization require.context https://juejin.im/post/6844903583113019405    Vue element admin tutorial https://juejin.im/post/6844903840626507784#heading-29     In Vue element admin, it has been modularized   For example, to addroutePoint.js src/store/getter.js const getters = { sidebar: (state) => state.app.sidebar, size: (state) => state.app.size, device: (state) => state.app.device, visitedViews: […]

  • Primary selection of front end engineering tools


    In the face of increasingly complex front-end tools, as a new person often feel unable to start. After a search and simple comparison, combined with their own preferences, the paper selects the tools to be learned and used to adapt to the increasingly engineering and professional web front-end development work. Library and framework jQueryDOM operation […]

  • Interview questions: sorting out


    1. Understanding of CSS optimization (e.g. code level) 2. Understanding of ES6 (let const variable / arrow function)/ promise.all Modularization and implementation of concurrent / ES6 node.js Differences in modularity) 3. The principle of jQuery chain call / chain programming 4. Secondary encapsulation of element 5. What kinds of JS inheritance 6. What are the […]

  • The development of front end modularization


    In recent years, web applications have become more complex and huge, and the application scope of Web front-end technology is more extensive. The way of developing web application by directly writing JavaScript, CSS and HTML can’t cope with the development of current web application modularization Modularization refers to the decomposition of a complex system into […]

  • Comparison of front end building tools


    The development of front-end modularization has been described above, but they all have one thing in common:The source code can’t run directly, it must be converted before it can run normally.Build is to do this, convert the source code into executable JavaScript, CSS, HTML code, including the following content: Code conversion File optimization Code segmentation […]

  • Introduction to webpack (1)


    1. What is webpack? Webpack is a module bundler Webpack is a tool to package modularized JavaScript. It will start from the module, identify the modularized leading statements in the source code, recursively find out all the dependencies of the module, and package the module and all its dependencies into a separate module. 2. Install […]

  • Segmentfault technical weekly vol.2-666, ES6


    ECMAScript 6.0, ECMAScript 2015, until we finally decided to call it ES6, it took 15 years from the initial formulation to the final release as an international standard. In June 2015, ES6 was officially released. In the past year, many developers have shared ES6 related content in segmentfault, from exploration to depth, from theory to […]