nuxt-modules / strapi

Strapi Module for Nuxt
https://strapi.nuxtjs.org
MIT License
644 stars 81 forks source link

General feedback about Strapi 5 support #434

Open olrtg opened 1 month ago

olrtg commented 1 month ago

I'm creating this general issue to collect some feedback from other people about the work done in past PRs to support Strapi 5 and how we can improve it. If you want it, maybe I create separate issues to track these individually.

After installing the module myself and using v5 for a while in a personal project I've found the following:

For now, that's what I've found. Let me know what you think!

Related PRs:

reslear commented 1 month ago
  1. maybe
  2. same
  3. agree

also need export StrapiLocale for setting out request instead types error import type { StrapiLocale } from '@nuxtjs/strapi/dist/runtime'

BayBreezy commented 1 month ago
  1. Yes, the fact that v5 is not the default should be somewhere in the docs. Could be tricky as the default version of Strapi is now 5. The module has not been fully tested for v5.
  2. I am no TS expert so I am not even sure how to approach this 🤣. That is a weird one tho. Why would types work and not interfaces?
  3. Correct! locale can be null.

@reslear would the StrapiLocale be a composable? Not sure what you mean there.

benjamincanac commented 1 month ago

As you guys might know, I'm not actively maintaining this repository. Would you mind telling me once everything is good so I can release a major version?

reslear commented 1 month ago

✅ 1, 3 - fixed

  1. i was thinking maybe we could just do it like v4 without generics ? like data | data []

  2. I'm also thinking of exporting types like

    import type { StrapiLocale } from '#nuxt-strapi/types';
  3. I also keep the same types between projects, I suggest adding StrapiDynamicZone, StrapiComponent, StrapiImage, StrapiSeo.

  4. For dynamic editor I suggest to add information about

olrtg commented 1 month ago

@reslear 2 sounds great to me. About the other points idk. I just started using this module and Strapi, so I don't know much yet.

Zellokr commented 1 month ago

Hi guys, I'm trying to use useStrapi module (V5), nuxt can't find useStrapi, however I can use useStrapiUser, UseStrapiToken, useStrapiAuth, etc... do you know why?

benjamincanac commented 1 month ago

@Zellokr Do you use the latest Edge version?

Zellokr commented 1 month ago

Yes, as devDepencencies Image

benjamincanac commented 1 month ago

Could you try npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9 (latest release), sometimes the latest tag don't work that well.

Zellokr commented 1 month ago

It works, however type error "V5" in nuxt.config.ts still appears.

Thank you! :)

MarijnFK commented 1 month ago

✅ 1, 3 - fixed

  1. i was thinking maybe we could just do it like v4 without generics ? like data | data []
  2. I'm also thinking of exporting types like import type { StrapiLocale } from '#nuxt-strapi/types';
  3. I also keep the same types between projects, I suggest adding StrapiDynamicZone, StrapiComponent, StrapiImage, StrapiSeo.
  4. For dynamic editor I suggest to add information about

  1. sounds great. With the latest i can't import any types from "@nuxtjs/strapi", i.e. import type { Strapi4ResponseData } from "@nuxtjs/strapi"; This did work in strapi v4, but seems broken now.
derrickmehaffy commented 3 weeks ago

Stopping by here from the Strapi team (as I work for Strapi) to mention that if anyone needs any information clarity on how something works or help maintain or build support for Strapi 5 please don't hesitate to stop by our Discord: https://discord.strapi.io

Or if you are in dire need of some information for this module you can email me directly: derrick.mehaffy@strapi.io (please don't send emails asking for normal application support but if it's related to this module then it's all good).

Thanks!

benjamincanac commented 3 weeks ago

Just released a v2.0.0, let me know if you encounter any issue with it!

BayBreezy commented 3 weeks ago

Okie! Will do