-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Clean up datasource template #5220
Comments
@bajtos am interested in contributing on this. Maybe start with point 1 & 2 as a starter since am new to Lb contribution |
@mrmodise awesome 👍🏻 Starting with the first two items is fine, I'll review |
Thanks raised PR but having issues with grPc connection and Travis CI commit-linting |
Also wanted to get your thoughts on having the config object inside the datasource.ts. What I discovered on our projects at work is that these tend to grow in size for complex projects (ours are around 400 to 500 lines). Would it not be ideal to move these ito a config folder and have them listed underneath here following the same conventions as when we were using JSON files? |
Interesting. What kind of configuration or code are you putting into your datasources? I would like to better understand your use case. |
We don't change the default config on the datasource Classes. The only change we do is we import the config from a different file since these will be longer due to many systems we are integrating with. so in our datasources we only change the dsConfig to point to the imported config, which will have many operations thus the longer length |
IIUC, you are using loopback-connector-rest? I see how a large configuration of Personally, I would keep options like Maybe we can introduce some sort of a convention for loading definitions of REST operations from external files, perhaps there can be one file per operation template? I think this would be best discussed in a new GitHub issue though. |
Thanks. Will log an issue and move the conversation over there |
@bajtos when you're back I would like for us to close all the items on this issue. Thanks |
This is a follow-up issue for #5000 where we moved datasource config from JSON files to TS files and discovered few aspects of the datasource template that can be improved.
name
read-only, set it fromconfig.name
to avoid duplication.@config
, so that they can be configured viaapp.configure()
. Update the docs (especially Cloudant & Bluemix guides), make sure to preserve content for the old configuration style (think of existing projects created before the change).examples
to use the same style as scaffolded bylb4 datasource
. Most notably, change them to participate in app life-cycle and disconnect when the application has stopped. Update the docs accordingly.stop()
method provided directly by juggler, see feat: implement DataSource.stop() loopback-datasource-juggler#1835 and feat: remove hand-written datasourcestop()
method #5279Acceptance criteria
For each of the items above, consider the following places to update
docs/site
, do a text search to find all snippets showing a datasourceexamples
🎆 Hacktoberfest 2020
Greetings 👋 to all Hacktoberfest 2020 participants!
Here are few tips 👀 to make your start easier, see also #6456:
#loopback-contributors
channel, you can join our Slack workspace here.The text was updated successfully, but these errors were encountered: