B
B
Breezy
Search…
Getting Started

Installation

Ensure you have Webpacker and React installed. Add the following to your Gemfile and run bundle
1
# Gemfile
2
gem 'breezy'
Copied!
Run the installation generator
1
rails breezy:install:web
Copied!
Generate a scaffold
1
rails generate scaffold post body:string --force --no-template-engine --breezy
Copied!

Configuration

The rails breezy:install:web step adds a preconfigured entry point in app/javascript/packs/application.js.

Custom Reducers

The generator will also add a reducer.js file for any custom reducer you'd like to add. Included in the reducer is a pagesReducer for any cross-page optimistic updates, and a applicationRootReducer for the entire store. The latter is used for Redux Persist, which you can customize to your needs.

Custom Visit and Remote

The visit and remote thunks can be customized in app/javascript/packs/application_visit.js. Functionality like loading indicators can be added there.

Configuring Reloads

Breezy will do a hard reload whenever a successful response returns new asset fingerprints. Add an initializer to control how Breezy tracks Sprockets and Webpack assets:
1
# defaults
2
Breezy.configure do |config|
3
config.track_sprockets_assets = ['application.js', 'application.css']
4
config.track_pack_assets = ['application.js']
5
end
Copied!
Last modified 3mo ago