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

feat(azure-functions): support azure functions v4 #2479

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

supersoniko
Copy link

@supersoniko supersoniko commented May 29, 2024

🔗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)
  • ✨ 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

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

@supersoniko
Copy link
Author

supersoniko commented May 29, 2024

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

@supersoniko
Copy link
Author

supersoniko commented May 29, 2024

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
Copy link
Author

supersoniko commented May 29, 2024

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
Copy link
Author

supersoniko commented May 31, 2024

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

@supersoniko supersoniko marked this pull request as ready for review May 31, 2024 08:53
@supersoniko supersoniko changed the title [wip] feat: support for azure functions runtime v4 in preset azure-functions feat: support for azure functions runtime v4 in preset azure-functions May 31, 2024
@pi0 pi0 changed the title feat: support for azure functions runtime v4 in preset azure-functions feat(azure-functions): support azure functions v4 May 31, 2024
@nogic1008
Copy link

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

@supersoniko
Copy link
Author

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 👍

@sibbl
Copy link

sibbl commented Jul 18, 2024

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.

@supersoniko
Copy link
Author

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.

@nogic1008

This comment was marked as off-topic.

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.

3 participants