Skip to content

Commit fad7b20

Browse files
committed
adjusted docs and README
1 parent 6ad5477 commit fad7b20

File tree

9 files changed

+823
-38
lines changed

9 files changed

+823
-38
lines changed

README.md

Lines changed: 719 additions & 16 deletions
Large diffs are not rendered by default.

docs/reactive_apps/100-rails_integration/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,50 @@
22

33
Matestack apps and pages are connected to Rails through controllers and controller actions. HTTP requests are handled through classic Rails routing and responded through Rails controller actions. Just let the controller action render Matestack page instead of a Rails view at the end. Optionally you can use apps on controller or action level in order to wrap the page with a layout written in pure Ruby.
44

5+
## JavaScript Setup
6+
7+
Matestack's JavaScript needs to be integrated into your Rails application in order to use the reactive, JavaScript driven features. You can use Webpacker (recommended) or Rails assets pipeline to do this.
8+
9+
### Webpacker
10+
11+
Add 'matestack-ui-core' to your `package.json` by running:
12+
13+
```
14+
$ yarn add https://github.com/matestack/matestack-ui-core#v1.1.0
15+
$ yarn install
16+
```
17+
18+
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`.
19+
20+
Next, import 'matestack-ui-core' in your `app/javascript/packs/application.js`
21+
22+
```js
23+
import MatestackUiCore from 'matestack-ui-core'
24+
```
25+
26+
and compile the JavaScript code with webpack:
27+
28+
```
29+
$ bin/webpack --watch
30+
```
31+
32+
**When you update the matestack-ui-core gem, make sure to update the npm package as well.**
33+
34+
### Asset Pipeline
35+
36+
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.
37+
38+
Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
39+
40+
```javascript
41+
//= require matestack-ui-core
42+
```
43+
44+
### Turbolinks
45+
46+
We recommend to (remove/deactivate)(https://stackoverflow.com/a/38649595) turbolinks, as there is no reason to use it alongside matestack-ui-core and there might appear some strange side effects. If you encounter strange page-transition/form-submit/action-submit behavior and have turbolinks activated, try to deactivate it first.
47+
48+
549
## Rails layouts still required
650

751
Even if a Matestack app defines the layout of the UI, you need a classic Rails layout in order to get things running:

docs/reactive_components/100-rails_integration/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Rails integration
22

3+
## JavaScript Setup
4+
35
Matestack's JavaScript needs to be integrated into your Rails application in order to use the reactive, JavaScript driven features. You can use Webpacker (recommended) or Rails assets pipeline to do this.
46

5-
## Webpacker
7+
### Webpacker
68

79
Add 'matestack-ui-core' to your `package.json` by running:
810

@@ -27,7 +29,7 @@ $ bin/webpack --watch
2729

2830
**When you update the matestack-ui-core gem, make sure to update the npm package as well.**
2931

30-
## Asset Pipeline
32+
### Asset Pipeline
3133

3234
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.
3335

@@ -37,7 +39,7 @@ Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
3739
//= require matestack-ui-core
3840
```
3941

40-
## Turbolinks
42+
### Turbolinks
4143

4244
We recommend to (remove/deactivate)(https://stackoverflow.com/a/38649595) turbolinks, as there is no reason to use it alongside matestack-ui-core and there might appear some strange side effects. If you encounter strange page-transition/form-submit/action-submit behavior and have turbolinks activated, try to deactivate it first.
4345

docs/start/100-installation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This guide shows you how to add matestack-ui-core to an existing rails application.
44

5-
If you want to use Matestack's optional reactivity features, please follow this [guide](/docs/reactivity/100-rails-integration/) after performed the following steps for basic installation:
5+
If you want to use Matestack's optional reactivity features, please follow this [guide](/docs/reactive_components/100-rails-integration/) after performed the following steps for basic installation:
66

77
## Installation
88

docs/start/200-about/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# About Matestack
2+
3+
## Who we are
4+
5+
We are a small team of passionated Ruby developers commited to put everything we have into creating sustainable Ruby gems simplifying web software development for developers around the world. The core members of our team are Nils ans Jonas working from Dresden and Berlin, Germany. Jonas as the founder of the company is working full time at matestack. Nils contributes as a working stundent part time and writes his master's thesis about matestack's technology. In Februar 2021 he wants to join full time! We're Ruby developers but take different roles at the company: Jonas once created the first versions of `matestack-ui-core` starting in 2018 but has now transitioned to handling business, management, sales and marketing. Nils joined 2020 and is now taking the engineering lead role, managing our tech development.
6+
7+
We are a bootstrapped company offering software development/consulting services to our clients and at the same time creating open source Ruby gems. The revenue earned from our services is used to invest more time implementing and maintaining our gems. We do not get money from investors.
8+
9+
## Why we do what we do
10+
11+
We are passionated Ruby developers. In specific: we love to create web applications based on Ruby On Rails.
12+
13+
In order to create dynamic, app-like web applications, we once started to create fullblown JavaScript applications and reduced Rails to a pure JSON API. Using this common approach, compared to the classic single-repo MVC structure, we increased the complexity in our development by introducing a separate full-blown frontend framework. Implementing two separate systems (backend-api, frontend-app) is a pain: Two different code bases, two repositories to maintain, two different deployment schedules, two test environments, two everything...! And then add native app development for iOS and Android on top of that! Being a small dev team, we decided not to adopt this modern web development complexity and decided to create... `matestack-ui-core`!
14+
15+
`matestack-ui-core` enables us to define sophisticated UI behavior in pure Ruby without touching JavaScript and HTML. We end up writing 50% less code while increasing productivity, maintainability and developer happiness. We love it and want to share that gift with other Ruby developers around the world.
16+
17+
The main goals are:
18+
19+
- Reduction of complexity of modern web development, moving front and backend closer together
20+
- More maintainable UI code, using a component-based structure written in Ruby
21+
- Increased development speed and happiness, offering prebuilt UI-Components for typical requirements
22+
- Modern, dynamic UI feeling without the need to implement a separate JavaScript Application

docs/start/300-community/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Community
2+
3+
We're happy about every single active community member. Asking questions, creating GitHub Issues, adjusting things through PRs... every kind of community activity counts!
4+
5+
## Discord server
6+
7+
Once started with a Gitter chat, we moved to a Discord server in November 2020. Join [here](https://discord.gg/c6tQxFG) in order to get support while creating awesome stuff with Matestack! Happy to see you there!
8+
9+
## Weekly Q/A sessions
10+
11+
In order to help you with any issues around Matestack, we offer free, personal Q/A sessions two times a week:
12+
13+
- Tuesday, 10 AM CET
14+
- Thursday, 6 PM CET
15+
16+
Join [here](https://discord.gg/c6tQxFG) to get the links to the video calls, shared a bit in advance of each Q/A session.

docs/start/1500-contribute/README.md renamed to docs/start/400-contribute/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Core Contribution
2+
23
We are very happy about anyone that wants to improve this project! Please make sure to read this guide before starting your work to avoid unnecessary trouble down the road!
3-
Always feel welcomed to reach out to us via [Gitter](https://gitter.im/basemate/community) or mail if you are unsure or need further information.
4+
Always feel welcomed to reach out to us via [Discord](https://discord.gg/c6tQxFG) or mail if you are unsure or need further information.
45

56
## What to work on
67

docs/start/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# Matestack UI Core Docs
22

3-
Welcome to the docs of the Ruby gem `matestack-ui-core`, enabling you to easily create component based (reactive) web UIs in pure Ruby on top of your Rails applications.
3+
Welcome to the docs of the Ruby gem `matestack-ui-core`!
44

5-
The docs cover following main topics:
5+
Matestack enables you to craft maintainable web UIs in pure Ruby, skipping ERB and HTML. UI code becomes a native and fun part of your Rails app. Thanks to reactive core components, reactivity can be optionally added on top without writing JavaScript, just using a simple Ruby DSL.
66

7-
- Installation and general information
8-
- UI components in pure Ruby
9-
- Reactive components in pure Ruby
10-
- Reactive apps in pure Ruby
7+
You end up writing 50% less code while increasing productivity, maintainability and developer happiness. Work with pure Ruby. If necessary, extend with pure JavaScript. No Opal involved.
118

9+
The docs cover following main topics:
1210

13-
## [Installation](/docs/start/100-installation/)
11+
**[Installation](/docs/start/100-installation/)**
1412

1513
Learn how to properly set up and update matestack-ui-core with your existing Rails application.
1614

17-
## [UI components in pure Ruby](/docs/ui_components/README.md)
15+
**[UI components in pure Ruby](/docs/ui_components/README.md)**
1816

1917
Craft your UI based on your components written in pure Ruby. Utilizing Ruby's amazing language features, you're able to create a cleaner and more maintainable UI implementation.
2018

21-
## [Reactive components in pure Ruby](/docs/reactive_components/README.md)
19+
**[Reactive components in pure Ruby](/docs/reactive_components/README.md)**
2220

2321
What about going even one step further and implement **REACTIVE** UIs in pure Ruby? Matestack's reactive core components can be used with a simple Ruby DSL enabling you to create reactive UIs without touching JavaScript!
2422

25-
## [Reactive apps in pure Ruby](/docs/reactive_apps/README.md)
23+
**[Reactive apps in pure Ruby](/docs/reactive_apps/README.md)**
2624

2725
The last step in order to leverage the full Matestack power: Create app (~Rails layout) and page (Rails ~view) classes and implement dynamic page transitions without any JavaScript implementation required.

docs/ui_components/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ end
2828

2929
Such a component is defined within your application. We call them custom components. While implementing these, you use Matestack's core components in order to define your UI: Above we used methods like `heading`, `paragraph`, `img` and `div`. These are all what we call core components provided trough a core component registry which is automatically loaded. These core components representing the corresponding HTML tags. Calling `div` for example would result in `<div></div>` after rendering. Matestack provides a always expanding wide set of w3c's specified HTML tags, enabling you to write UIs in pure Ruby. All available components are listed in our [components api](/docs/api/100-components/).
3030

31-
## Accessing data in components
32-
33-
In components you have access to your helpers and all Rails helpers. You don't have access to controller instance variables, because components should be reusable everywhere and therefore not depend on instance variables set in controller actions.
34-
35-
To access data inside components we can define required and/or optional properties which are passed to the component via hash and used with getter methods in the component. Our `card` for example requires a body in order to show a minimal Bootstrap card.
36-
37-
3831
## Component registry
3932

4033
In order to use your custom component we need to register the component. We therefore need to create a component registry. We could place it anywhere we want, but we recommend placing it inside the components folder. It is possible to have multiple component registries, for example to keep shop components seperated from management components. Create a file called `registry.rb` in `app/matestack/components/`.
@@ -93,3 +86,9 @@ class Components::Products::Detail < Matestack::Ui::Component
9386
end
9487

9588
```
89+
90+
## Accessing data in components
91+
92+
In components you have access to your helpers and all Rails helpers. You don't have access to controller instance variables, because components should be reusable everywhere and therefore not depend on instance variables set in controller actions.
93+
94+
To access data inside components we can define required and/or optional properties which are passed to the component via hash and used with getter methods in the component. Our `card` for example requires a body in order to show a minimal Bootstrap card.

0 commit comments

Comments
 (0)