express icon indicating copy to clipboard operation
express copied to clipboard

Auto file extension lookup with multiple view engines

Open boycce opened this issue 6 years ago • 7 comments

When there is no file extension defined, express will now try to use any extension that is registered with an engine. The default extension set by app.set('view engine') is still observed first.

Related issue: #3485

boycce avatar Feb 16 '18 04:02 boycce

This seems like a good addition to me. I would like a few more people opinion before we decide what to do with this for sure. But in general it has my 👍

wesleytodd avatar Feb 16 '18 18:02 wesleytodd

Two other notes on both of your open PR's:

  1. Make them against the 5.x branch, not 5.0.
  2. The formatting should follow standardjs

wesleytodd avatar Feb 16 '18 18:02 wesleytodd

@dougwilson I just went to investigate, and I was sure that the branch was 5.x, but the PR (https://github.com/expressjs/express/pull/2237) is open from 5.0. What is your plan with those? I feel like most of the open PR's are against 5.x, but I could be wrong.

wesleytodd avatar Feb 16 '18 18:02 wesleytodd

So for something destined for the 5.0 alpha the 5.0 branch is right, otherwise 5.x (5.x is the equivalent of master branch for major version 5). But even then, this seems like an enhancement that could do into 4.x, no?

dougwilson avatar Feb 16 '18 19:02 dougwilson

Yeah, this should be able to land in 4 as well. I only noticed this was open against 5.0, so I brought it up.

wesleytodd avatar Feb 16 '18 19:02 wesleytodd

In general as long as the commits are easy to move we can move them to the correct destination upon a merge. Since the view file is identical for 4 and 5 we can always merge to 4 even if the PR is against 5.

dougwilson avatar Feb 16 '18 19:02 dougwilson

Thanks guys, so I'll leave this PR on 5.0. As for the formatting are you referring to the no-semicolon and space before parentheses and opening brace rules? (More notably in the test file, which I have followed the current formatting)

boycce avatar Feb 18 '18 09:02 boycce