-
Notifications
You must be signed in to change notification settings - Fork 85
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
fetcher: rename service.name to service.resource #216
Conversation
97d7f79
to
8e7d128
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just a couple of comments.
libs/fetcher.js
Outdated
resourceName = fetcher.resource; | ||
} else if (typeof fetcher.name !== 'undefined') { | ||
if ('production' !== process.env.NODE_ENV) { | ||
console.warn('"fetcher.name" is deprecated. Please rename it to "fetcher.resource".'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be spammy in the console since we have many fetchers that use name. if we could only deprecate it once when the server starts, that would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this logic to Fetcher.middleware
. I also added an array to control all the deprecated services definitions. In this way, it will be easier to spot services non compliant with the newer API.
c395fb6
to
4e97035
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Closes #51
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.