Skip to content

Commit 8e75f0a

Browse files
authored
Merge pull request #64 from basemate/0.7.0_release
0.7.0 release
2 parents 735ad90 + dfad7db commit 8e75f0a

File tree

220 files changed

+1650
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+1650
-1048
lines changed

CHANGELOG.md

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,285 @@
11
# Changelog
22

3+
## v0.7.0
4+
5+
### Breaking changes for users
6+
7+
* new base class names for pages, components and apps, issue #36 (@jonasjabari)
8+
* simplified custom component structure/class names #39 (@jonasjabari)
9+
* improved vue.js component naming convention #41 (@jonasjabari)
10+
* `pg` component is now called `paragraph`, issue #47, pull #48 (@PasWen)
11+
12+
### Improvements for users
13+
14+
* added `hr` component, pull #49, (@michaelrevans)
15+
* allow actions to accept id and class attributes, issue #44, pull #50 (@michaelrevans)
16+
17+
### Breaking changes for core developers
18+
19+
* namespaced core components using `Matestack::Ui::Core` module/folder, pull #64 (@jonasjabari)
20+
* simplified core components folder structure, (aligned with issue #39), pull #64 (@jonasjabari)
21+
* changed vue.js component naming, (aligned with issue #41), pull #64 (@jonasjabari)
22+
* add-on engine components now need `Matestack::Ui` namespacing, pull #64 (@jonasjabari)
23+
24+
### Improvements for core developers
25+
26+
* started to move business logic out of `app/concepts` into `app/lib` folder in order to create a better structure (in progress --> core refactoring)
27+
28+
### Migration guide for users from v0.6.0
29+
30+
#### App base class name
31+
32+
***OLD:***
33+
34+
`app/matestack/app/example_app.rb`
35+
```ruby
36+
class Apps::ExampleApp < App::Cell::App end
37+
```
38+
39+
***NEW:***
40+
41+
`app/matestack/app/example_app.rb`
42+
```ruby
43+
class Apps::ExampleApp < Matestack::Ui::App end
44+
```
45+
46+
#### Page base class name
47+
48+
***OLD:***
49+
50+
`app/matestack/pages/example_app/example_page.rb`
51+
```ruby
52+
class Pages::ExampleApp::ExamplePage < Page::Cell::Page end
53+
```
54+
55+
***NEW:***
56+
57+
`app/matestack/pages/example_app/example_page.rb`
58+
```ruby
59+
class Pages::ExampleApp::ExamplePage < Matestack::Ui::Page end
60+
```
61+
62+
#### Custom STATIC component base class name / folder structure
63+
64+
***OLD:***
65+
66+
`app/matestack/components/card/cell/card.rb`
67+
```ruby
68+
class Components::Card::Cell::Card < Component::Cell::Static end
69+
```
70+
71+
***NEW:***
72+
73+
`app/matestack/components/card.rb`
74+
```ruby
75+
class Components::Card < Matestack::Ui::StaticComponent end
76+
```
77+
78+
#### Custom DYNAMIC component base class name / folder structure / vue.js naming
79+
80+
***OLD:***
81+
82+
`app/matestack/components/card/cell/card.rb`
83+
```ruby
84+
class Components::Card::Cell::Card < Component::Cell::Dynamic end
85+
```
86+
87+
`app/matestack/components/card/cell/card.js`
88+
```javascript
89+
MatestackUiCore.Vue.component('custom-card-cell', { ... });
90+
```
91+
92+
***NEW:***
93+
94+
`app/matestack/components/card.rb`
95+
```ruby
96+
class Components::Card < Matestack::Ui::DynamicComponent end
97+
```
98+
99+
`app/matestack/components/card.js`
100+
```javascript
101+
MatestackUiCore.Vue.component('custom-card', { ... }); //no -cell postfix
102+
```
103+
104+
#### Paragraph component
105+
106+
***OLD:***
107+
108+
`app/matestack/pages/example_app/example_page.rb`
109+
```ruby
110+
class Pages::ExampleApp::ExamplePage < Matestack::Ui::Page
111+
112+
def response
113+
components {
114+
pg do
115+
plain "some text"
116+
end
117+
}
118+
end
119+
120+
end
121+
```
122+
123+
***NEW:***
124+
125+
`app/matestack/pages/example_app/example_page.rb`
126+
```ruby
127+
class Pages::ExampleApp::ExamplePage < Matestack::Ui::Page
128+
129+
def response
130+
components {
131+
paragraph do
132+
plain "some text"
133+
end
134+
}
135+
end
136+
137+
end
138+
```
139+
140+
### Migration guide for core developers from v0.6.0
141+
142+
If you are not a CORE contributor, this part might not be relevant for you ;)
143+
144+
#### Namespaced core components + simplified core components folder/module structure
145+
146+
The core components are moved from `app/concepts` to `app/concepts/matestack/ui/core` in order to stick to the engine namespacing (used in helpers etc...) and therefore scoped like:
147+
148+
```
149+
app/concepts/matestack/ui/core
150+
|
151+
└───div
152+
│ │ div.rb (no cell folder anymore!)
153+
│ │ div.haml (no view folder anymore!)
154+
```
155+
156+
`app/concepts/matestack/ui/core/div/div.rb`
157+
```ruby
158+
module Matestack::Ui::Core::Div
159+
class Div < Matestack::Ui::Core::Component::Static
160+
161+
162+
end
163+
end
164+
```
165+
166+
We also removed the `Cell` module (`cell` folder) and the separate `js` and `view` folders in each component folder in order to simplify folder structure (as we did for custom component development as well)
167+
168+
**Note**
169+
170+
Last module name and class name of CORE components have to be the same. That doesn't apply for CUSTOM components:
171+
172+
`app/matestack/pages/example_app/example_page.rb`
173+
```ruby
174+
class Pages::ExampleApp::ExamplePage < Matestack::Ui::Page
175+
176+
def response
177+
components {
178+
#CORE
179+
div
180+
# looking for 'Matestack::Ui::Core::Div::Div'
181+
# defined in 'app/concepts/matestack/ui/core/div/div.rb'
182+
form_input
183+
# looking for 'Matestack::Ui::Core::Form::Input::Input'
184+
# defined in 'app/concepts/matestack/ui/core/form/input/input.rb'
185+
186+
#CUSTOM
187+
custom_card
188+
# looking for 'Components::Card'
189+
# defined in 'app/matestack/components/card.rb'
190+
custom_fancy_card
191+
# looking for 'Components::Fancy::Card'
192+
# defined in 'app/matestack/components/fancy/card.rb'
193+
}
194+
end
195+
196+
end
197+
```
198+
199+
The reasons why we decided to resolve core components a bit different than custom components are simple:
200+
* we want to make it as easy as possible to create custom components
201+
* we therefore removed the obligatory `Cell` module
202+
* we do not want to force the user to create a subfolder (and therefore module/namespace) in their `components` folder resulting in a class like:
203+
`Components::Card::Card`. It should be as simple as `Components::Card` which is good and intuitive!
204+
* if we would use that simple approach for all our core components, it would lead to a messy code base, as all component cells, views and javascripts live in one big folder.
205+
* we therefore enforce more structure inside the core, using a subfolder for each component within `app/concepts/matestack/ui/core` resulting in a class name for a component like: `Matestack::Ui::Core::Div::Div` (double DIV at the end --> subfolder(module name) :: class)
206+
207+
#### Changed vue.js component naming
208+
209+
Scoping all core components within `Matestack::Ui::Core` is reflected in different vue.js component name as well:
210+
211+
Example: `async` core component
212+
213+
`app/concepts/matestack/ui/core/async`
214+
```javascript
215+
//old
216+
Vue.component('async-cell', componentDef)
217+
//new
218+
Vue.component('matestack-ui-core-async', componentDef)
219+
```
220+
221+
We also removed the `-cell` postfix.
222+
223+
#### Add-on-engine component namespacing
224+
225+
Add-on-engine components now need `Matestack::Ui` namespacing:
226+
227+
Example:
228+
229+
```
230+
ADDON_ENGINE_ROOT/app/concepts/matestack/ui/materialize
231+
|
232+
└───row
233+
│ │ row.rb
234+
│ │ row.haml
235+
```
236+
237+
`ADDON_ENGINE_ROOT/app/concepts/matestack/ui/materialize/row/row.rb`
238+
```ruby
239+
module Matestack::Ui::Materialize::Row
240+
class Row < Matestack::Ui::Core::Component::Static
241+
242+
def response
243+
components {
244+
div class: "row" do
245+
yield_components
246+
end
247+
}
248+
end
249+
250+
end
251+
end
252+
```
253+
Usage:
254+
255+
`app/matestack/pages/example_app/example_page.rb`
256+
```ruby
257+
class Pages::ExampleApp::ExamplePage < Matestack::Ui::Page
258+
259+
def response
260+
components {
261+
#CORE
262+
div
263+
# looking for 'Matestack::Ui::Core::Div::Div'
264+
# defined in 'CORE_ENGINE_ROOT/app/concepts/matestack/ui/core/div/div.rb'
265+
266+
#ENGINE
267+
materialize_row
268+
# looking for 'Matestack::Ui::Materialize::Row::Row'
269+
# defined in 'ADDON_ENGINE_ROOT/app/concepts/matestack/ui/materialize/row/row.rb'
270+
}
271+
end
272+
273+
end
274+
```
275+
276+
## v0.6.0
277+
278+
### Improvements
279+
280+
* added documentation
281+
* added tests
282+
3283
## v0.6.0.pre.1
4284

5285
This release is marked as PRE. Test coverage is not sufficient at the moment.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Click here to see how you can add Matestack UI to your existing Rails applicatio
2727

2828
#### Define your UI in a Ruby Class
2929
```ruby
30-
class Pages::MyPage < Page::Cell::Page
30+
class Pages::MyPage < Matestack::Ui::Page
3131

3232
def prepare
3333
@technologies = ["Rails", "Vue.js", "Trailblazer", "Rspec", "Capybara"]
@@ -48,7 +48,7 @@ end
4848
#### Create a Single Page Application without JavaScript
4949

5050
```ruby
51-
class Apps::MyApp < App::Cell::App
51+
class Apps::MyApp < Matestack::Ui::App
5252

5353
def response
5454
components{
@@ -76,7 +76,7 @@ end
7676
```
7777

7878
```ruby
79-
class Pages::MyApp::MyFirstPage < Page::Cell::Page
79+
class Pages::MyApp::MyFirstPage < Matestack::Ui::Page
8080

8181
def response
8282
components{
@@ -89,7 +89,7 @@ class Pages::MyApp::MyFirstPage < Page::Cell::Page
8989
end
9090
```
9191
```ruby
92-
class Pages::MyApp::MySecondPage < Page::Cell::Page
92+
class Pages::MyApp::MySecondPage < Matestack::Ui::Page
9393

9494
def response
9595
components{
@@ -103,7 +103,7 @@ end
103103
```
104104
#### Handle User Interaction dynamically without JavaScript
105105
```ruby
106-
class Pages::MyPage < Page::Cell::Page
106+
class Pages::MyPage < Matestack::Ui::Page
107107

108108
def response
109109
components {
@@ -133,7 +133,7 @@ end
133133
```
134134
#### Handle User Input dynamically without JavaScript
135135
```ruby
136-
class Pages::MyApp::MyFirstPage < Page::Cell::Page
136+
class Pages::MyApp::MyFirstPage < Matestack::Ui::Page
137137

138138
def prepare
139139
@my_model = MyModel.new
@@ -173,7 +173,7 @@ end
173173
```
174174
#### Websocket Integration without JavaScript
175175
```ruby
176-
class Pages::MyPage < Page::Cell::Page
176+
class Pages::MyPage < Matestack::Ui::Page
177177

178178
def prepare
179179
@comments = Comment.last(5)

app/assets/config/basemate_ui_core_manifest.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/assets/images/basemate/ui/core/.keep

Whitespace-only changes.

app/assets/javascripts/basemate/ui/core/application.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/assets/stylesheets/basemate/ui/core/application.css

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/concepts/async/cell/async.rb

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)