README.md in quilt_rails-3.1.0 vs README.md in quilt_rails-3.1.1

- old
+ new

@@ -43,16 +43,14 @@ `rails generate sewing_kit:install` This will generate a package.json file with common sewing-kit script tasks, default lint, format configuration; a sewing-kit configuration file, and other project default configurations. -`rails generate quilt::install_demo_app` +`rails generate quilt:install` -Both command will install Node dependencies, mount the Quilt engine in `config/routes.rb`, set up basic linting and format configurations, and provide a demo React app (in TypeScript) that uses all of quilt toolings and is a more complete example of a typical application. +This command will install Node dependencies, mount the Quilt engine in `config/routes.rb`, and provide a bare bone React app (in TypeScript) that. -If you prefer to setup all of the React app yourself, `rails generate quilt:install` does the same as above but with a bare bone React app. - #### Try it out ```sh bin/rails server ``` @@ -131,10 +129,12 @@ } export default App; ``` +**Note:** This solution works out of the box for initial server-side renders. If you wish to have consistent access to request headers on subsequent client-side renders, take a look at [`NetworkUniversalProvider`](https://github.com/Shopify/quilt/tree/master/packages/react-network#networkuniversalprovider). + ##### Example: sending custom headers from Rails controller In some cases you may want to send custom headers from Rails to your React server. Quilt facilitates this case by providing consumers with a `headers` argument on the `render_react` call. ```ruby @@ -281,9 +281,28 @@ result = MySchema.execute(query, operation_name: operation_name, variables: variables, context: context) render(json: result) end end +``` + +#### Exception monitoring with Bugsnag + +For an opinionated universal Bugsnag+React setup we provide and support [`@shopify/react-bugsnag`](https://github.com/Shopify/quilt/tree/master/packages/react-bugsnag). + +##### Example + +```typescript +// app/ui/index.tsx +import React from 'react'; +import {Bugsnag, createBugsnagClient} from 'utilities/bugsnag'; +import {bugsnagClientApiKey} from 'config/bugsnag'; + +const bugsnagClient = createBugsnagClient({apiKey: bugsnagClientApiKey}); + +export function App() { + return <Bugsnag client={bugsnagClient}>{/* actual app content here */}</Bugsnag>; +} ``` ## Performance tracking a React app To setup performance tracking with your React app with `quilt_rails`.