Closed Pavel910 closed 4 years ago
@eahefnawy This is fixing a breaking change, so it is super important to be addressed. @Pavel910 Can I make the following comments:
EDIT: Here is issue for testing https://github.com/serverless/components/issues/511
@barrysteyn throwing there is ok because there is nothing else that can be executed if there is no custom method (read my comment in the review section).
To make this component better overall, the template path should be passed to constructor, and not to methods themselves (then your proposed solution with trying
would work nicely), but then it is a major change that also involves updates to CLI. That's something @eahefnawy must allow us to do :)
To make this component better overall, the template path should be passed to constructor, and not to methods themselves (then your proposed solution with
trying
would work nicely), but then it is a major change that also involves updates to CLI. That's something @eahefnawy must allow us to do :)
It seems like this may be the way to go. However such a big change may need to wait for testing (sorry I am going on about testing, but it seems tough to make any change to a core library without testing).
@barrysteyn Agreed, it would be nice to have at least basic tests in place.
Thanks folks. Testing is absolutely planned. We just didn't 100% settle on the API yet and currently taking feedback. PR like these are exactly the feedback that we need.
LG2M 😊
@eahefnawy this PR contains a small fix that was breaking the programmatic invocation of custom methods on the
@serverless/template
component. CLI usage however was working normally.I also added a README file with some examples as I see a lot of people struggling with programmatic usage of this component.
This has been tested manually for both CLI and programmatic usage, all the cases I could think of.