Skip to content

Commit 527d9eb

Browse files
Rename Vuejs and vue references in doc/ to Vue.js
1 parent abcf11d commit 527d9eb

File tree

7 files changed

+50
-50
lines changed

7 files changed

+50
-50
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/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/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/100-tutorial/09_custom_vue_js_components.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Essential Guide 9: Custom vue.js components
1+
# Essential Guide 9: Custom Vue.js components
22

33
Demo: [Matestack Demo](https://demo.matestack.io)<br>
44
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
@@ -7,10 +7,10 @@ Welcome to the ninth part of our tutorial about building a web application with
77

88
## Introduction
99

10-
In a [previous guide](/docs/guides/100-tutorial/08_collection_async.md), we introduced custom components. In this one, we're bringing it to the next level with custom vue.js components!
10+
In a [previous guide](/docs/guides/100-tutorial/08_collection_async.md), we introduced custom components. In this one, we're bringing it to the next level with custom Vue.js components!
1111

1212
In this guide, we will
13-
- add a custom vue.js component that fetches and displays data from a third-party API
13+
- add a custom Vue.js component that fetches and displays data from a third-party API
1414

1515
## Prerequisites
1616

@@ -20,9 +20,9 @@ We expect you to have successfully finished the [previous guide](/docs/guides/10
2020

2121
We want to display an option for what you could do with the person at its show page. Therefore we want to fetch a json api and display content of the responses on the page.
2222

23-
We can achieve this by creating a custom vue.js component. A custom vue.js component is different from a custom component in the way that it needs a corresponding javascript file, which implements the frontend counterpart of our custom vue.js component.
23+
We can achieve this by creating a custom Vue.js component. A custom Vue.js component is different from a custom component in the way that it needs a corresponding javascript file, which implements the frontend counterpart of our custom Vue.js component.
2424

25-
Okay, let's create our custom vue.js component. First we create a component in `app/matestack/components/persons/activity.rb`.
25+
Okay, let's create our custom Vue.js component. First we create a component in `app/matestack/components/persons/activity.rb`.
2626

2727
```ruby
2828
class Components::Persons::Activity < Matestack::Ui::VueJsComponent
@@ -46,10 +46,10 @@ class Components::Persons::Activity < Matestack::Ui::VueJsComponent
4646
end
4747
```
4848

49-
Our vue.js component renders a div containing a paragraph and a list. The paragraph contains some text and a button. We set a `v-on:click` event handler like you would normally do in vue.js with its shorter version `@click`. This means the button will call the `addActivity` method from its corresponding vue.js component. In the list below we assume that our javascript vue.js component has an `activities` array. We loop over it, again using vue.js directives and display each activity with a button labelled 'Remove' which calls `deleteActivity(index)` if clicked.
49+
Our Vue.js component renders a div containing a paragraph and a list. The paragraph contains some text and a button. We set a `v-on:click` event handler like you would normally do in Vue.js with its shorter version `@click`. This means the button will call the `addActivity` method from its corresponding Vue.js component. In the list below we assume that our javascript Vue.js component has an `activities` array. We loop over it, again using Vue.js directives and display each activity with a button labelled 'Remove' which calls `deleteActivity(index)` if clicked.
5050

5151
Like stated above, a `Matestack::Ui::VueJsComponent` requires a javascript counterpart.
52-
Inside we define a vue.js component and give it a name. The name needs to equal the name we defined in our ruby component at the top with `vue_js_component_name`. This settings is necessary in order to connect the javascript component with our ruby component.
52+
Inside we define a Vue.js component and give it a name. The name needs to equal the name we defined in our ruby component at the top with `vue_js_component_name`. This settings is necessary in order to connect the javascript component with our ruby component.
5353
Let's create it aside our ruby component in `app/matestack/components/persons/activity.js`
5454

5555
```javascript
@@ -79,7 +79,7 @@ MatestackUiCore.Vue.component('person-activity', {
7979
});
8080
```
8181

82-
As you can see, we're making use of [The Bored API](https://boredapi.com) to fill an (initially empty) array with strings. The `addActivity` method calls the api and pushes the activity from the response into the activities array. Because vue.js is reactive, our list specified in the ruby component will be updated and contain the added activity. Clicking the delete button will remove the activity and therefore remove the entry from the list.
82+
As you can see, we're making use of [The Bored API](https://boredapi.com) to fill an (initially empty) array with strings. The `addActivity` method calls the api and pushes the activity from the response into the activities array. Because Vue.js is reactive, our list specified in the ruby component will be updated and contain the added activity. Clicking the delete button will remove the activity and therefore remove the entry from the list.
8383

8484
After creating the new component, we still need to register it, both in the `/app/matestack/components/registry.rb`
8585

@@ -142,9 +142,9 @@ Again, don't forget to save your progress to Git. In the repo root, run
142142
git add . && git commit -m "Add activity dynamic component to display activities from The Bored API"
143143
```
144144

145-
## More information on custom vue.js components
145+
## More information on custom Vue.js components
146146

147-
The existing components inside matestack aim to cover as many use cases as possible, abstracting away most of the JavaScript for generic, recurring use cases. This way, you can stick to Ruby logic and focus on building business logic instead of re-implementing basic JavaScript functionality. There sometimes is, however, a valid case for specific, handcrafted client side functionality. Therefore, matestack offers the option of creating custom vue.js components. Go ahead and [check the Vue.js guides](https://vuejs.org/v2/guide/) if you have never used it before.
147+
The existing components inside matestack aim to cover as many use cases as possible, abstracting away most of the JavaScript for generic, recurring use cases. This way, you can stick to Ruby logic and focus on building business logic instead of re-implementing basic JavaScript functionality. There sometimes is, however, a valid case for specific, handcrafted client side functionality. Therefore, matestack offers the option of creating custom Vue.js components. Go ahead and [check the Vue.js guides](https://vuejs.org/v2/guide/) if you have never used it before.
148148

149149
As with custom components, there are hardly any limits for your creativity. You can also
150150
- use `haml` (and in the future `slim` and `erb`) for templating
@@ -156,6 +156,6 @@ To learn more, check out the [basic building blocks](/docs/guides/200-200-basic_
156156

157157
## Recap & outlook
158158

159-
In this guide, we introduced custom vue.js components - an option for you to bring more complex JavaScript functionality to your application by extending matestacks components with your own Vue.js components.
159+
In this guide, we introduced custom Vue.js components - an option for you to bring more complex JavaScript functionality to your application by extending matestacks components with your own Vue.js components.
160160

161161
Let's go ahead and learn how to best add [styling and notifications](/docs/guides/100-tutorial/10_styling_notifications.md) to our application in the next part of the series!

0 commit comments

Comments
 (0)