gatsby-plugin-protoculture
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

protoculture

License npm version Build Status semantic-release

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

Original github issue.

This plugin became a possibility after the addition of async support for Gatsby plugins.

Package Sidebar

Install

npm i gatsby-plugin-protoculture

Weekly Downloads

6

Version

1.0.5

License

Apache-2.0

Last publish

Collaborators

  • atrauzzi