nitro icon indicating copy to clipboard operation
nitro copied to clipboard

feat(azure-functions): support azure functions v4

Open supersoniko opened this issue 1 year ago β€’ 9 comments

πŸ”—Linked issues

❓Type of change

  • [ ] πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [ ] πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • [x] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I upgraded the @azure/functions package to the latest version, and added the configuration to support the new programming model of Azure functions V4: https://learn.microsoft.com/en-us/azure/azure-functions/functions-node-upgrade-v4?tabs=v4&pivots=programming-language-javascript

I implemented it with the date compatibility system, so it can be adopted progressively.

πŸ“ Checklist

  • [x] I have linked an issue or discussion.
  • [x] I have updated the documentation accordingly.

supersoniko avatar May 29 '24 19:05 supersoniko

I Still have to do some manual checks for this one + docs

supersoniko avatar May 29 '24 19:05 supersoniko

Manually verified the workings of the V4 handler by using a local build of this nitro fork and deploying a Solid Start app to Azure Functions.

Will verify the legacy azure-function runtime next.

supersoniko avatar May 29 '24 19:05 supersoniko

Manually verified that the legacy V3 handler still works and is still the default. Will do the docs update tomorrow and verify the working of cookies.

supersoniko avatar May 29 '24 20:05 supersoniko

verified cookies work on 4.x runtime (with Solid Start app) + updated docs

supersoniko avatar May 31 '24 08:05 supersoniko

Azure Static Web Apps can use @azure/functions v4 programing model nowadays, so azure(Azure Static Web Apps) preset also needs update.

nogic1008 avatar Jun 27 '24 00:06 nogic1008

Will update the Azure Static Web Apps preset next week too in this PR. I've been running this preset code in production for an enterprise application for a little while now with success πŸ‘

supersoniko avatar Jun 27 '24 07:06 supersoniko

Hi @supersoniko, I'm currently reseraching on how to build a preset of a v4 function to a static web app with streaming support.

Can I somehow support you with building the preset or help testing it?

I'm also wondering how does this PR correlate to #2477?

From my point of view it may make sense to keep the azure and azure-function templates and add some config parameter for them, which calls app.setup({ enableHttpStream: true }); if set to true.

I'm not sure if creating two new templates azure-functions-streaming and azure-streaming may make things harder to maintain. But that's just a gut feeling, as I'm kind of new to nitro yet.

sibbl avatar Jul 18 '24 07:07 sibbl

Hi @supersoniko, I'm currently reseraching on how to build a preset of a v4 function to a static web app with streaming support.

Can I somehow support you with building the preset or help testing it?

I'm also wondering how does this PR correlate to #2477?

From my point of view it may make sense to keep the azure and azure-function templates and add some config parameter for them, which calls app.setup({ enableHttpStream: true }); if set to true.

I'm not sure if creating two new templates azure-functions-streaming and azure-streaming may make things harder to maintain. But that's just a gut feeling, as I'm kind of new to nitro yet.

Hey sorry for the late response; I have been working weekends because of deadlines my company has and haven't had time to look back to this PR.

It would be great to get some support on these Azure presets! I agree that a separate separate streaming preset would not make much sense, especially maintenance wise, like you said.

I haven't looked at Nitro in a while, but iirc there's another preset that has some kind of configuration that you can give with it.

If I have some time this weekend πŸ™, I will look into the possibility of configuration options this weekend and report back here.

supersoniko avatar Jul 19 '24 08:07 supersoniko

Any updates?

nogic1008 avatar Sep 06 '24 22:09 nogic1008