Commit fbc52e5
src: disambiguate terms used to refer to builtins and addons
The term "native module" dates back to some of the oldest code
in the code base. Within the context of Node.js core it usually
refers to modules that are native to Node.js (e.g. fs, http),
but it can cause confusion for people who don't work on this
part of the code base, as "native module" can also refer to
native addons - which is even the case in some of the API
docs and error messages.
This patch tries to make the usage of these terms more consistent.
Now within the context of Node.js core:
- JavaScript scripts that are built-in to Node.js are now referred
to as "built-in(s)". If they are available as modules,
they can also be referred to as "built-in module(s)".
- Dynamically-linked shared objects that are loaded into
the Node.js processes are referred to as "addons".
We will try to avoid using the term "native modules" because it could
be ambiguous.
Changes in this patch:
File names:
- node_native_module.h -> node_builtins.h,
- node_native_module.cc -> node_builtins.cc
C++ binding names:
- `native_module` -> `builtins`
`node::Environment`:
- `native_modules_without_cache` -> `builtins_without_cache`
- `native_modules_with_cache` -> `builtins_with_cache`
- `native_modules_in_snapshot` -> `builtins_in_cache`
- `native_module_require` -> `builtin_module_require`
`node::EnvSerializeInfo`:
- `native_modules` -> `builtins
`node::native_module::NativeModuleLoader`:
- `native_module` namespace -> `builtins` namespace
- `NativeModuleLoader` -> `BuiltinLoader`
- `NativeModuleRecordMap` -> `BuiltinSourceMap`
- `NativeModuleCacheMap` -> `BuiltinCodeCacheMap`
- `ModuleIds` -> `BuiltinIds`
- `ModuleCategories` -> `BuiltinCategories`
- `LoadBuiltinModuleSource` -> `LoadBuiltinSource`
`loader.js`:
- `NativeModule` -> `BuiltinModule` (the `NativeModule` name used in
`process.moduleLoadList` is kept for compatibility)
And other clarifications in the documentation and comments.
PR-URL: #44135
Backport-PR-URL: #45663
Fixes: #44036
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jan Krems <jan.krems@gmail.com>1 parent 953072d commit fbc52e5Copy full SHA for fbc52e5
File tree
Expand file treeCollapse file tree
48 files changed
+297
-295
lines changedOpen diff view settings
Filter options
- .github
- doc
- api
- contributing
- lib
- internal
- bootstrap
- debugger
- main
- modules
- cjs
- esm
- util
- src
- api
- crypto
- test
- addons
- force-context-aware
- symlinked-module
- cctest
- node-api/test_general
- parallel
- tools
- code_cache
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
48 files changed
+297
-295
lines changedOpen diff view settings
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
108 | 108 | |
109 | 109 | |
110 | 110 | |
111 | | - |
| 111 | + |
112 | 112 | |
113 | 113 | |
114 | 114 | |
|
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2003 | 2003 | |
2004 | 2004 | |
2005 | 2005 | |
2006 | | - |
| 2006 | + |
2007 | 2007 | |
2008 | 2008 | |
2009 | 2009 | |
| ||
2751 | 2751 | |
2752 | 2752 | |
2753 | 2753 | |
2754 | | - |
| 2754 | + |
2755 | 2755 | |
2756 | 2756 | |
2757 | 2757 | |
|
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
705 | 705 | |
706 | 706 | |
707 | 707 | |
708 | | - |
709 | | - |
| 708 | + |
| 709 | + |
710 | 710 | |
711 | 711 | |
712 | 712 | |
|
Collapse file
+4-4Lines changed: 4 additions & 4 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
201 | 201 | |
202 | 202 | |
203 | 203 | |
204 | | - |
| 204 | + |
205 | 205 | |
206 | | - |
| 206 | + |
207 | 207 | |
208 | 208 | |
209 | 209 | |
| ||
1381 | 1381 | |
1382 | 1382 | |
1383 | 1383 | |
1384 | | - |
| 1384 | + |
1385 | 1385 | |
1386 | 1386 | |
1387 | 1387 | |
| ||
5745 | 5745 | |
5746 | 5746 | |
5747 | 5747 | |
5748 | | - |
| 5748 | + |
5749 | 5749 | |
5750 | 5750 | |
5751 | 5751 | |
|
Collapse file
doc/contributing/adding-new-napi-api.md
Copy file name to clipboardExpand all lines: doc/contributing/adding-new-napi-api.md+1-1Lines changed: 1 addition & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | | - |
| 3 | + |
4 | 4 | |
5 | 5 | |
6 | 6 | |
|
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | | - |
| 68 | + |
69 | 69 | |
70 | 70 | |
71 | 71 | |
| ||
303 | 303 | |
304 | 304 | |
305 | 305 | |
306 | | - |
| 306 | + |
307 | 307 | |
308 | 308 | |
309 | 309 | |
|
Collapse file
lib/internal/bootstrap/loaders.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js+17-13Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | | - |
| 27 | + |
28 | 28 | |
29 | 29 | |
30 | 30 | |
| ||
180 | 180 | |
181 | 181 | |
182 | 182 | |
183 | | - |
| 183 | + |
184 | 184 | |
185 | | - |
| 185 | + |
186 | 186 | |
187 | 187 | |
188 | 188 | |
| ||
195 | 195 | |
196 | 196 | |
197 | 197 | |
198 | | - |
| 198 | + |
199 | 199 | |
200 | 200 | |
201 | | - |
| 201 | + |
202 | 202 | |
203 | 203 | |
204 | | - |
| 204 | + |
205 | 205 | |
206 | 206 | |
207 | 207 | |
| ||
216 | 216 | |
217 | 217 | |
218 | 218 | |
219 | | - |
| 219 | + |
220 | 220 | |
221 | 221 | |
222 | 222 | |
| ||
232 | 232 | |
233 | 233 | |
234 | 234 | |
235 | | - |
| 235 | + |
236 | 236 | |
237 | 237 | |
238 | 238 | |
| ||
241 | 241 | |
242 | 242 | |
243 | 243 | |
244 | | - |
| 244 | + |
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | | - |
| 248 | + |
249 | 249 | |
250 | 250 | |
251 | 251 | |
| ||
326 | 326 | |
327 | 327 | |
328 | 328 | |
| 329 | + |
| 330 | + |
329 | 331 | |
330 | 332 | |
331 | 333 | |
332 | 334 | |
333 | 335 | |
334 | 336 | |
335 | 337 | |
| 338 | + |
| 339 | + |
336 | 340 | |
337 | 341 | |
338 | 342 | |
| ||
342 | 346 | |
343 | 347 | |
344 | 348 | |
345 | | - |
| 349 | + |
346 | 350 | |
347 | 351 | |
348 | 352 | |
| ||
351 | 355 | |
352 | 356 | |
353 | 357 | |
354 | | - |
| 358 | + |
355 | 359 | |
356 | 360 | |
357 | 361 | |
| ||
361 | 365 | |
362 | 366 | |
363 | 367 | |
364 | | - |
| 368 | + |
365 | 369 | |
366 | 370 | |
367 | 371 | |
|
Collapse file
lib/internal/bootstrap/node.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | | - |
| 37 | + |
38 | 38 | |
39 | 39 | |
40 | 40 | |
| ||
102 | 102 | |
103 | 103 | |
104 | 104 | |
105 | | - |
| 105 | + |
106 | 106 | |
107 | 107 | |
108 | 108 | |
|
Collapse file
lib/internal/bootstrap/pre_execution.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/pre_execution.js+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
290 | 290 | |
291 | 291 | |
292 | 292 | |
293 | | - |
| 293 | + |
294 | 294 | |
295 | 295 | |
296 | 296 | |
| ||
512 | 512 | |
513 | 513 | |
514 | 514 | |
515 | | - |
516 | | - |
| 515 | + |
| 516 | + |
517 | 517 | |
518 | 518 | |
519 | 519 | |
|
Collapse file
lib/internal/debugger/inspect_repl.js
Copy file name to clipboardExpand all lines: lib/internal/debugger/inspect_repl.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
117 | 117 | |
118 | 118 | |
119 | 119 | |
120 | | - |
121 | | - |
| 120 | + |
| 121 | + |
122 | 122 | |
123 | 123 | |
124 | 124 | |
|
0 commit comments