That’s great @chrisvdm! I’ve been thinking a lot about what a plugin framework would look like for RedwoodJS. I have a project I’m working on, and I want to abstract pieces of it for reuse in other projects. There’s an open issue on the topic (#388) that didn’t get much traction, mainly I think because the posters in that issue weren’t very clear about what exactly they wanted.
@freddydumont has an nprogress component for RedwoodJS that might give you some ideas. I like that it uses Emotion and Theme UI. I’ve seen other work that’s based on Tailwind, which hard-wires styling into an “all-or-none” pattern in the package. Emotion/Theme UI lets you override just the styling you want really easy through props in client code. The downside is it specs a component library (included in Theme UI) which is too opinionated for a framework to do.
One of the things I’ve wanted to recommend and write up reasons for doing so is to follow a naming convention like Gatsby does. It makes Gatsby-specific plugins really easy to find in the package registry. A general scheme would be something like
redwood-plugin-stripe, and then if there’s plugins to your plugin
It’d be nice to have the option to redirect to the Stripe checkout page or build a custom checkout form - maybe the latter through a supporting package, like a subplugin (e.g. have an extension API for doing so)?
An easy way to use Stripe’s sandbox testing environment would be a nice feature for me, especially if it picked up the
dev environment to know to do so.