-
-
Notifications
You must be signed in to change notification settings - Fork 131
Vuejs generator #35
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
Vuejs generator #35
Conversation
alOneh
commented
Sep 21, 2017
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #26 |
License | MIT |
Doc PR |
95cab54
to
bde1276
Compare
templates/vue/api/fooFetch.js
Outdated
|
||
const jsonLdMimeType = 'application/ld+json'; | ||
|
||
export default function {{{ lc }}}Fetch(url, options = {}) { |
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.
why do we need a fetch
utility per resource? Can't this be common to every 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.
Yes of course !
@@ -0,0 +1,101 @@ | |||
import SubmissionError from '../../../error/SubmissionError'; | |||
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch'; |
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 should use utils/fetch
directly, the fooFetch
file is not necessary IMO.
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 was thinking about that but keep this to allow wrapping... I have no preferences
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.
@mysiar wdyt?
If we have just one common fetch for all endpoints there is no need to import it and give it new name |
I think it is ready if anyone can review |
@@ -1,5 +1,5 @@ | |||
import SubmissionError from '../../../error/SubmissionError'; | |||
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch'; | |||
import {{{ lc }}}Fetch from '../../../utils/fetch'; |
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.
do we need to name Fetch function to the componenet ?
@@ -1,4 +1,4 @@ | |||
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch'; | |||
import {{{ lc }}}Fetch from '../../../utils/fetch'; |
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.
do we need to name Fetch function to the componenet ?
@@ -1,4 +1,4 @@ | |||
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch'; | |||
import {{{ lc }}}Fetch from '../../../utils/fetch'; |
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.
do we need to name Fetch function to the componenet ?
@@ -1,4 +1,4 @@ | |||
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch'; | |||
import {{{ lc }}}Fetch from '../../../utils/fetch'; |
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.
do we need to name Fetch function to the componenet ?
@@ -1,5 +1,5 @@ | |||
import SubmissionError from '../../../error/SubmissionError'; | |||
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch'; | |||
import {{{ lc }}}Fetch from '../../../utils/fetch'; |
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.
do we need to name Fetch function to the componenet ?
@soyuka please check this out |
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.
Nice job!
Awesome! Please don't forget to explain how to use it in the docs (https://github.com/api-platform/docs/tree/2.1/client-generator, IMO the Vue.js generator deserves its own dedicated file). |
@alOneh could you please prepare doc file for Vue explaining how to connect generated files to app skeleton similar to https://api-platform.com/docs/client-generator/installation-and-usage ? |