This is issue #2 of The Stackless Newsletter.
Praise for packages. In a world without packages, there would be no easy way to include other people’s code in our projects. Without pre-made libraries, we might code everything from scratch (or find code examples and paste them into our projects by hand as programmers did in the 1980s). For the way we code today, we have package repositories and package managers, making it easy for us to use other people’s code.
What a package manager does. Package managers do three things: downloading, file management, and dependency management. Package managers need a “shopping list” of a project’s third-party libraries (in Node, a
package.json; in Ruby, a
Gemfile), with information about the source for packages (a registry like npmjs.com or rubygems.org). After downloading, the package manager unpacks and saves the files in an organized way. Finally (and this is the hard part), a package manager installs the correct version of each dependency that is needed for any package.
import statement, which made it possible to load packages using a URL. With URLs, the browser can load third-party code from module CDNs such as JSPM or Skypack, without Node and NPM.
Why does it matter? If package management becomes part of a language’s standard features, aftermarket parts aren’t needed. The language is easier to use and there are fewer moving parts to maintain.
Version pinning. There’s just one problem using module CDNs to load third-party packages. Right now, the only way to control which version you request is to specify the version number in the URL. That’s inconvenient. Changing versions requires search-and-replace in every file that uses the package. That’s a problem that import maps will solve.
Please hit reply and email me if you have questions, suggestions, or objections. I want to hear from you!
Best wishes from Bali,
Web links of the week
How Web Components Are Used at GitHub and Salesforce
Richard MacManus followed up his article on Web Frameworks: Why You Don’t Always Need Them by talking to engineers about web components at GitHub and Salesforce.
The Future of Web Software Is HTML-over-WebSocket