Ten Things I Regret About Node.js - Ryan Dahl - JSConf EU

Table of Contents

1. 10 Things I Regret About Node.js - Ryan Dahl - JSConf EU

1.1. 0:57

Heavily focused on event driven HTTP servers Server-side JS required an event loop to succeed, but it wasn’t obvious

1.2. 4:55

Bad design choices, it could have been much nicer

1.3. 5:12

  1. Didn’t stick with Promises, async/await since it meant a lot of changes

1.4. 5:40

  1. Security Security is delegated to V8, and by default all has access to computer and network (e.g. your linter has)

1.5. 7:06

  1. The Build System (GYP) The biggest regret V8 started using GYP dropped it for GN, Node is the only user of GYP Should have been a Foreign Function Interface (FFI)

1.6. 9:50

  1. package.json
  2. require() to load files, included npm in node, which contributed to centralization and introduced the concept of a module as a directory of files (not a strictly necessary abstraction)
  3. unnecessary noise (License, Repository, Description)

1.7. 12:23

  1. node_modules One folder per project means a “virtualenv” cannot be used across many projects

1.8. 13:59

  1. require(“module”) without extension “.js” Less explicit, different from how browser works .js, .min.js, .ts, … → different files

1.9. 14:40

  1. index.js thought it was cute unnecessary after package.json

1.10. 15:19

Problems with node are almost entirely around how it manages user code
Focused on I/O early on, module was an afterthought

1.11. 16:01

Deno, a secure TypeScript runtime on V8

  • Secure by default
  • Scripts run without any network/fs access
  • Users can opt in access via flags
  • All systems call are done throught message passing, instead of multiple entrypoints, only two native functions, send and recv

Author: Julian Lopez Carballal

Created: 2024-10-21 Mon 08:30