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

An extension starter project #525

Closed
bajtos opened this issue Aug 18, 2017 · 3 comments
Closed

An extension starter project #525

bajtos opened this issue Aug 18, 2017 · 3 comments
Assignees
Milestone

Comments

@bajtos
Copy link
Member

bajtos commented Aug 18, 2017

Create loopback-next-hello-extension (or similar name), a github project that people can git clone and start developing a new extension.

Ideally, the sample project should have placeholders/templates for all kinds of things that an extension can contribute:

  • providers
  • controllers
  • repositories
  • a mixin adding application methods and configuration

The idea is that as a new extension developer, I can fill in my implementation in the placeholders, remove placeholders for things I don't need, and have the extension ready in no time.

IMO, the project should be using TypeScript, have all necessary npm scripts already configured (build, test, etc.) and ideally include a reasonable test suite too.

See #218

@virkt25
Copy link
Contributor

virkt25 commented Sep 12, 2017

Hi @bajtos, had a few questions I'm hoping you can clarify.

  • What can a controller contribute to an application because I thought a controller contained logic for handling the routes for a particular model?

  • I'm not sure what a repository implementation would contain as a generic starting class as we don't have a new juggler ... Unless this is meant to be for the legacy juggler bridge ...?

@bajtos
Copy link
Member Author

bajtos commented Sep 12, 2017

Good questions!

What can a controller contribute to an application because I thought a controller contained logic for handling the routes for a particular model?

Controller contains logic for handling HTTP routes. Models are just an implementation detail that can be used by a controller.

Few examples of what kind of controllers can be contributed:

  • In an authentication/authorization component storing the users locally, a controller providing login, logout and user management API.
  • An API Explorer component (see loopback-component-explorer) can provide a controller serving SwaggerUI single-page-application.
  • etc.

I'm not sure what a repository implementation would contain as a generic starting class as we don't have a new juggler ... Unless this is meant to be for the legacy juggler bridge ...?

We need to use what we have now, which means legacy juggler bridge.

I am thinking about the following usage:

  • A component providing a Repository and model Entities to access a shared data source (a system of record?). For example weather data (maybe via REST?), or perhaps employee profile in the HR database?

@kjdelisle kjdelisle modified the milestones: Sprint 45, Sprint 46 Oct 4, 2017
@kjdelisle
Copy link
Contributor

Talked with @virkt25, this task is done.

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

3 participants