You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few updates. First this wiki has background and instructions for trying out the new model: https://aka.ms/AzFuncNodeV4
Now here is a tiny spec on how I see these features working:
Create project
Here are the key differences from old projects:
The @azure/functions package needs to be in the dependencies section of package.json (not devDependencies) and reference ^4.0.0-alpha.2 as the version
The "main" field needs to be set in package.json. There's a lot of options for this, but I propose dist/src/functions/*.js for TypeScript and src/functions/*.js for JavaScript. That will allow us to create a new file for each function which simplifies some of the tooling logic and IMO is a more realistic folder structure for an app than say putting everything in one file. Open to suggestions on this
@types/node should reference v18
In host.json the bundle should be "version": "[3.15.0, 4.0.0)"
Create function
I have a first draft of templates here based on this branch. The new templates are suffixed with "-4.x" in the id. Unlike Python, this is essentially the 4th version of our programming model - it just happens that the first 3 didn't have any major changes that would've affected tooling templates. Just like Python, I think this needs to be hard-coded into the extension for now because it may take us time to decide on an official new schema for these models.
The existing wizard should remain the exact same. However, the result will be different
The function name should be used to replace the %functionName% string in both the file name and file contents
The binding parameters (for example "connection" or "queueName") should replace the relevant string (%connection% or %queueName%) in the file contents
The file should be put in the src/functions folder. This assumes a project setup like above. I think this is fine for public preview, but we could try and parse the users "package.json" "main" field if we want this to be smarter
One last note, I added a "triggerType" property to the metadata for each template because you no longer have a function.json and you need to know the trigger type when getting the user prompted settings here.
Related to Azure/azure-functions-nodejs-worker#480
We will basically want the same functionality as the new Python programming model work Phil is doing in #3235
Quick summary:
The text was updated successfully, but these errors were encountered: