EP05 比黑洞更深的是什么 - 关于 JS 的包管理

EP05 比黑洞更深的是什么 - 关于 JS 的包管理
Tags:
technical
web
hacker

本期三位主播围绕 “包管理” 聊了些 js 的包管理历史,版本管理,如何发包等问题。

联系我们: async.talk@gmail.com

主播

  • AnnatarHe: https://annatarhe.com
  • Tinko: https://space.bilibili.com/290664
  • Sleaf: https://twitter.com/Sleaf_

Timeline

  • 00:00 开场简介
  • 01:52 JavaScript 包管理历史
  • 07:48 包管理是用来解决什么问题的
  • 10:47 版本管理
  • 13:50 包管理器的百家争鸣
  • 17:53 .lock 文件即版本号的设计
  • 24:12 how to patch a package
  • 27:00 发个包吧
  • 28:40 package.json 的字段有哪些
  • 37:57 type: module
  • 41:10 npm scripts
  • 45:30 npm link & tag & publish
  • 51:41 总结以及开发一个新包应该有哪些注意事项

勘误

  • Rust 是有不同的构建依赖类型的:https://doc.rust-lang.org/cargo/reference/manifest.html

相关链接

  • AMD: https://github.com/amdjs/amdjs-api/blob/master/AMD.md
  • UMD: https://dontkry.com/posts/code/browserify-and-the-universal-module-definition.html
  • CMD(commonjs): https://nodejs.org/api/modules.html
  • ES Module: https://tc39.es/ecma262/#sec-modules
  • IIFE(自执行函数): https://developer.mozilla.org/en-US/docs/Glossary/IIFE
  • require.js: https://requirejs.org/
  • bower: https://bower.io/
  • tree-shaking(摇树): https://webpack.js.org/guides/tree-shaking/
  • yeoman: https://yeoman.io/
  • yarn: https://yarnpkg.com/
  • pnpm: https://pnpm.io/
  • patch-package: https://github.com/ds300/patch-package
  • io.js: https://github.com/nodejs/iojs.org
  • lerna: https://github.com/lerna/lerna
  • 包管理处理的依赖问题是比较复杂的,没能找到合适的文章,可以先从这里看起: https://en.wikipedia.org/wiki/Dependency_hell

扩展阅读

  • lerna 放弃维护:https://github.com/lerna/lerna/issues/2703#issuecomment-777089520

BGM by Otologic