上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 499 下一页
摘要: 开发中的那些规范 为什么需要规范 现在开发一个应用基本上都是多人协作,一旦涉及到多人,必然不同的开发者的开发习惯、编码方式都是有所不同的,如果没有一个统一的规范,就会造成非常多的问题: 代码风格不一 目录杂乱无章 接口不统一(偏后端),例如: 修改用户定的接口为 /v1/users 修改密钥的接口: 阅读全文
posted @ 2025-05-08 13:42 Zhentiw 阅读(103) 评论(0) 推荐(0)
摘要: Sometime the element width is dynmiac, and you want to use the width in css, how to do that 1. Define css variable in css file, --wis the container's 阅读全文
posted @ 2025-05-06 14:17 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: By default, git ignorecase for filename. It might happen that you change the filename from Modal.vueto modal.vue, then commit to git, in remote repo, 阅读全文
posted @ 2025-05-06 14:10 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: type Watcher<T> = { on<K extends keyof T & string>( eventName: `${K}Changed`, callback: (oldValue: T[K], newValue: T[K]) => void ): void; }; declare f 阅读全文
posted @ 2025-05-06 14:06 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要: const get = /*#__PURE__*/ createGetter(); const readonlyGet = /*#__PURE__*/ createGetter(true); const shallowGet = /*#__PURE__*/ createGetter(false, t 阅读全文
posted @ 2025-04-08 00:55 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: const obj = { a: 1, b: 2, c: { d: 3 } } console.log(obj.toString()) // [object Object] Using Symbol.toStringTag const obj = { a: 1, b: 2, c: { d: 3 }, 阅读全文
posted @ 2025-04-08 00:27 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: Using T extends any ? {...} : never helps to see the type result Example: type DeepReadonly<T extends Record<string, any>> = T extends any ? { readonl 阅读全文
posted @ 2025-04-05 19:47 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: 框架设计的权衡 框架设计里面到处体现了权衡的艺术。 在框架设计之初,我们的最初的构想往往是“既要....又要....”,但是往往现实是非常残酷的, 因此我们需要处处作出权衡。 框架的设计应该将其设计为命令式还是声明式 ? 框架需要设计成纯运行时还是纯编译时,还是设计为运行时 + 编译时 ? 这里只是 阅读全文
posted @ 2025-04-05 19:11 Zhentiw 阅读(33) 评论(0) 推荐(0)
摘要: 本文将带着大家使用 Node.js 快速制作一个 cli 工具,主要包含以下内容: 搭建 cli 整体框架 完善 cli 命令 搭建 cli 整体框架 首先,在桌面上新建一个 cli 工程目录 mycli,npm init -y 进行初始化,如下: cd desktop mkdir mycli cd 阅读全文
posted @ 2025-04-05 19:10 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要: 生成 JavaScript AST 我们要对整个模板的 AST 进行转换,转换为 JS AST。 我们目前的代码已经有了遍历模板 AST,并且针对不同的节点,做不同操作的能力。 我们首先需要知道 JS AST 长什么样子: function render(){ return null; } 上面的代 阅读全文
posted @ 2025-03-30 22:12 Zhentiw 阅读(31) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 499 下一页