darthmeme / gridsome-plugin-rss

Generate an RSS feed from your Gridsome data store
15 stars 11 forks source link

Refactored to build dynamically (instead of storing file in `./static`) #4

Closed onecrayon closed 5 years ago

onecrayon commented 5 years ago

Hey there!

I liked the idea behind your plug-in, but wanted to convert it to use api.afterBuild() similar to the first-party @gridsome/plugin-sitemap instead of storing an RSS file in ./static. While I was doing that, I thought to myself, "Hey, maybe it would be nice to have some actual defaults for the options!", one thing led to another, and well...I might have ended up going a little overboard.

Anyway, this PR makes the following changes:

Let me know what you think! I realize this is basically a massive rewrite out of the blue, so if you aren't comfortable with some of the changes I'd be happy to discuss them (or if you're really attached to generating the file statically, I could make an alternative plug-in). :)

darthmeme commented 5 years ago

Hey @onecrayon!

Sorry for the late reply. Thanks for taking time to work on the plugin! Quick question: Do we really need fs-extra? It's an extra dependency and doesn't seem to be doing much more than I was. Or am I missing something?

onecrayon commented 5 years ago

Hey @darthmeme,

Do we really need fs-extra?

Probably not; I mainly went with this because that's how the core Gridsome packages were doing it (e.g. @gridsome/plugin-sitemap). I don't know specifically why they chose fs-extra over fs when it only appears to save about a line of code at the cost of a dependency, though. ¯\_(ツ)_/¯

darthmeme commented 5 years ago

Hey @onecrayon - thanks again for contributing. Going over this again, I don't really think there's a need to introduce breaking changes to the API, so I'm going to go ahead and close this PR.

onecrayon commented 5 years ago

I actually ended up writing my own feed plugin because this one doesn’t support multiple content types or limiting the feed to X most recent items: https://github.com/onecrayon/gridsome-plugin-feed