Skip to content

Add Nuxt.js generator #220

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

Merged
merged 8 commits into from
Oct 5, 2020
Merged

Conversation

alOneh
Copy link
Contributor

@alOneh alOneh commented Jun 29, 2020

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tickets fixes #109
License MIT
Doc PR api-platform/docs#1176

This is a first draft for Nuxt.js client generator, I also use the Vuetify based templates for this generator, I don't know how people use Nuxt.js on their own project but, I have a preference for Vuetify as it is more complete than others but I can keep it simple as I do for the Vue generator.
Feel free to vote on it.

@sergerdn
Copy link
Contributor

Hi @alOneh. Thank you for your awesome job. Are there any updates about this? Is it production ready? I'm thinking of using it in my project.

@alOneh
Copy link
Contributor Author

alOneh commented Sep 16, 2020

@sergerdn did you try it ? If so and you don't find any blocking issue feel free to approve the MR

@sergerdn
Copy link
Contributor

I wants to be clear, I'm not a maintainer of this project and I don't have any right to approve your awesome job. I didn't try it, because I don't frontend developer, I am product owner.

@dunglas
Copy link
Member

dunglas commented Sep 16, 2020

I think that this can be merged as is. It can always be improved later when we'll gather more feedback from the community.

@sergerdn
Copy link
Contributor

@dunglas I think so, because something is always better than nothing.

@soyuka
Copy link
Member

soyuka commented Sep 25, 2020

Shouldn't we add nuxt to the list of generators? Also could you give me the command to use to test this ?

The code looks good to me!

@sergerdn
Copy link
Contributor

So, are there any updates? I have tested it a little bit, everything looks good for me.

@OneDoBit
Copy link

OneDoBit commented Oct 1, 2020

Hi @alOneh, I am looking towards contributing into developing Nuxt JS generator for API Platform, would you please tell me what is left to do to finish this generator?

@alOneh
Copy link
Contributor Author

alOneh commented Oct 1, 2020

@sergerdn @OneDoBit, I am working on the documentation I will merge this asap.

@sergerdn
Copy link
Contributor

sergerdn commented Oct 2, 2020

@sergerdn @OneDoBit, I am working on the documentation I will merge this asap.

Thank for the update.

@alOneh alOneh changed the title WIP: Add Nuxt.js generator Add Nuxt.js generator Oct 5, 2020
@alOneh alOneh merged commit 64b41e8 into api-platform:master Oct 5, 2020
@alOneh alOneh deleted the feature/nuxt-generator branch October 5, 2020 14:13
@alOneh
Copy link
Contributor Author

alOneh commented Oct 5, 2020

I merge the branch because failing tests are not related to this MR.
/cc @sergerdn @OneDoBit

@OneDoBit
Copy link

OneDoBit commented Oct 5, 2020

Thank you for such a quick response, @alOneh! I will be happy to test this as soon as possible!

Comment on lines +57 to +58
normalizeRelations = x => x,
resolveRelations = x => x,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between those?
Am I correct, that I should use them to expand the related items from their iri to the full items?
Is there an example how to use them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, one is for normalize some fields before sending them to the api and the other one is for retrieving some data when having only the iri for an item.

I don't fully implement this cause it could be hard to understand and it relies heavily on the Vuex (you need a store for each relation).

This implementation was inspired by this post, you'll find some examples

Copy link
Contributor

@gharlan gharlan Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the explanation and the link!

[ACTIONS.SET_UPDATED]: (state, updated) => {
Object.assign(state, {
byId: {
[updated['@id']]: updated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether it is intended to replace all existing items in byId after updating one item?

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

Successfully merging this pull request may close these issues.

Suggestion: Templates for Next.js / Nuxt.js
6 participants