diff --git a/docs/configuration/alpinejs.md b/docs/configuration/alpinejs.md index 9b3e7b5f..f1514dce 100644 --- a/docs/configuration/alpinejs.md +++ b/docs/configuration/alpinejs.md @@ -3,7 +3,7 @@ title: Alpine.js weight: 9 --- -### Configuration options +### Configuration Options To configure `alpinejs-ray`, you must create an `alpineRayConfig` property on the `window` object before loading `alpinejs-ray`: @@ -11,16 +11,18 @@ To configure `alpinejs-ray`, you must create an `alpineRayConfig` property on th - + ``` -| Name | Type | Default | Description | +### Configuration Reference + +| Name | Type(s) | Default | Description | | --- | --- | --- | --- | | `logComponentsInit` | `boolean` | `false` | Send info on component initializations to Ray | -| `logCustomEvents` | `boolean` | `false` | Send info on custom events to Ray _(events with hyphenated names)_ | - - +| `logErrors` | `boolean` | `false` | Send javascript errors to Ray instead of the console | +| `logEvents` | `boolean, array` | `false` | Send specified custom events to Ray, or `false` to disable | diff --git a/docs/installation-in-your-project/alpinejs.md b/docs/installation-in-your-project/alpinejs.md index c5cb587e..1da20872 100644 --- a/docs/installation-in-your-project/alpinejs.md +++ b/docs/installation-in-your-project/alpinejs.md @@ -15,7 +15,9 @@ For Alpine version 2 use: ```html - + + + ``` For Alpine version 3 use: @@ -47,28 +49,25 @@ Install with npm: npm install alpinejs-ray ``` -or yarn: +#### Importing the plugin -```bash -yarn add alpinejs-ray -``` +Although not the recommended way, you can import package normally if installed with a package manager _(along with `alpinejs` and `axios`)_: -#### Importing the plugin +First, install `alpinejs-ray` with npm _(or your preferred package manager)_: -Although not the recommended way, you can import package normally if installed with a package manager _(along with `node-ray`, `alpinejs` and `axios`)_: +```bash +npm install alpinejs-ray +``` ```js -import { Ray, ray } from 'node-ray/web'; import Alpine from 'alpinejs'; import AlpineRayPlugin from 'alpinejs-ray'; -window.ray = ray; -window.Ray = Ray; window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; window.Alpine = Alpine; -window.AlpineRayPlugin = AlpineRayPlugin; -window.AlpineRayPlugin.init(); -window.AlpineRayPlugin.start(); + +Alpine.plugin(AlpineRayPlugin); +Alpine.start(); ``` diff --git a/docs/usage/alpinejs.md b/docs/usage/alpinejs.md index 27287664..e88f5497 100644 --- a/docs/usage/alpinejs.md +++ b/docs/usage/alpinejs.md @@ -11,7 +11,7 @@ Once the plugin is installed, you may access the helper function as `$ray()` fro ## Example Component ```html -