Skip to content
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

Not very amenable to CMS integration, incompatible with previous version CMS setup #204

Closed
justin-hackin opened this issue Feb 9, 2023 · 3 comments

Comments

@justin-hackin
Copy link

justin-hackin commented Feb 9, 2023

The use of the Prose component to render HTML generated from markdown makes creating an integration for CMS content messy. For example, Prismic uses the formatted text field which is rendered through a react component so I had to edit the Prose component to check the type. This problem duplicates itself in the PDF rendering as well, requiring a similar PdfProse. Perhaps it would have been helpful to make the function that converts the property to content be configurable. For links, you can't store icons in a CMS, so it would have been better to use a iconName as is stated falsely in the readme but instead, the fa* icons are on the icon property. I regret this project is not more backward-compatible but there are some great improvements so I feel it's worth the effort.

@justin-hackin
Copy link
Author

I realized that it would be more sensible to just convert Prismic RichText to html strings in the CMS integration using ReactDOMServer.renderToStaticMarkup but unfortunately next.js won't let you do that in a server component. Since the PDF renderer also depends on rendering HTML strings, the integration of Prismic seems to be impossible.

The other issue I encountered with using Prismic is that the PrismicRichText seems to require the use of a context which is unavailable in server components so I had to downgrade to the old prismic packages used in a previous iteration of this project.

I would suggest the readme discourage the use of third-party CMSes for this reason.

@justin-hackin
Copy link
Author

justin-hackin commented Feb 9, 2023

I was able to work around the issue with prismic-react and instead use the Prismic helper asHTML to render the HTML server-side.

@justin-hackin
Copy link
Author

I achieved Prismic integration with my fork of this project

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

No branches or pull requests

1 participant