gatsby-plugin-protoculture
v1.0.5
Published
Add support for Protoculture conventions to your Gatsby project.
Downloads
6
Maintainers
Readme
About
This plugin adds support for the conventions found in the Protoculture JS library to any Gatsby project.
You can also find the Dockerfile
for working with protoculture and gatsbyjs here.
Usage
Configure a Local Package
Set up gatsby-src
as a local package, pointing to your project directory so webpack can help this plugin find your application directory and its sources.
It'll look something like this in your package.json
:
{
...
"dependencies": {
"gatsby-src": "file:./src",
},
...
}
This is also helpful if you are using TypeScript for your project as it's not possible at the moment to reference TypeScript code from gatsby-config.js
or make it a .ts
file.
Create a Bundle
After setting up the local package, in your project, create and configure a subclass of Bundle
which serves as the root entrypoint for protoculture.
All functionality of protoculture-react is now available to you, including react-redux, redux-thunk, as well as the ability to set up your redux store via dependency injection.
Please remember that unlike normal protoculture applications, Gatsby remains the proper entrypoint for browser code. This means that other polyfills and modules may have been loaded prior to your Bundle
subclass.
It's also worth noting that I'll be looking at enabling gaining access to dependency injection for your react components in the near future. You can track that progress in protoculture-react itself.
Meta
This plugin became a possibility after the addition of async support for Gatsby plugins.