Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend TS interface for route specific options #333

Merged
merged 3 commits into from
Aug 4, 2022
Merged

Extend TS interface for route specific options #333

merged 3 commits into from
Aug 4, 2022

Conversation

weirdf0x
Copy link
Contributor

The change is very minor, it just extends the type definition for a feature implemented in #284 and thus fixes #332

I'm not a TS expert, so I'm happy for any input on this.

One minor point though: I'm not sure about tests. They are kind of broken for TS part right now and I fixed some small things (like mismatch in the engines / templates / extensions), but it is not possible, at least with ejs, to have one server serving both an application with a global template and an application with a route specific template, because these are mutually exclusive.

Another minor thing: in the template for index-with-no-data, there are some values specified, which are not optional for ejs. I can fix this, but I would like to discuss first how the fix should look like (e.g. running two fastify servers on different ports, one with global layout, one with local layout, updating templates accordingly or adding new ones etc.).

Checklist

test/index.test-d.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Terence-art
Copy link

var server;
function call1() {
server = "Sever1";
}
function call2() {
server = "Sever2";
}
server = "Server3"

Could be usefull?

@mcollina mcollina merged commit 6d6de5b into fastify:master Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS definitions missing third parameter for the view function
4 participants