RFC: Explore Nuxt like module/plugin support #971
goetzrobin
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Which scope/s are relevant/related to the feature request?
Don't known / other
Information
Overview
Nuxt has an awesome way to provide support for Modules.
External modules or plugins can be written to extend the default Nuxt functionality.
I think supporting this for Analog would take this project to the next level.
Since Nuxt is also based on Nitro and Vite I think taking a look at how it is implemented there can be helpful.
To understand how Modules work for the developer we can read this guide here:
https://nuxt.com/docs/guide/going-further/modules
From what I understand so far, under the hood Nuxt uses the following unjs packages to support this functionality:
https://github.com/unjs/unctx
https://github.com/unjs/hookable
https://github.com/unjs/unplugin (this might not even be needed since Analog is Vite only)
The specific use case I have:
I would love to easily support a Prismic or Strapi API for my Analog project so a non technical author can just log in and start creating posts.
Example
I can simply run the following command.
Then, add @analogjs/strapi to the [modules] section of our Analog Vite plugin:
And to the main.ts bootstraping logic.
And be able to use it in a component like so:
Beta Was this translation helpful? Give feedback.
All reactions