webscopeio / mailingui

MailingUI is an open source collection of email components and templates
https://mailingui.com
MIT License
20 stars 3 forks source link

Integrate `next/mdx` into `/blog` routes as well. #140

Closed ericvalcik closed 1 year ago

ericvalcik commented 1 year ago

With PR #130 merged, all mdx files except the ones used for blogs are being handled with the next/mdx library. If we migrate the blog to this as well, we can drop the hashicorp's next-mdx-remote library completely and just use next/mdx.

Using next/mdx makes sense to me, as the next-mdx-remote library's intended to use it to fetch mdx files, but our files live in our codebase, so even though right now we have to do some hacks to make the DX most pleasant, in the future I believe this would be the best bet for us.


note: next/mdx does not support frontmatter out of the box, but we depend on it with blog. In the docs they propose an alternative - using exported objects instead of frontmatter. IMO it is worth exploring using this instead of installing another dependency for frontmatter.

ericvalcik commented 1 year ago

After further consideration, this would bring more hassle than benefits, because as of now we would have to explicitly import all the blog posts, while hashicorp's next-mdx-remote lib does not require this.

Closing this issues as I believe leaving the blog as is is better for us right now