Skip to content
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

Declarative Support #565

Closed
raymondfeng opened this issue Sep 8, 2017 · 10 comments
Closed

Declarative Support #565

raymondfeng opened this issue Sep 8, 2017 · 10 comments

Comments

@raymondfeng
Copy link
Contributor

raymondfeng commented Sep 8, 2017

LoopBack manages a set of artifacts, such as models, relations, datasources, connectors, ACLs, controllers, repositories, actions, sequences, components, utility functions, and openapi specs. In addition to the programatic approach to describe these artifacts by code (apis and decorators), we would like to add declarative support so that they can be declared in JSON/YAML files.

There are multiple tasks involved:

  1. Define a LB Next definition language (DSL) in JSON/YAML format and corresponding templates. See New DSL and Template Support #120. We need to come up a list of artifacts and metadata schema for each of them.

  2. Define the project layout to organize LB next artifacts

  3. Leverage the IoC Context to manage metadata/instances of such artifacts following the extension point/extension pattern.

  4. Define the lifecycle and serialization/deserialization requirements for each type of artifact.

  5. Add @loopback/boot to discover/load/resolve/activate the artifacts. See [SPIKE] Create @loopback/boot to support declarative JSON/YAML files #441. The boot process can be tailored for both tooling and runtime.

  6. Build tools (CLI/UI) to scaffold LB next applications and render/manipulate LB next artifacts.

@dhmlau dhmlau added the epic label Sep 13, 2017
@jannyHou jannyHou self-assigned this Oct 30, 2017
@bajtos bajtos added MVP epic and removed MVP labels Nov 2, 2017
@jannyHou jannyHou removed their assignment Nov 14, 2017
@kjdelisle kjdelisle changed the title Declarative support Boot Epic - MVP Dec 7, 2017
@kjdelisle kjdelisle changed the title Boot Epic - MVP Declarative Support (Boot Epic) - MVP Dec 7, 2017
@kjdelisle kjdelisle changed the title Declarative Support (Boot Epic) - MVP Declarative Support Dec 7, 2017
@dhmlau dhmlau mentioned this issue Feb 21, 2018
11 tasks
@dhmlau
Copy link
Member

dhmlau commented Feb 23, 2018

To be discussed with @raymondfeng and possibly other stakeholders:

High level requirements

When creating LB4 app, LoopBack users can:

  • define the artifact declaratively (besides programmatically)
  • reuse LB3 artifact json/yaml files with no or minimal changes
    • If the artifact schema is different from that in LB3, need to document it

List of artifacts that have declarative support in LB3

  • model
  • datasource
  • controller
  • repository
  • anything else?

What we need to do

  • Define the artifact schema
  • create corresponding booters
  • ... plus the list from the original description

List of artifacts that will have declarative support

@dhmlau
Copy link
Member

dhmlau commented Feb 23, 2018

just realized this story is sort of groomed in #441. please ignore my comment above.

@slathrop
Copy link

I'm a very happy dev on LB3 right now with a sizable investment in the declarative, model-driven approach.

So I'd just like to say:

  • Please, please invest in keeping the LB3 simplicity of all out-of-the-box API endpoints "just working" based solely on the JSON models (or whatever data/metadata format)
  • I definitely "get" the idea of controllers and repositories in LB4, but please don't require that sort of boilerplate code and ceremony simply to get basic APIs up-and-running
    • To me, the "hooks" approach in LB3, where you don't need to write any code "until you really need to" must still be possible in LB4
  • When I saw the onboarding, "Getting Started With LB4" TODO scenario with the TypeScript classes for controllers and repositories my heart just sank!
  • The onboarding experience in LB3 is absolutely phenomenal... the no-code support in LB3 for quickly standing-up an API server is awesome
  • I know that the full LB3 feature parity on LB4 is still a WIP, but please, keep that awesome model-driven, no-code support from LB3 when you finish the feature parity work!

Thanks! And keep up the awesome work on LB!

@raymondfeng
Copy link
Contributor Author

Great feedback! We’ll definitely want to keep the simiplicity for common patterns. The idea of LB4 is to create the primitive building blocks first and add composite ones on top of them based on our users’ need. Ideas of such high order commands are welcome!

@dhmlau
Copy link
Member

dhmlau commented Oct 14, 2018

@slathrop, thanks for your feedback. To add on @raymondfeng's comment, I'm in the process of cleaning up the steps in the TODO tutorial to demonstrate the "no-code support" to start up something simple. Feel free to comment on my PR: #1846.

@bajtos
Copy link
Member

bajtos commented Oct 26, 2018

Related discussions: #695 and #1889

@elv1s
Copy link
Contributor

elv1s commented Oct 29, 2018

I want to second what @slathrop wrote.

Loopback is an awesome framework! I think frameworks like loopback, and others like expressjs, owe their popularity in large part to their simplicity.

@beriberikix
Copy link

For "6. Build tools (CLI/UI) to scaffold LB next applications and render/manipulate LB next artifacts," have you see https://github.com/mermade/openapi-gui? It has been pretty handy when I was trying to learn OAS3 and seems extendable.

@stale
Copy link

stale bot commented Nov 18, 2019

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 stale bot added the stale label Nov 18, 2019
@stale
Copy link

stale bot commented Dec 18, 2019

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.

@stale stale bot closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants