Skip to content

Commit 6dd4c43

Browse files
authored
Avoid mentioning "node" in importmap.rb template and README (#44)
* Change comment in importmap.rb template to avoid mentioning "node" Given that a major benefit of using the default importmap-rails approach is that you don't need nodejs at all, I think we should avoid using the term "node modules" and instead use "npm packages". This should hopefully avoid confusion/misunderstanding where folks mistakenly think they still need to install node: The CDNs allow them to still leverage the npm ecosystem even if their system doesn't have nodejs nor any local `node_modules` directories. * Change "node module" -> "npm package" in README too
1 parent d61e9f7 commit 6dd4c43

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ It's in `app/javascript/application.js` you setup your application by importing
2929
It makes sense to use logical names that match the package names used by npm, such that if you later want to start transpiling or bundling your code, you won't have to change any module imports.
3030

3131

32-
## Using node modules via JavaScript CDNs
32+
## Using npm packages via JavaScript CDNs
3333

34-
Importmap for Rails is designed to be used with JavaScript CDNs for your node package dependencies. The CDNs provide pre-compiled distribution versions ready to use, and offer a fast, efficient way of serving them.
34+
Importmap for Rails is designed to be used with JavaScript CDNs for your npm package dependencies. The CDNs provide pre-compiled distribution versions ready to use, and offer a fast, efficient way of serving them.
3535

36-
You can use the `./bin/importmap` command that's added as part of the install to pin, unpin, or update node packages in your import map. This command uses an API from [JSPM.org](https://jspm.org) to resolve your package dependencies efficiently, and then add the pins to your `config/importmap.rb` file. It can resolve these dependencies from JSPM itself, but also from other CDNs, like [unpkg.com](https://unpkg.com) and [jsdelivr.com](https://www.jsdelivr.com).
36+
You can use the `./bin/importmap` command that's added as part of the install to pin, unpin, or update npm packages in your import map. This command uses an API from [JSPM.org](https://jspm.org) to resolve your package dependencies efficiently, and then add the pins to your `config/importmap.rb` file. It can resolve these dependencies from JSPM itself, but also from other CDNs, like [unpkg.com](https://unpkg.com) and [jsdelivr.com](https://www.jsdelivr.com).
3737

3838
It works like so:
3939

lib/install/config/importmap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Use direct uploads for Active Storage (remember to import "@rails/activestorage" in your application.js)
22
# pin "@rails/activestorage", to: "activestorage.esm.js"
33

4-
# Use node modules from a JavaScript CDN by running ./bin/importmap
4+
# Use npm packages from a JavaScript CDN by running ./bin/importmap
55

66
pin "application"

0 commit comments

Comments
 (0)