-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: add example-microservices #933
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
Conversation
|
FYI: I split the changes into multiple smaller commits, I hope it will make it easier for you to review them. The first commit adds the code from https://github.com/strongloop/loopback-next-example without any changes, the subsequent commits contains the important changes to review. |
| * Convert to a plain object as DTO | ||
| */ | ||
| toObject(options?: Options): Object { | ||
| toObject(options?: Options): AnyObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change, the result of toObject was considered as an object with no properties. The following code is rejected by the compiler:
modelInstance.toObject().idAfter this change, the result of toObject is considered as object with arbitrary properties, thus the code above passes compiler checks again.
99f04f7 to
c500aaf
Compare
|
@raymondfeng @kjdelisle before you start reviewing the code, I'd like to ask a high-level question: are we sure this example belongs to the monorepo? Raymond mentioned that eventually this microservices-example should leverage gRPC transport, which lives outside of our monorepo right now. More importantly, this example is a mini-monorepo on its own. Wouldn't it better to keep the example as a standalone GitHub project? Using Thoughts? |
|
I don't think this should be a part of the monorepo, or an example we continue to maintain in general. While I do want to see us dogfooding the framework with more advanced use cases, I don't think this one really fits the bill in terms of actually validating the capabilities of LoopBack 4 with respect to the sorts of things I'd want to see:
This comes across as a "best-practice" example; the sort of thing a well-known community member or evangelist would produce to demonstrate the capabilities of LoopBack. If we're looking to demonstrate proper use of this framework in the greater context of making and managing microservices, it should:
|
|
@kjdelisle +1 on what you wrote above. I am closing this pull request. |
Move https://github.com/strongloop/loopback-next-example to our monorepo.
The project was pretty outdated, the codebase needs a lot of further improvements which are out of scope of this pull request.
Here, I made the minimal changes needed to make this new example project "work" in our monorepo, i.e. to pass
npm test.See #836
Checklist
npm testpasses on your machinepackages/cliwere updatedpackages/example-*were updatedList of changes that are out of scope (I'll open a new issue for them once this PR is landed):
Rework services to follow the standard app project layout,
replace ts-node with proper
tsc-based build,add prettier & tslint scripts to individual services packages
Rework services to use model & repository best practices, see http://loopback.io/doc/en/lb4/Implementing-features.html
data
Remove tslint:disable:no-any exceptions
Ensure each service is covered by tests. We don't need high coverage,
but at least the most important scenarios must be covered.
The tests should follow our best practices outlined
in http://loopback.io/doc/en/lb4/Testing-your-application.html