Future of gatsby-plugin-fastify
#440
Closed
moonmeister
started this conversation in
Ideas
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Okay, I wanted to dump thoughts and get feedback on the future of
gatsby plugin-fastify
. With the news of Gatsby Adapters this plugin's future will change. The question is what is that future?Background
I first build the Fastify plugin while working at WPEngine. We had customers wanting to run Gatsby on our Atlas hosting platform and no good way to do so. There was no good way because Gatsby's own
gatsby serve
command was not ready for production. I won't go into the full details but basically, Gatsby gave up maintaining that CLI command once they got their cloud hosting in place. They saw it as competition and did little to nothing to maintain it as a suitable alternative for self-hosting.Alternative plugins for Express and even Fastify (
gatsby-plugin-node
) did exist but were poorly maintained and didn't support ALL of Gatsby's features, especially the new SSR/DSG rendering. So, there was a clear need for a quality plugin to support generic node hosting, including WPEngine's Atlas platform. I spent a couple of hours a week building and maintaining the plugin for our customers and anyone else who wanted to use it.Most importantly I learned how deeply broken this model was for supporting other hosting platforms. What little data Gatsby provided was often marked as unstable. This left All hosting plugins such as Netlify, Vercel, and even Gatsby Cloud's to fend for themselves for basic features. To this day this plugin doesn't support fairly core Gatsby features simply because of how difficult it was to implement them without core support.
This is why this plugin has never reached a stable version. Because I never felt comfortable trusting my hack job. On numerous occasions, I've received (and sometimes fixed) valid bug reports of weird corner cases I never thought of during the initial implementation.
The Adapter API
While still in the early days the Adapter spec will solve many of these issues. Those it doesn't I expect it will evolve to address. Because of that Fastify plugin's future needs to change. I see 2 possible futures.
Future 1: Evolution
The Gatsby / Netlify team has not announced any plans to resolve the current issues with the
gatsby serve
command. In a future where they choose not to make any significant improvements to prepare theserve
command for production, there will still be a need for an adapter that enables hosting Gatsby on Node.In this future,
gatsby-plugin-fastify
could be re-written as released asgatsby-adapter-fastify
. It could maintain its own CLI and simply leverage the new Adapter API to reach the feature support and stability I'd expect for a stable release.There's another version of this world where we change exactly how this plugin works and instead integrate more closely with the Fastify plugin ec- system to enable a Fastify plugin that runs Gatsby. While this would probably mean more work out of the box, it would enable a suture where those building custom Fastify servers and APIs could more easily add a Gatsby site to that existing stack.
Both of these are also possible. It really depends on what exactly the Gatsby team continues to build and what this community wants from this plugin.
Future 2: None
If I were the Netliffy team, which I'm not, I'd be working my backend off to fix the
gatsby serve
command to provide a production-ready node server for the community. I'm going to try and stay off the soap box here, but the decision to not have a working node server implementation was a bad one and continues to be. If this ADapter API spec is any indication of the better leadership Netlify is providing, I expect they'll fix this issue soon enough.In that world, I don't really see a need for this plugin. Again, going back to why I built this...I had customers who need a better node hosting option. I no longer work for WP Engine or use this plugin myself. I also saw a clear need for a more stable and performant node hosting option...if Gatsby is providing a node server in core, that's the most stable and well-supported option we could get.
What if that
gatsby serve
command does not use Fastify? This is very possible and in my opinion, doesn't matter. IF that matters to someone, then an adapter couple be built, but I haven't seen a strong need for that.Conclusion
At this moment I don't see any point in continuing to maintain
gatsby-plugin-fastify
. Whatever happens in Gatsby land, adapters are the future, and this plugin should adapt to that. Keeping the name is bad for the ecosystem, Adopting the newgatsby-adapter-fastify
is important for a variety of reasons. I would recommend any time investments be made to building that new plugin and not maintaining and fixing this one. It'll be so much easier to implement. If the time comes that Gatsby resides to fixgatsby serve
then we can re-evaluate if work on the Fastify adapter has started.The other question is about my active involvement in this plugin's future...I'm happy to help steward its future. My life is busy and my ability to give time to it is limited. I would like to write some code and help if it sticks around, I'm just not sure if I'll be able to. If this plugin is important to you and your team, you may need to step up to help maintain it.
My questions for users of this plugin:
gatsby serve
is production ready, do you still want/need fastify?Beta Was this translation helpful? Give feedback.
All reactions