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
Expose a core api from the worker so that apps and npm packages can contribute programming model features (e.g. registering hooks & functions) #567
Establish a new pattern of shipping the programming model in an npm package instead of directly in Azure. We plan to ship both the old and new programming models in this manner. #568
However, we still use app.generic helper function to register any supported triggers and bindings, as shown in example below:
import{app,InvocationContext,trigger}from'@azure/functions';// 4.0.0-alpha.8app.generic('myEventGrid',{trigger: trigger.generic({type: 'eventGrid'}),handler: async(request: unknown,context: InvocationContext)=>{context.log('function name is ',context.functionName)}});
All helper functions will call app.generic function:
generic function will call Azure function runtime API directly via coreApi.registerFunction instead of using function.json provided in the root path, this allow us to create more fluent APIs around the v4 model.
exportfunctiongeneric(name: string,options: FunctionOptions): void{//...constcoreApi=tryGetCoreApiLazy();if(!coreApi){console.warn(`WARNING: Skipping call to register function "${name}" because the "@azure/functions" package is in test mode.`);}else{coreApi.registerFunction({ name, bindings },<FunctionCallback>options.handler);}}
The text was updated successfully, but these errors were encountered:
After I've made successfully proof of concept for #82, I've pretty clear to setup direction of interface style next release for Azure Function Node.js V4.
Next Actions:
All decorators proof of concept will be archived for future use (Backup branch)
Make sure that only @nammatham/core is still remain and ready for publish NPM registry.
For v2 release, will use functional approaches for provide type-safe APIs, you can see the full explanation in the #82, however, integrating with Dependency Injection Tools and container is quite usefully, for user migrating from v1, which is use inversify as backbone IoC tools,
In order to make sure v2 will works with Dependency Injection Tools and container will be PoC and implemented as external packages (In my PoC) for anyone can use, not strict to Nammatham library.
In Azure Functions Node.js v4: https://aka.ms/AzFuncNodeV4, they estimates public preview for March 2023 and general availability for July 2023.
Ref
Catch up Breaking Changes
Discussion
function.json
and a lot changesapp.generic
helper function to register any supported triggers and bindings, as shown in example below:app.generic
function:generic
function will call Azure function runtime API directly viacoreApi.registerFunction
instead of usingfunction.json
provided in the root path, this allow us to create more fluent APIs around the v4 model.The text was updated successfully, but these errors were encountered: