Skip to content

Commit 27c604c

Browse files
authored
Merge branch 'master' into improve_cable_component_docs
2 parents dfaf699 + 22d6995 commit 27c604c

File tree

18 files changed

+76
-76
lines changed

18 files changed

+76
-76
lines changed

docs/api/000-base/00-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ An app is a special kind of `Matestack::Ui::VueJsComponent`. Matestack will
77
therefore wrap the UI defined in the `response` method with some markup enabling
88
dynamic UI behavior and CSS styling.
99

10-
The app ships a `Vuex store` and `Vue.js event hub`, which are used by core vuejs
11-
components and can optionally be used by custom vuejs components in order to
10+
The app ships a `Vuex store` and `Vue.js event hub`, which are used by core Vue.js
11+
components and can optionally be used by custom Vue.js components in order to
1212
trigger events, manage client side date and communicate between components.
1313

1414
## An App can wrap pages with a layout

docs/api/000-base/30-vue_js_component.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# VueJs Component
1+
# Vue.js Component
22

33
In order to equip a Ruby component with some JavaScript, we associate
4-
the Ruby component with a VueJs JavaScript component. The Ruby component therefore needs to inherit
4+
the Ruby component with a Vue.js JavaScript component. The Ruby component therefore needs to inherit
55
from `Matestack::Ui::VueJsComponent`. Matestack will then render a HTML component
66
tag with some special attributes and props around the response defined in the
7-
Ruby component. The VueJs JavaScript component (defined in a separate JavaScript file and
7+
Ruby component. The Vue.js JavaScript component (defined in a separate JavaScript file and
88
managed via Sprockets or Webpacker) will treat the response of the Ruby
99
component as its template.
1010

1111
## Structure, files and registry
1212

13-
A VueJs component is defined by two files. A Ruby file and a JavaScript file:
13+
A Vue.js component is defined by two files. A Ruby file and a JavaScript file:
1414

15-
### VueJs Ruby component
15+
### Vue.js Ruby component
1616

1717
Within the Ruby file, the Ruby class inherits from `Matestack::Ui::VueJsComponent`:
1818

@@ -48,9 +48,9 @@ module Components::Registry
4848
)
4949
end
5050
```
51-
### VueJs JavaScript component
51+
### Vue.js JavaScript component
5252

53-
The VueJs JavaScript component is defined in a separate JavaScript file:
53+
The Vue.js JavaScript component is defined in a separate JavaScript file:
5454

5555
`app/matestack/components/some_component.js`
5656

@@ -73,7 +73,7 @@ it right next to the Ruby component file.
7373

7474
*Important*
7575

76-
The VueJs JavaScript file needs to be imported by some kind of JavaScript package
76+
The Vue.js JavaScript file needs to be imported by some kind of JavaScript package
7777
manager. This could be `Sprockets` or `Webpacker`
7878

7979
For **Sprockets** it would be something like:
@@ -112,29 +112,29 @@ If setup correctly, matestack will render the component to:
112112
</component>
113113
```
114114

115-
As you can see, the component tag is referencing the VueJs JavaScript component via `is`
115+
As you can see, the component tag is referencing the Vue.js JavaScript component via `is`
116116
and tells the JavaScript component that it should use the inner html (coming from the `response` method)
117117
as the `inline-template` of the component.
118118

119119
`{{ foo }}` will be evaluated to "bar" as soon as Vue.js has booted and mounted
120120
the component in the browser.
121121

122-
Matestack will inject JSON objects into the VueJs JavaScript component through
122+
Matestack will inject JSON objects into the Vue.js JavaScript component through
123123
the `component-config` and `params` props if either component config or params are
124124
available. This data is injected once on initial serverside rendering of the component's
125-
markup. See below, how you can pass in data to the VueJs JavaScript component.
125+
markup. See below, how you can pass in data to the Vue.js JavaScript component.
126126

127-
## VueJs Ruby component API
127+
## Vue.js Ruby component API
128128

129129
### Same as component
130130

131-
The basic VueJs Ruby component API is the same as described within the
131+
The basic Vue.js Ruby component API is the same as described within the
132132
[component API documenation](/docs/api/000-base/20-component.md). The options below extend
133133
this API.
134134

135-
### Referencing the VueJs JavaScript component
135+
### Referencing the Vue.js JavaScript component
136136

137-
As seen above, the VueJs JavaScript component name has to be referenced in the VueJs
137+
As seen above, the Vue.js JavaScript component name has to be referenced in the Vue.js
138138
Ruby component using the `vue_js_component_name` class method
139139

140140
`app/matestack/components/some_component.rb`
@@ -148,7 +148,7 @@ class SomeComponent < Matestack::Ui::VueJsComponent
148148
end
149149
```
150150

151-
### Passing data to the VueJs JavaScript component
151+
### Passing data to the Vue.js JavaScript component
152152

153153
Like seen above, matestack renders a `component-config` prop as an attribute of
154154
the component tag. In order to fill in some date there, you should use the `setup`
@@ -174,9 +174,9 @@ This data is then available as:
174174
this.componentConfig["some_serverside_data"]
175175
```
176176

177-
within the VueJs JavaScript component.
177+
within the Vue.js JavaScript component.
178178

179-
## VueJs JavaScript component API
179+
## Vue.js JavaScript component API
180180

181181
### Component mixin
182182

@@ -279,6 +279,6 @@ As we're pretty much implementing pure Vue.js components, you can refer to the
279279
[Vue.js guides](https://vuejs.org/v2/guide/) in order to learn more about Vue.js component
280280
usage
281281

282-
## VueJs JavaScript component scope
282+
## Vue.js JavaScript component scope
283283

284284
TODO

docs/api/000-base/40-isolated_component.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ With `init_on` you can specify events on which the isolate components gets initi
155155

156156
#### public_options
157157

158-
You can pass data as a hash to your custom isolate component with the `public_options` option. This data is inside the isolate component accessible via a hash with indifferent access, for example `public_options[:item_id]`. All data contained in the `public_options` will be passed as json to the corresponding vue component, which means this data is visible on the client side as it is rendered in the vue component config. So be careful what data you pass into `public_options`!
158+
You can pass data as a hash to your custom isolate component with the `public_options` option. This data is inside the isolate component accessible via a hash with indifferent access, for example `public_options[:item_id]`. All data contained in the `public_options` will be passed as json to the corresponding Vue.js component, which means this data is visible on the client side as it is rendered in the Vue.js component config. So be careful what data you pass into `public_options`!
159159

160160
Due to the isolation of the component the data needs to be stored on the client side as to encapsulate the component from the rest of the UI.
161161
For example: You want to render a collection of models in single components which should be able to rerender asynchronously without rerendering the whole UI. Since we do not rerender the whole UI there is no way the component can know which of the models it should rerender. Therefore passing for example the id in the public_options hash gives you the possibility to access the id in an async request and fetch the model again for rerendering. See below for examples.
@@ -346,7 +346,7 @@ With `init_on: 'init_time'` you can specify an event on which the isolated compo
346346

347347
### Example 6 - Use custom data in isolated components
348348

349-
Like described above it is possible to use custom data in your isolated components. Just pass them as a hash to `public_options` and use them in your isolated component. Be careful, because `public_options` are visible in the raw html response from the server as they get passed to a vue component.
349+
Like described above it is possible to use custom data in your isolated components. Just pass them as a hash to `public_options` and use them in your isolated component. Be careful, because `public_options` are visible in the raw html response from the server as they get passed to a Vue.js component.
350350

351351
Lets render a collection of models and each of them should rerender when a user clicks a corresponding refresh button. Our model is called `Match`, representing a soccer match. It has an attribute called score with the current match score.
352352

@@ -401,5 +401,5 @@ end
401401
```
402402

403403
This page will render a match_isolated_score component for each match.
404-
If one of the isolated components gets rerendered we need the id in order to fetch the correct match. Because the server only resolves the isolated component instead of the whole UI it does not know which match exactly is requested unless the client requests a rerender with the match id. This is why `public_options` options are passed to the client side vue component.
404+
If one of the isolated components gets rerendered we need the id in order to fetch the correct match. Because the server only resolves the isolated component instead of the whole UI it does not know which match exactly is requested unless the client requests a rerender with the match id. This is why `public_options` options are passed to the client side Vue.js component.
405405
So if match two should be rerendered the client requests the match_isolated_score component with `public_options: { id: 2 }`. With this information our isolated component can fetch the match and rerender itself.

docs/api/000-base/50-event_hub.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
### Event Hub
1+
# Event Hub
22

33
Matestack offers an event hub, which can be used to communicate between components.
44

5-
#### Emitting events
5+
## Emitting events
66

77
`app/matestack/components/some_component.js`
88

@@ -20,7 +20,7 @@ MatestackUiCore.Vue.component('some-component', {
2020

2121
Use `MatestackUiCore.matestackEventHub.$emit(EVENT_NAME, OPTIONAL PAYLOAD)`
2222

23-
#### Receiving events
23+
## Receiving events
2424

2525
`app/matestack/components/some_component.js`
2626

docs/api/000-base/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ wrapping elements by default.
5252
#### VueJsComponent
5353

5454
In order to equip a Ruby component with some JavaScript, we associate
55-
the Ruby component with a VueJs JavaScript component. The Ruby component therefore needs to inherit
55+
the Ruby component with a Vue.js JavaScript component. The Ruby component therefore needs to inherit
5656
from `Matestack::Ui::VueJsComponent`. Matestack will then render a HTML component
5757
tag with some special attributes and props around the response defined in the
58-
Ruby component. The VueJs JavaScript component (defined in a separate JavaScript file and
58+
Ruby component. The Vue.js JavaScript component (defined in a separate JavaScript file and
5959
managed via Sprockets or Webpacker) will treat the response of the Ruby
6060
component as its template.
6161

@@ -112,8 +112,8 @@ An app is a special kind of `Matestack::Ui::VueJsComponent`. Matestack will
112112
therefore wrap the UI defined in the `response` method with some markup enabling
113113
dynamic UI behavior and CSS styling.
114114

115-
The app ships a `Vuex store` and `Vue.js event hub`, which are used by core vuejs
116-
components and can optionally be used by custom vuejs components in order to
115+
The app ships a `Vuex store` and `Vue.js event hub`, which are used by core Vue.js
116+
components and can optionally be used by custom Vue.js components in order to
117117
trigger events, manage client side date and communicate between components.
118118

119119
Learn more about [apps](/docs/api/000-base/10-app.md)

docs/api/100-components/cable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ consumer.subscriptions.create("MatestackUiCoreChannel", {
1818
## `cable(*args, &block)`
1919
----
2020

21-
Returns a vue.js driven cable component, initially containing content specified by a block.
21+
Returns a Vue.js driven cable component initially containing content specified by a block.
2222

2323
Imagine something like this:
2424

docs/api/100-components/form.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,9 @@ end
932932

933933
```
934934

935-
## Form and other VueJs components
935+
## Form and other Vue.js components
936936

937-
The child components `form_*` have to be placed within the scope of the parent `form` component, without any other VueJs component like `toggle`, `async` creating a new scope between the child component and the parent form component**
937+
The child components `form_*` have to be placed within the scope of the parent `form` component, without any other Vue.js component like `toggle`, `async` creating a new scope between the child component and the parent form component**
938938

939939

940940
```ruby

docs/guides/000-installation/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ bundle install
1818

1919
### JavaScript Setup
2020

21-
Matestack uses JavaScript and, in particular, [vuejs](http://vuejs.org). To include these into your existing rails app, matestack supports both, [webpack](https://webpack.js.org/)([er](https://github.com/rails/webpacker/)) and the [asset pipeline](https://guides.rubyonrails.org/asset_pipeline.html).
21+
Matestack uses JavaScript and, in particular, [Vue.js](http://vuejs.org). To include these into your existing rails app, matestack supports both, [webpack](https://webpack.js.org/)([er](https://github.com/rails/webpacker/)) and the [asset pipeline](https://guides.rubyonrails.org/asset_pipeline.html).
2222

2323
Rails 6+ apps use webpacker by default. Rails 5 and below apps use the asset pipeline by default.
2424

@@ -31,7 +31,7 @@ $ yarn add https://github.com/matestack/matestack-ui-core#v1.1.0
3131
$ yarn install
3232
```
3333

34-
This adds the npm package that provides the javascript corresponding to the matestack-ui-core ruby gem. Make sure that the npm package version matches the gem version. To find out what gem version you are using, you may use `bundle info matestack-ui-core`.
34+
This adds the npm package that provides the JavaScript corresponding to the matestack-ui-core ruby gem. Make sure that the npm package version matches the gem version. To find out what gem version you are using, you may use `bundle info matestack-ui-core`.
3535

3636
Next, import 'matestack-ui-core' in your `app/javascript/packs/application.js`
3737

@@ -49,7 +49,7 @@ When you update the matestack-ui-core gem, make sure to update the npm package a
4949

5050
#### Asset Pipeline
5151

52-
If you are using the asset pipeline, you don't need to install the separate npm package. All required javascript libraries are provided by the matestack-ui-core gem.
52+
If you are using the asset pipeline, you don't need to install the separate npm package. All required JavaScript libraries are provided by the matestack-ui-core gem.
5353

5454
Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
5555

docs/guides/100-tutorial/00_introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This guide is designed for Ruby on Rails beginners, advanced and experienced dev
1010

1111
## What is Matestack?
1212

13-
Matestack deeply integrates a Vue.js based UI into Ruby on Rails, offering prebuilt components. Use these prebuild components to write dynamic Web-UIs mostly in pure Ruby and with minimum effort. Matestack enables you to develop rich SPA like interfaces in no time and without touching javascript. And if you need to go deeper you can always create your own custom components to do so.
13+
Matestack deeply integrates a Vue.js based UI into Ruby on Rails, offering prebuilt components. Use these prebuild components to write dynamic Web-UIs mostly in pure Ruby and with minimum effort. Matestack enables you to develop rich SPA like interfaces in no time and without touching JavaScript. And if you need to go deeper you can always create your own custom components to do so.
1414

1515
## Concept
1616

@@ -38,11 +38,11 @@ For nearly all existing HTML5 Tags there is a component in order to create a ui
3838

3939
#### `Matestack::Ui::VueJsComponent`'s
4040

41-
VueJsComponents are more complex components. These always have a Vue.js counterpart and enable easy development of dynamic ui elements which would usually require you to write javascript code. VueJsComponents provide an abstraction so you don't have to write javascript code and instead create rich interfaces in Ruby. Visit the [components API documentation](/docs/api/100-components/) for more information about `Matestack::Ui::VueJsComponent`'s.
41+
VueJsComponents are more complex components. These always have a Vue.js counterpart and enable easy development of dynamic ui elements which would usually require you to write JavaScript code. VueJsComponents provide an abstraction so you don't have to write JavaScript code and instead create rich interfaces in Ruby. Visit the [components API documentation](/docs/api/100-components/) for more information about `Matestack::Ui::VueJsComponent`'s.
4242

4343
## Recap & outlook
4444

4545
We introduced you to the apps, pages and components concepts of matestack. In order to unterstand better how matestack works, we create an application from the ground up using matestack and enhancing it step by step while leveraging more and more features of matestack.
4646
Read the following guides to get started with matestack and get a better understanding about how apps, pages, components work.
4747

48-
Let's setup a rails app with matestack by following the [next guide](/docs/guides/100-tutorial/01_setup.md)
48+
Let's setup a rails app with matestack by following the [next guide](/docs/guides/100-tutorial/01_setup.md)

docs/guides/100-tutorial/06_async_component.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ But how can we easily update the list, when the delete action was successful? Re
6565

6666
## Rerender list when person is deleted
6767

68-
When a person is deleted an event is emitted, but nothing more happens, but we want to update the list of persons, so we no longer see the deleted person in the list. In order to achieve this we could write some javascript which would manipulate the dom or we can use matestacks `async` component and get the result we want in no time and without touching any javascript. Okay, so let's update our index page like this:
68+
When a person is deleted an event is emitted, but nothing more happens, but we want to update the list of persons, so we no longer see the deleted person in the list. In order to achieve this we could write some JavaScript which would manipulate the dom or we can use matestacks `async` component and get the result we want in no time and without touching any JavaScript. Okay, so let's update our index page like this:
6969

7070
```ruby
7171
class Demo::Pages::Persons::Index
@@ -125,6 +125,6 @@ git add . && git commit -m "add delete button to person list and update it dynam
125125

126126
## Recap & outlook
127127

128-
We added a delete button to our person list on the index page. When a person is deleted our list gets automatically updated without even reloading the page, just by updating the part that is needed. And all of that with a few lines of code and without writing any javascript.
128+
We added a delete button to our person list on the index page. When a person is deleted our list gets automatically updated without even reloading the page, just by updating the part that is needed. And all of that with a few lines of code and without writing any JavaScript.
129129

130130
Take a well deserved rest and make sure to come back to the next part of this series, introducing [partials and custom components](/docs/guides/100-tutorial/07_partials_and_custom_components.md).

0 commit comments

Comments
 (0)