feat: initialize openfunction knative and async runtime by webup · Pull Request #4 · OpenFunction/functions-framework-nodejs

@webup

This big initial PR is an important upgrade to current GCP Node.js Function Framework with following task accomplished:

  • Add OpenFunction knative runtime
  • Add OpenFunction async runtime
  • Add e2e tests for knative runtime
  • Add e2e tests for async runtime
  • Add conformance test for knative runtime
  • Add conformance test for async runtime
  • Add sequence diagram for knative runtime
  • Add sequence diagram for async runtime
  • Test runtimes in Kubernetes
  • Update auto-generated API docs
  • Refine README

@webup

benjaminhuo

Choose a reason for hiding this comment

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

Big kudos to this PR, just some comments for some corner cases

@webup

@webup

benjaminhuo

@webup

Is it reasonable to make adjustment like below to be consistent with go functions framework?

send(data: object, output?: string)
or
send(output?: string, data: object) ?

In TS, a required param cannot be placed after an optional param.

@webup

@benjaminhuo

Is it reasonable to make adjustment like below to be consistent with go functions framework?

send(data: object, output?: string) or send(output?: string, data: object) ?

In TS, a required param cannot be placed after an optional param.

If the output is not set, where is the data sent to?

@webup

Is it reasonable to make adjustment like below to be consistent with go functions framework?

send(data: object, output?: string) or send(output?: string, data: object) ?

In TS, a required param cannot be placed after an optional param.

If the output is not set, where is the data sent to?

Will broadcast to all declared outputs In current impl.

@benjaminhuo

The broadcast could be a different method, the send just sends the output to one destination like go implementation maybe?

@webup

The broadcast could be a different method, the send just sends the output to one destination like go implementation maybe?

As we discussed in wechat group, let's move on to roll out 0.4.0 first, then will upgrade the function interfaces to better comply with the Function Framework overall guidelines. :)

@webup webup marked this pull request as ready for review

April 10, 2022 09:49

benjaminhuo

@benjaminhuo

send(data: object, output?: string) seems to be language-specific, there are optional params in nodejs while there isn't in go. We can keep it for now.

benjaminhuo