Proposal: use remixaustin's blog to contribute to the general Remix community #89
Replies: 3 comments 9 replies
-
I think this is awesome Colby! Seems like a super interesting idea and I can definitely see a helpful library or at the very least pattern+example repos+blog post coming out of this. I think building this within the Remix Austin community is also a great idea, but you're looking to publish an open source package, I definitely don't want it to be tied to the Remix Austin community in any weird way to where the availability of our members are holding you back. Not sure exactly how to express the relationship worries I want to avoid, so mostly thinking out loud. That being said though, I think lots in the community would be pretty interested in helping. I could even see us using a meetup to hack around ideas or something like that. Additionally, you really seem to have a strong vision and interest here, so I would definitely be looking for you to take the lead on this, but I'm happy to help you spec out issues, engage with the larger community, give feedback on ideas, and pickup tasks as I have time and bandwidth. In the meantime, would definitely love @grantnorwood, @sethdavis512, @dmorrison, @tcschiller, and @KarenDouglas's thoughts on the matter (given all of them have contributed to this project so far) |
Beta Was this translation helpful? Give feedback.
-
So I did my best to take this discussion and run with it based upon all the links @colbywhite left behind of blog implementations in my PR #91. I started by copying beat for beat what he did for his personal website, and what Robert Stringer has put out there as the Remix blog stack. I eventually got my head around what it was doing and how to optimize it. Here's the thing, for really small blogs, I think the level of support for MDX in Remix is actually more than good enough. It offers quite a bit for the person writing the occasional blog or two. And it's as easy to set up as just putting those MDX files in your routes. The only thing that could make me worried is if Remix ever drops support for MDX in the future. If they already advise against compiling MDX at build time today, then maybe that is a possibility. With that said, if someone is running a more active blog and is planning to use their file system as a CMS, the only way to optimize that experience is to put an accompanying local server next to the Remix dev server on startup. The local server can watch the blog contents and compile the frontmatter into a cached list for the blog page. It can also have a websocket connection that the UI of the Remix app can listen to by way of a conditional script. This would enable auto-refresh on blog change or blog dependency change. Having that second local server is necessary for both of these features because the Remix server is pretty closed off. And if we want to support full caching of the blog contents without moving files into Finally, if a user wants to have their blog content rendered locally on dev, but hosted somewhere for prod, we would have to come up with a whole configuration set up for how the MDX files can be stored on an API, but how we will resolve the dependencies of those files. There are a few options that come to mind, but we'd likely have to come to an agreement on the "best" one. There's definitely room to create something in this space that could be good. And making a recommended set up for a blog that runs on a local filebased CMS that uses |
Beta Was this translation helpful? Give feedback.
-
Calling bankruptcy on all discussions and issues today. Going to start revamping the direction of this project, so stay tuned 🚀 |
Beta Was this translation helpful? Give feedback.
-
I propose that we add a blog to the website, but do it in a way that helps the Remix community at large. There doesn't currently exist (in my opinion) a solid way to quickly add a blog to your remix site. There are several different strategies you can take and thus you need to spend some time thinking through how to accomplish it. A utility library that makes that process easier would help the Remix community in general.
There's a world where we add a blog to the remix-austin site and create a utility library for others to do the same. I propose we aim for that.
This rest of this post will be a recap of my current thought process around implementing a utility lib for this. I've been thinking about it for a while and this is me snapshotting the latest iteration of those thoughts and putting them into text to hopefully spark convo.
But I do suspect there's a valid counter argument of my proposal of making a general utility lib via a meetup group. Feel free to push back if you think that's not a great idea.
Some thoughts on implementation
First, I'll make some assumptions (feel free to challenge these):
mdx-bundler
is the ideal way to do server-side rendering of mdx filesblog.$slug
: to display an individual blog postblog._index
: to display a list of all the postsrss[.]xml
: to build a rss feed (although this could be a v2 thing)sitemap[.]xml
: to buld a sitemap to help search engines (although this could be a v2 thing)To build each route, these steps need to happen:
mdx-bundler
mdx-bundler
as needed by the blog* source could be the filesystem, github, a cms, or something else
if we want a general set of utilities, we likely want to focus on the first two steps and give the user what they need to do the third step based on their own style/preferences. if so, that means a reframing of what "a utility library for blogs and remix" would be "a utility library that connects
mdx-bundler
to different sources"(and thus it's probably useful to understand the use case for
mdx-bundler
)when reframed as that, the question becomes what are the types of sources?
Sources
I think there are three key things an author is going to factor in when choosing where/how to save their content (and thus choosing the source).
git push
? clicking a Publish button?And thus i see three main types of sources.
yarn dev
git push
Observations
CMS options
here's a brain dump of CMSs that exist in no particular order
Potential next steps
based on the above implementation thoughts, here's some next steps that could get this project going
@remix-cms
org in npm with several packages.@remix-cms/strapi
,@remix-cms/storyblok
,@remix-cms/file
etc etcfunction getPosts(): Promise<Awaited<ReturnType<typeof mdx-bundler.bundleMDX>>[]>
function getPost(slug: string): Promise<Awaited<ReturnType<typeof mdx-bundler.bundleMDX>>>
getPost
/getPosts
in theirloader
s andmdx-bundler
'sgetMDXComponent
in their views.Cache-Control
headers, with config options to control itPrior art
Other things i've seen in the community at large that influenced all of the above
*.mdx
routes. but it's barebones and not really meant for a full blog a point remix acknowledges in the docsThoughts?
I think that's enough of a vision of what this utility lib would look like in order to discuss whether or not we want to pursue that via this meetup group. This sound like an interesting project?
Beta Was this translation helpful? Give feedback.
All reactions