JavaScript Framework Design (2nd Edition) cover

JavaScript Framework Design (2nd Edition)

Rating 4.0
Word count
272K words
Chapters
131
ISBN
9787115464293

Tags

Summary

This book provides a comprehensive explanation of JavaScript framework design and related knowledge. Its main contents include seed modules, language modules, browser sniffing and feature detection, class factories, selector engines, node modules, data caching modules, style modules, attribute modules, event systems for desktop and mobile, jQuery's event system, asynchronous models, data interaction modules, animation engines, MVVM, front-end templates (static templates), MVVM dynamic templates, performance walls and complexity walls, components, component solutions in the jQuery era, avalon2's component solution, React's component solution, and more. This book is suitable for front-end designers, JavaScript developers, mobile UI designers, programmers, and project managers, and can also be used as a study book for related majors and as a textbook for training schools.

Editor's review

JavaScript Framework Design (2nd Edition) is a comprehensive upgrade by Situ Zhengmei over his previous work, holding a steady Douban rating of around 8.5, which objectively reflects its reputation within the professional developer community. The book's greatest value lies in its贯穿 of "design thinking"—it is not a framework user manual but a deep analysis of the design philosophy and core implementation of mainstream frameworks such as jQuery, Vue, and React. The author, Situ Zhengmei, an early evangelist and practitioner in China's front-end field, distills more than a decade of framework source-code study and development experience into the manuscript, and the writing conveys an insight akin to "a cook carving an ox."

The book dismantles and reconstructs core concepts such as the virtual DOM, reactive systems, componentization, and routing at the level of principle, guiding readers to transform from "users" into "designers." This shift in perspective is crucial: it cultivates the abstract ability and architectural thinking needed to build the底层 of complex systems rather than停留在 API call level. The new edition keeps pace with technological evolution, adding discussion of modern front-end engineering systems, TypeScript integration, and cross-platform framework design, ensuring that this classic work remains highly timely and referential today.

For readers who aspire to go deep into the heart of front-end technology, hope to build their own tool libraries, or wish to understand the essence of technology, this book offers a solid path from understanding to creation. Its content is dense and its logic rigorous; reading requires some prior knowledge, but the reward is systematic cognitive improvement.

Who it's for

A good fit for

  • Mid-to-senior developers who want a deep understanding of how modern front-end frameworks such as Vue and React work under the hood
  • Technical architects who intend to design or build their own front-end tool libraries and components
  • Learners who want to build a systematic front-end knowledge base and progress from “knowing how to use” to “understanding the principles”
  • Students in computer-related majors who want to deepen their understanding of the JavaScript language and engineering practice

Not a good fit for

  • Absolute beginners who only want to quickly get started with a specific framework and look for hands-on project guides
  • Readers who are not yet familiar with basic JavaScript syntax and lack practical coding experience

Reading tips

  1. Readers are advised to start after gaining ES6+ syntax and basic experience with at least one mainstream framework (Vue/React)
  2. While reading, try implementing simplified versions of core modules (such as the observer pattern and virtual DOM diff) based on the book’s ideas to deepen understanding
  3. The book can serve as a “dictionary of principles” for targeted reference when encountering framework black-box issues during development

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. 版权信息
  2. 内容提要
  3. 前言
  4. InfoQ访谈
  5. 第1章 种子模块
  6. 1.1 模块化
  7. 1.2 功能介绍
  8. 1.3 对象扩展
  9. 1.4 数组化
  10. 1.5 类型的判定
  11. 1.6 domReady
  12. 1.7 无冲突处理
  13. 1.8 总结
  14. 第2章 语言模块
  15. 2.1 字符串的扩展与修复
  16. 2.2 数组的扩展与修复
  17. 2.3 数值的扩展与修复
  18. 2.4 函数的扩展与修复
  19. 2.5 日期的扩展与修复
  20. 第3章 浏览器嗅探与特征侦测
  21. 3.1 浏览器判定
  22. 3.2 document.all趣闻
  23. 3.3 事件的支持侦测
  24. 3.4 样式的支持侦测
  25. 3.5 jQuery一些常用特征的含义
  26. 第4章 类工厂
  27. 4.1 JavaScript对类的支撑
  28. 4.2 各种类工厂的实现
  29. 4.3 进击的属性描述符
  30. 4.4 真类降临
  31. 第5章 选择器引擎
  32. 5.1 浏览器内置的寻找元素的方法
  33. 5.2 getElementsBySelector
  34. 5.3 选择器引擎涉及的知识点
  35. 5.4 选择器引擎涉及的通用函数
  36. 5.5 Sizzle引擎
  37. 5.6 总结
  38. 第6章 节点模块
  39. 6.1 节点的创建
  40. 6.2 节点的插入
  41. 6.3 节点的复制
  42. 6.4 节点的移除
  43. 6.5 节点的移除回调实现
  44. 6.6 innerHTML、innerText、outerHTML、outerText的兼容处理
  45. 6.7 模板容器元素
  46. 6.8 iframe元素
  47. 6.9 总结
  48. 第7章 数据缓存模块
  49. 7.1 jQuery的第1代缓存系统
  50. 7.2 jQuery的第2代缓存系统
  51. 7.3 jQuery的第3代缓存系统
  52. 7.4 有容量限制的缓存系统
  53. 7.5 本地存储系统
  54. 7.6 总结
  55. 第8章 样式模块
  56. 8.1 主体架构
  57. 8.2 样式名的修正
  58. 8.3 个别样式的特殊处理
  59. 8.4 元素的滚动条的坐标
  60. 8.5 总结
  61. 第9章 属性模块
  62. 9.1 元素节点的属性
  63. 9.2 如何区分固有属性与自定义属性
  64. 9.3 如何判定浏览器是否区分固有属性与自定义属性
  65. 9.4 IE的属性系统的3次演变
  66. 9.5 className的操作
  67. 9.6 Prototype.js的属性系统
  68. 9.7 jQuery的属性系统
  69. 9.8 avalon的属性系统
  70. 9.9 value的操作
  71. 9.10 总结
  72. 第10章 PC端的事件系统
  73. 第10章 PC端的事件系统
  74. 10.1 原生API简介
  75. 10.2 onXXX绑定方式的缺陷
  76. 10.3 attachEvent的缺陷
  77. 10.4 addEventListener的缺陷
  78. 10.5 handleEvent与EventListenerOptions
  79. 10.6 Dean Edward“大神”的addEvent.js源码分析
  80. 10.7 jQuery的事件系统
  81. 10.8 avalon2的事件系统
  82. 10.9 总结
  83. 第11章 移动端的事件系统
  84. 11.1 touch系事件
  85. 11.2 gesture系事件
  86. 11.3 tap系事件
  87. 11.4 press系事件
  88. 11.5 swipe系事件
  89. 11.6 pinch系事件
  90. 11.7 拖放系事件
  91. 11.8 rotate系事件
  92. 11.9 总结
  93. 第12章 异步模型
  94. 12.1 setTimeout与setInterval
  95. 12.2 Promise诞生前的世界
  96. 12.3 JSDeferred里程碑
  97. 12.4 jQuery Deferred宣教者
  98. 12.5 es6 Promise第一个标准模型
  99. 12.6 es6生成器过渡者
  100. 12.7 es7 async/await终极方案
  101. 12.8 总结
  102. 第13章 数据交互模块
  103. 13.1 Ajax概览
  104. 13.2 优雅地取得XMLHttpRequest对象
  105. 13.3 XMLHttpRequest对象的事件绑定与状态维护
  106. 13.4 发送请求与数据
  107. 13.5 接收数据
  108. 13.6 上传文件
  109. 13.7 jQuery.ajax
  110. 13.8 fetch,下一代Ajax
  111. 第14章 动画引擎
  112. 14.1 动画的原理
  113. 14.2 缓动公式
  114. 14.3 jQuery.animate
  115. 14.4 mass Framework基于JavaScript的动画引擎
  116. 14.5 requestAnimationFrame
  117. 14.6 CSS3 transition
  118. 14.7 CSS3 animation
  119. 14.8 mass Framework基于CSS的动画引擎
  120. 第15章 MVVM
  121. 15.1 前端模板(静态模板)
  122. 15.2 MVVM的动态模板
  123. 15.3 ViewModel
  124. 15.4 React与虚拟DOM
  125. 15.5 性能墙与复杂墙
  126. 第16章 组件
  127. 16.1 jQuery时代的组件方案
  128. 16.2 avalon2的组件方案
  129. 16.3 React的组件方案
  130. 16.4 前端路由
  131. 彩蛋

FAQ

How does this book differ from classics like Professional JavaScript for Web Developers?
Books such as Professional JavaScript for Web Developers focus on language features, APIs, and basic usage, and serve as the cornerstone of a front-end knowledge base. This book assumes readers already have that foundation and focuses on the design philosophy, architectural patterns, and implementation techniques of frameworks—the superstructure—as an advanced step toward deeper principles and engineering thinking.
Which version of JavaScript are the code examples based on?
The book mainly uses modern JavaScript (ES6+) syntax for explanations and examples, which also reflects mainstream front-end practice today. For parts involving underlying principles, it also traces back to more basic implementations to aid understanding of how they evolved.
Does this book help with learning Vue 3 or React 18?
It helps fundamentally. Although specific APIs may evolve, core framework design ideas (such as reactivity, componentization, and virtual DOM) persist. The book analyzes precisely these enduring core principles. Once you understand them, learning any new version or framework becomes faster at grasping its essence and innovations.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

司徒正美 Author

Situ Zhengmei is a technical author in the field of front-end development in China. Publicly available information about the author is limited, and the best-known representative work is JavaScript Framework Design (2nd Edition). This book falls under programming design and focuses on the design ideas and implementation methods of JavaScript frameworks, targeting learners and developers who want to understand the underlying mechanisms of front-end frameworks in depth. In terms of subject matter, the author attends to abstraction and engineering practice at the framework level rather than listing scattered syntax tips, and the writing tends to move from design principles to code implementation, helping readers build an overall understanding of framework structure. Because only one work by this author is included in the collection, details such as biography and professional experience cannot be verified; readers may turn to the book itself to learn about the author's technical grounding and expressive style in JavaScript framework design.

Top rated in the same category