Szymon Łągiewka
41113599af
fix(refactor): prefix built-in node module imports
...
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).
It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises
However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.
[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Wes Todd
e9f9aaeebd
Merge tag '4.19.0' into 5.x
...
4.19.0
2024-03-20 21:14:00 -05:00
Tobias Speicher
490f1a1738
lint: remove deprecated String.prototype.substr
...
closes #4860
2022-03-20 12:34:37 -04:00
Douglas Christopher Wilson
62e12fe710
Merge tag '4.16.2'
2017-10-13 22:27:30 -04:00
Douglas Christopher Wilson
80f1ea9bec
Improve error message when autoloading invalid view engine
...
fixes #3403
2017-09-25 21:11:33 -04:00
Douglas Christopher Wilson
c319fe260a
Merge tag '4.15.4'
2017-08-07 19:33:00 -04:00
Douglas Christopher Wilson
e0066227f7
lint: remove all unused varaibles
2017-08-06 00:19:32 -04:00
Douglas Christopher Wilson
501e24e0a9
Merge tag '4.15.0'
2017-03-01 18:17:04 -05:00
Pravdomil
fefd729037
Add debug message when loading view engine
...
closes #3158
2017-02-20 21:24:34 -05:00
Douglas Christopher Wilson
6343288bef
Make res.render callback is always async, even for sync view engines
...
closes #2668
2015-07-07 01:02:13 -04:00
Douglas Christopher Wilson
a8a8564459
perf: remove argument reassignments in View
2015-06-20 13:06:08 -04:00
Douglas Christopher Wilson
e71014f522
perf: enable strict mode
2015-06-18 23:01:18 -04:00
Douglas Christopher Wilson
95ad276cad
docs: add license comments
2015-06-18 23:00:20 -04:00
Douglas Christopher Wilson
6614352563
Add support for app.set('views', array)
...
closes #2320
2014-10-23 17:28:53 -04:00
Douglas Christopher Wilson
0e5f2f84ea
Use path.resolve in view lookup
2014-10-23 15:55:17 -04:00
agchou
13475977af
some code cleanup
2014-03-25 15:23:04 -07:00
Forbes Lindesay
30919be2a0
Throw a meaningful error when there is no default engine
2013-05-15 12:39:06 +01:00
Thom Seddon
eed0f598a0
Remove some superfluous trailing whitespace
2013-03-01 07:47:30 +00:00
Eric Ferraiuolo
0fdceb3de3
Add full extname support to the "view engine" setting; e.g., ".jade".
...
This allows View to support a `defaultEngine` (a.k.a. an app's
"view engine" setting) which contains a ".", for example:
```
app.engine('.jade', jadeEngine);
app.set('view engine', '.jade');
```
This brings View's handling of template filename extensions to parity
with `app.engine()`.
This allows an app's "view engine" setting to be a full extension name,
including the ".".
2013-01-10 21:41:24 -05:00
Nicholas Kinsey
908f3da3da
path.existsSync is deprecated. It is now called fs.existsSync.
2012-05-05 00:32:53 +10:00
TJ Holowaychuk
d9aea70ccc
removed file heading comments
2012-05-03 08:43:42 -07:00
TJ Holowaychuk
a376980a69
update headers
2012-04-25 21:49:43 -07:00
Pero Pejovic
419731ec41
Unused require of fs module
2012-04-02 15:44:06 -07:00
Tj Holowaychuk
e9d7b6fbad
Changed template engine signature to engine.__express(path, options, fn). Closes #878
2011-11-10 13:42:08 -08:00
Tj Holowaychuk
b9dee730a8
Fixed app.render() absolute path support
2011-11-10 08:22:42 -08:00
Tj Holowaychuk
02f48aabbf
map register function
2011-10-07 15:25:16 -07:00
Tj Holowaychuk
371b381074
more refactoring
2011-10-07 15:04:08 -07:00
Tj Holowaychuk
6d47011dcf
View#contents()
2011-10-07 15:01:36 -07:00
Tj Holowaychuk
705cdb6368
misc refactoring
2011-10-07 15:00:20 -07:00
Tj Holowaychuk
90fc80fd87
docs
2011-10-07 14:59:42 -07:00
Tj Holowaychuk
041974ee01
added index lookup support back
2011-10-07 14:58:58 -07:00
Tj Holowaychuk
7369d861ca
docs
2011-10-07 14:52:26 -07:00
Tj Holowaychuk
e1da383aed
new View
2011-10-07 14:51:06 -07:00
Tj Holowaychuk
cecbaf2efe
removed old view.js
2011-10-07 13:22:55 -07:00
Tj Holowaychuk
7710db4591
re-working view system
2011-10-07 13:07:19 -07:00
Tj Holowaychuk
f977272732
Added support for routes to handle errors. Closes #809
...
currently only the route end-point callbacks
support this, however this will change in the near future
to support route middleware etc
2011-08-17 14:33:23 -07:00
Tj Holowaychuk
509601e617
fixed app.locals precedence
2011-08-08 17:01:07 -07:00
Tj Holowaychuk
986916cf3e
removed old dynamic helper logic from the view system
2011-07-15 10:31:52 -07:00
Tj Holowaychuk
8c56df7322
view system utilizing app.locals
2011-07-15 10:27:53 -07:00
Tj Holowaychuk
9a8b86872d
Replaced res.local[s]() with res.locals function. Closes #757
2011-07-15 10:01:31 -07:00
Tj Holowaychuk
6ebccb0518
Added "charset" option
2011-07-14 12:59:14 -07:00
Tj Holowaychuk
b30efe4e2f
misc refactoring
2011-07-14 12:59:14 -07:00
Tj Holowaychuk
08159211a3
app.dynamicHelpers -> app.dynamicLocals
2011-07-14 12:59:13 -07:00
Tj Holowaychuk
93189ad0b6
Fixed options.filename, exposing to template engines
...
this is useful for performing relative
lookups within the template engine itself,
without manually specifyin the path
2011-07-14 12:53:49 -07:00
Tj Holowaychuk
4b9cc3d698
docs
2011-06-28 11:27:51 -07:00
Tj Holowaychuk
0db7f26ad3
Fixed view layout bug. Closes #720
...
preventing custom relative layouts such as:
views/
users/
user-layout.jade
2011-06-22 13:53:58 -07:00
Tj Holowaychuk
f026218c82
misc view refactoring
2011-05-25 10:10:23 -07:00
Tj Holowaychuk
f05c351762
Fixed view caching, should not be enabled in development
2011-05-20 09:01:05 -07:00
Tj Holowaychuk
72384b0523
misc refactor of res.partial()
2011-05-16 15:29:20 -07:00
Tj Holowaychuk
1b199b7d98
lookup docs
2011-05-16 15:26:12 -07:00