Skip to content

Refactor invoker.ts functionality into separate files #134

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

Closed
grant opened this issue May 6, 2020 · 1 comment
Closed

Refactor invoker.ts functionality into separate files #134

grant opened this issue May 6, 2020 · 1 comment
Assignees

Comments

@grant
Copy link
Contributor

grant commented May 6, 2020

The invoker.ts file of ~600 lines contains dozens of pieces of logic that are somewhat unrelated:

  • Error handling
  • Serving
  • Routing
  • Eventing
  • Logging

This makes the framework difficult to understand and introduces many "global" variables. It would be much easier to separate some of these functions out into separate files.

@hdp617
Copy link
Contributor

hdp617 commented May 7, 2020

Thanks for bringing this up Grant! I think all the logic to load user's function like getUserFunction can be moved to its own file as well.

hdp617 added a commit that referenced this issue May 12, 2020
* refactor: Move the logic to load user's function to loader.ts

This separates the logic to load user's function and one to start the webserver. Moves the function signature type definition to function.ts. Also, adds more testcases for the function loading logic.

See also: #134

* fix: Add comments to test functions

* fix: Fix loader.ts tests

* fix: Remove unnecessary closure
@grant grant closed this as completed May 12, 2020
@grant grant self-assigned this May 12, 2020
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

No branches or pull requests

2 participants