-
Notifications
You must be signed in to change notification settings - Fork 40
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
Being Framework agnostic #183
Comments
Hey Loïck, thanks for contributing! You can disable Next-specific lazy-loading within your {
"repositoryName": "...",
"adapter": {
"resolve": "@slicemachine/adapter-next",
"options": {
"lazyLoadSlices": true
}
},
"libraries": [ /* ... */ ]
} More on that here: https://prismic.io/docs/technical-reference/slicemachine-adapter-next?version=0.1#usage I'll let @angeloashmore get back to you on the preview-specific nitty gritty~ |
Nice indeed, good catch, I didn't see this option. 👍 Now only the preview stuffs remain |
Hey @loick, Previews will likely require some framework-specific code since previews affect how you query for content. Content querying is typically framework-specific when using the most performant method. In Next.js, for example, you would need to use Preview Mode in the Pages Router or read That being said, here are the tools you have available to implement previews: Next.js (
React (
JavaScript/TypeScript (
This repository, Let me know if you have any questions! |
Hi, and thanks for your answer! Related to previews, I guess the code could be generic to accept any frameworks. For example, this component basically depends more on router methods than Next / Nuxt right? |
Is your feature request related to a problem? Please describe.
I'm working on a monorepo with several apps, and having a dedicated adapter to a specific framework is not flexible enough for me.
Describe the solution you'd like
Right now, I'm using (mainly) nextJS with the new prismic adapter. I migrated all of the methods using "prismicio/next" from my CMS package I created in order to be as agnostic as possible.
I'm still using two remaining methods from this package that I would like to get rid of (to stick to nodeJS / React but not to nextJS):
redirectToPreviewURL
PrismicPreview
Also, when I create a new slice because of the next adapter, I get an index file using
'next/dynamic'
. I would like to be able to stick to a classical export components file without any relationship with nextJS as well.Obviously I would like to keep the same features (previews etc.).
Do you have any idea on how to achieve this?
Thanks!
The text was updated successfully, but these errors were encountered: