Skip to content

Use minimal APIs for F# project templates #35833

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

Merged
merged 13 commits into from
Sep 17, 2021

Conversation

vzarytovskii
Copy link
Member

@vzarytovskii vzarytovskii commented Aug 27, 2021

Use minimal hosting APIs for F# project templates
Change existing project templates to use minimal hosting APIs for F# projects.

PR Description
Changing WebApi-FSharp and StarterWeb-FSharp to use minimal APIs

Fixes #34123

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Aug 27, 2021
@davidfowl
Copy link
Member

This is missing the call to AddControllers

@timheuer
Copy link
Member

If we really want to match, we could add the Swagger/OpenAPI aspects as well

@davidfowl
Copy link
Member

It occurs to me we deleted startup but we should have copied the code from startup to here.

@timheuer
Copy link
Member

If we really want to match, we could add the Swagger/OpenAPI aspects as well

Scratch this...more changes than needed right now -- we should consider adding this later (net7)

@vzarytovskii
Copy link
Member Author

It occurs to me we deleted startup but we should have copied the code from startup to here.

@davidfowl

That was my intention, I probably missed some stuff.

Sorry for that, I'm not very familiar with apsnetcore APIs, I've mostly tested that project builds, probably have to do some more extensive testing.

@timheuer
Copy link
Member

Sorry for that, I'm not very familiar with apsnetcore APIs, I've mostly tested that project builds, probably have to do some more extensive testing.

Here's my version of a diff: timheuer@2f64bdd

StarterWeb for F# could change as well -- a few more changes there that would be needed with RazorCompilation

@vzarytovskii
Copy link
Member Author

Here's my version of a diff: timheuer@2f64bdd

Yeah, that's what I intended to have pretty much (without ignores, but nowarn instead, we discussed it internally), and missing the AddControllers().

StarterWeb for F# could change as well -- a few more changes there that would be needed with RazorCompilation

Yeah, gotta do them in this PR as well.

@vzarytovskii vzarytovskii changed the title [WIP] Use minimal APIs for F# project templates Use minimal APIs for F# project templates Sep 1, 2021
@vzarytovskii vzarytovskii reopened this Sep 1, 2021
@vzarytovskii vzarytovskii marked this pull request as ready for review September 6, 2021 12:00
@davidfowl
Copy link
Member

One curve ball, we're adding a -minimal flag to the API template #36068. We might want to do the same here.

@vzarytovskii
Copy link
Member Author

One curve ball, we're adding a -minimal flag to the API template #36068. We might want to do the same here.

Shall it be done as part of this PR, or can I make changes in a separate one?

@timheuer
Copy link
Member

timheuer commented Sep 7, 2021

One curve ball, we're adding a -minimal flag to the API template #36068. We might want to do the same here.

Definite curve ball -- going to add you to a convo @davidfowl this afternoon if you can make it (unrelated to F#)

@davidfowl
Copy link
Member

It can be separate

@vzarytovskii
Copy link
Member Author

vzarytovskii commented Sep 7, 2021

It can be separate

Great, thanks. I will create a follow-up issue for this in F# repo.

Copy link
Contributor

@dsyme dsyme left a comment

Choose a reason for hiding this comment

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

Left some minor nits

@halter73
Copy link
Member

We'll backport this to rc2, right?

@vzarytovskii
Copy link
Member Author

Left some minor nits

Thanks, Don. Resolved. Many are result of copy-pasting C# template :)

@halter73
Copy link
Member

/backport to release/6.0-rc2

@github-actions
Copy link
Contributor

Started backporting to release/6.0-rc2: https://github.com/dotnet/aspnetcore/actions/runs/1246354573

@halter73 halter73 merged commit ba02425 into dotnet:main Sep 17, 2021
@ghost ghost added this to the 7.0-preview1 milestone Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update ASP.NET Core F# project templates to use new minimal hosting APIs in .NET 6
5 participants