Transitioning Back to a Nuxt-First Approach #271
casualmatt
started this conversation in
RFC
Replies: 3 comments 8 replies
-
Some personal notes about this new implementation of nuxt-directus:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Is there any repo or branch to watch the current state? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi to all,
This is to update you on the module and why nuxt-directus-next was not realized as stable, and it's still a beta.
During the development of Nuxt-Directus-Next, we encountered several challenges with the new Directus SDK-based module. @sandros94 and the team faced significant difficulties, particularly in the early stages. The SDK's incompatibility with
ofetch
and the complete rewrite of TypeScript (TS) support mid-development forced us to make extensive changes to our codebase. Additionally, we struggled with optimizing the SDK within auseAsyncData
composable to enhance Nuxt's performance by improving page load times and reducing the number of API requests sent to Directus.Moreover, the frequent major releases of the Directus SDK, occurring every two months, necessitated constant fixes and adjustments to maintain compatibility with TS and adhere to good Nuxt practices. This rapid pace of change made the current approach increasingly unsustainable.
After careful evaluation, Sandro and I have concluded that building the module around the SDK is not maintainable in the long term. Therefore, we have decided to pivot to a Nuxt-first approach, prioritizing developer experience and stability. Our revised plan includes:
ofetch
for manual Directus REST API calls.useFetch
for the most optimized access to the Directus API.Additionally, we will provide composables for wrapping essential functions, such as the Files API, that are vital for your projects.
We're also considering implementing a smart feature: if the module detects the presence of the SDK in your project, it will automatically create a preconfigured client for both server and browser environments.
With this new approach, we believe every use case will be addressed. Experienced users will still have access to the SDK, but in day-to-day projects, your TypeScript configurations won't break every two months. You can also expect better integration with Nuxt 4, particularly in terms of data fetching and state management optimizations.
We look forward to your feedback and to refining this approach further to meet the community's needs.
Matt.
Beta Was this translation helpful? Give feedback.
All reactions