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

Allow connectors to be implemented as ES6 classes #1758

Open
2 tasks
bajtos opened this issue Jul 11, 2019 · 3 comments
Open
2 tasks

Allow connectors to be implemented as ES6 classes #1758

bajtos opened this issue Jul 11, 2019 · 3 comments
Assignees
Labels
community-contribution Patches contributed by community feature major

Comments

@bajtos
Copy link
Member

bajtos commented Jul 11, 2019

I would like the connectors to leverage ES6 class inheritance.

Acceptance criteria

  • Rework Connector and SqlConnector classes provided by loopback-connector to be implemented as ES6 classes. This is a semver-major change.
  • Rework the documentation for connector authors to use class inheritance.

Out of scope

Eventually we should update all of our connectors to use the new major version of loopback-connector and switch to ES6 class inheritance.There should be follow-up issues opened (one per the connector repository).

Related: #1659

@bajtos
Copy link
Member Author

bajtos commented Sep 19, 2019

From what I've seen in 3rd-party connectors, it's already possible to implement connectors using class inheritance.

const {Connector} = require('loopback-connector');

class MyAwesomeConnector extends Connector {
  constructor(settings) {
    super('myawesome', settings);
  }

  // ...
}

In that light I think rewriting Connector and SqlConnector to ES6 class style is not worth our effort at this time, also considering the breaking change. We have more important problems to address!

I am proposing to change the scope of this issue to doc updates only:

  • Rework the documentation for connector authors to use class inheritance.

@raymondfeng @dhmlau thoughts?

@bajtos
Copy link
Member Author

bajtos commented Sep 19, 2019

On the other hand, we will be introducing a new semver-major version of loopback-connector as part of #1659, in which case it may be better to bundle both changes in the same release. 🤔

@dhmlau
Copy link
Member

dhmlau commented Sep 23, 2019

@markdirish, per the google group discussion, thanks for your interest in contributing this issue. I'm going to assign this to you. Thanks!

UPDATED: Looks like your name does not show up in the assignee list, so cannot assign it to you.

@dhmlau dhmlau added the community-contribution Patches contributed by community label Sep 23, 2019
@dhmlau dhmlau removed the 2019Q4 label Oct 8, 2019
@dhmlau dhmlau added p3 and removed p3 labels Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Patches contributed by community feature major
Projects
None yet
Development

No branches or pull requests

3 participants