loopbackio / loopback-next

LoopBack makes it easy to build modern API applications that require complex integrations.
https://loopback.io
Other
4.95k stars 1.07k forks source link

[EPIC] How to migrate LB3 clients #3954

Closed bajtos closed 3 years ago

bajtos commented 5 years ago

This is a follow-up for #3718 and #3922.

Write content for docs/site/migration/clients.md and explain how to migrate LB3 clients using loopback-specific SDKs to LB4.

List of known LB3 SDKs:

joschne commented 4 years ago

I would like to bring an idea into the field: OpenApiTools/openapi-generator might help with this.

Because I need a substitute for loopback-sdk-builder I gave it a try.

In this approach the OpenApiSpecs (explorer/openapi.json) generated by LoopBack 4 figures as a middleman between LoopBack and the generator of SDKs. In consequence we could relay on code maintained by a wider community, supporting more than 50 languages/frameworks, independent from LoopBack but compatible with LoopBack thanks to the OpenAPI Spec standard.

I have no experience with this approach but I think it's worth a consideration...

Edit Another example using this approach based on @loopback/example-todo-list.

bajtos commented 4 years ago

@joschne thank you for joining the discussion! It has been our intention for a long time to abandon LoopBack-specific client SDKs and rely on Swagger/OpenAPI client code generation instead. As you said:

we could relay on code maintained by a wider community, supporting more than 50 languages/frameworks, independent from LoopBack but compatible with LoopBack thanks to the OpenAPI Spec standard.

Do you happen to know what's the relation between swagger-codegen and openapi-generator and how they differ from each other?

BTW if you are using Angular, you may want to also try https://github.com/cyclosproject/ng-openapi-gen

Because I need a substitute for loopback-sdk-builder I gave it a try.

This is awesome! Would you like to contribute the instructions described in https://github.com/joschne/loopback-4-ngx-build-sdk to the official LoopBack documentation?

I think there are two pieces of content that will be useful to LoopBack users:

  1. How to talk to a LB4 application from Angular - describe how to generate the client using a codegen tool.
  2. How to migrate an Angular client from loopback-sdk-builder to the solution described in the step 1 above.
joschne commented 4 years ago

@bajtos I'm happy to hear you like the suggested approach.

I had to pause the migration from lb3 to lb4. Thus, our software is still running on lb3. Chances are high, that in the run of this year we can continue our work on the migration to lb4. If / when we do so, I'm willing to actively contribute to the official LoopBack documentation. Before that my hands are tied.

Do you happen to know what's the relation between swagger-codegen and openapi-generator and how they differ from each other?

I have no insider information. My decision for openapi-generator is not based on solid ground, but, back in October, it was influenced by:

BTW if you are using Angular, you may want to also try https://github.com/cyclosproject/ng-openapi-gen

Thank you!

This is awesome! Would you like to contribute the instructions described in https://github.com/joschne/loopback-4-ngx-build-sdk to the official LoopBack documentation?

Please feel free to take everything from my two examples and integrate it in the official LoopBack documentation. May be the second repo could be useful in combination with the existing to-do-app examples.

I think there are two pieces of content that will be useful to LoopBack users:

  1. How to talk to a LB4 application from Angular - describe how to generate the client using a codegen tool.
  2. How to migrate an Angular client from loopback-sdk-builder to the solution described in the step 1 above.

I agree: These are the two pieces needed in the official LoopBack documentation.

agnes512 commented 4 years ago

Will we cover strong-pubsub*? https://github.com/strongloop/loopback-next/issues/6190

stale[bot] commented 3 years ago

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

stale[bot] commented 3 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.