Skip to content

Commit eb3b1ae

Browse files
committed
ready for next point release
1 parent 41ad714 commit eb3b1ae

File tree

17 files changed

+34
-59
lines changed

17 files changed

+34
-59
lines changed

current-status.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ We now are issuing 1.0 release candidates weekly until all issues are either clo
1010

1111
| Release<br/>Date | Version | Open<br/>Issues | Documentation<br/>Sections<br/>Draft Ready | Documentation<br/>Sections<br/>WIP |
1212
|--------------|---------|-------------|-------|------|
13+
| April 12, 2021 | 1.0.alpha1.8 | 128 | 36 | 9 |
1314
| April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 |
1415
| March 29, 2021 | 1.0.alpha1.6 | 167 | 35 | 10 |
1516

docs/hyper-model/README.md

+13-43
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,7 @@ In order for Hyperstack to see your Models \(and make them Isomorphic\) you need
7272
| **Location of Models** | **Scope** |
7373
| :--- | :--- |
7474
| `app\models` | Server-side code only |
75-
| `app\Hyperstack\models` | Isomorphic code \(client and server\) |
76-
77-
### Rails 5.1.x
78-
79-
Upto Rails 4.2, all models inherited from `ActiveRecord::Base`. But starting from Rails 5, all models will inherit from `ApplicationRecord`.
80-
81-
To accommodate this change, the following file has been automatically added to models in Rails 5 applications.
82-
83-
```ruby
84-
# app/models/application_record.rb
85-
class ApplicationRecord < ActiveRecord::Base
86-
self.abstract_class = true
87-
end
88-
```
89-
90-
For Hyperstack to see this change, this file needs to be moved \(or copied if you have some server-side models\) to the `apps/Hyperstack` folder.
91-
92-
### Explicit Scope Access
93-
94-
In order to prevent unauthorized access to information like scope counts, lists of record ids, etc, Hyperstack now \(see issue [https://github.com/ruby-Hyperstack/hyper-mesh/issues/43](https://github.com/ruby-Hyperstack/hyper-mesh/issues/43)\) requires you explicitly allow scopes to be viewed on the client, otherwise you will get an AccessViolation.
95-
96-
To globally allow access to all scopes add this to the ApplicationRecord class
97-
98-
```ruby
99-
class ApplicationRecord < ActiveRecord::Base
100-
regulate_scope :all
101-
end
102-
```
75+
| `app\hyperstack\models` | Isomorphic code \(client and server\) |
10376

10477
## ActiveRecord API
10578

@@ -109,15 +82,15 @@ Hyperstack uses a subset of the standard ActiveRecord API to give your Isomorphi
10982

11083
Hyperstack integrates with React \(through Components\) to deliver your Model data to the client without you having to create extra APIs or specialized controllers. The key idea of React is that when state \(or params\) change, the portions of the display effected by this data will be updated.
11184

112-
Hyperstack automatically creates React state objects that will be updated as server side data is loaded or changes. When these states change the associated parts of the display will be updated.
85+
On the client each database record being used by the client is represented as an observable store **([see the chapter on HyperState for details](hyper-state/README.md))** which will mutate as server side data is loaded or changes. When these states change the associated parts of the display will be updated.
11386

114-
A brief overview of how this works will help you understand the how Hypeloop gets the job done.
87+
A brief overview of how this works will help you understand the how HyperStack gets the job done.
11588

11689
#### Rendering Cycle
11790

11891
On the UI you will be reading models in order to display data.
11992

120-
If during the rendering of the display the Model data is not yet loaded, placeholder values \(the default values from the `columns_hash`\) will be returned by Hyperstack.
93+
If during the rendering of the display the Model data is not yet loaded, placeholder values \(the default values from the database schema\) will be returned by Hyperstack.
12194

12295
Hyperstack then keeps track of where these placeholders \(or `DummyValue`s\) are displayed, and when they do get loaded, those parts of the display will re-render.
12396

@@ -143,7 +116,7 @@ There are a number of methods that allow you to interact with this load cycle wh
143116

144117
#### New and Create
145118

146-
`new`: Takes a hash of attributes and initializes a new unsaved record. The values of any attributes not specified in the hash will be taken from the Models default values specified in the `columns_hash`.
119+
`new`: Takes a hash of attributes and initializes a new unsaved record. The values of any attributes not specified in the hash will be taken from the Models default values specified in the data base schema.
147120

148121
If `new` is passed a native javascript object it will be treated as a hash and converted accordingly.
149122

@@ -209,7 +182,7 @@ Word.offset(500).limit(20) # get words 500-519
209182

210183
#### Applying Class Methods to Collections
211184

212-
Like Rails if you define a class method on a model, you can apply it to collection of those records, allowing you
185+
Like Rails if you define a class method on a model, you can apply it to a collection of those records, allowing you
213186
to chain methods with scopes (and relationships)
214187

215188
```ruby
@@ -264,6 +237,9 @@ class User < ActiveRecord::Base
264237
end
265238
```
266239

240+
241+
242+
267243
Sometimes it is desirable to only run the method on the server. This can be done using the `server_method` macro:
268244

269245
```ruby
@@ -284,7 +260,7 @@ To force the value to be recomputed at the server append a `!` to the end of the
284260

285261
`columns_hash`: returns the details of the columns specification. Note that on the server `columns_hash` returns a hash of objects specifying column information. On the client the entire structure is just one big hash of hashes.
286262

287-
`abstract_class=`, `abstract_class?`, `primary_key`, `primary_key=`, `inheritance_column`, `inheritance_column=`, `model_name`, `serialize`, `alias_attribute`, `table_name`: All work as on the server. See ActiveRecord documentation for more info.
263+
`abstract_class=`, `abstract_class?`, `primary_key`, `primary_key=`, `inheritance_column`, `inheritance_column=`, `model_name`: All work as on the server. See ActiveRecord documentation for more info.
288264

289265
### Instance Methods
290266

@@ -313,10 +289,6 @@ end
313289

314290
After a save operation completes the models will have an `errors` hash \(just like on the server\) with any validation problems.
315291

316-
`save` does not fail, but rather returns `{success: false ...}`. If there was an
317-
exception the `message` key will hold the error information, otherwise the errors will
318-
be stored in the records error data (as on the server.)
319-
320292
During the save operation the method `saving?` will return `true`. This can be used to instead of \(or with\) the promise to update the screen:
321293

322294
```ruby
@@ -337,9 +309,7 @@ end
337309

338310
Like `save` destroy returns a promise that is resolved when the destroy completes.
339311

340-
After the destroy completes successfully the record's `destroyed?` method will return true.
341-
342-
Like `save` destroy never fails, but rather returns `{success: false...}`
312+
After the destroy completes the record's `destroyed?` method will return true.
343313

344314
#### Other Instance Methods
345315

@@ -397,12 +367,12 @@ The `load` method takes a list of attributes \(symbols\) and will insure these a
397367
before_mount do
398368
Todo.find(1).load(:name).then do |name|
399369
@name = name;
400-
mutate @loaded = true
370+
state.loaded! true
401371
end
402372
end
403373
```
404374

405-
> Think hard about how you are using this, as Hyperstack already acts as flux store, and is managing state for you. It may be you are just creating a redundant store!
375+
Think hard about how you are using this, as Hyperstack already acts as flux store, and is managing state for you. It may be you are just creating a redundant store!
406376

407377
## Client Side Scoping
408378

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ We now are issuing 1.0 release candidates weekly until all issues are either clo
4646

4747
| Release<br/>Date | Version | Open<br/>Issues | Documentation<br/>Sections<br/>Draft Ready | Documentation<br/>Sections<br/>WIP |
4848
|--------------|---------|-------------|-------|------|
49-
| April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 |
49+
| April 12, 2021 | 1.0.alpha1.8 | 128 | 36 | 9 |
5050

5151
> Open issues includes enhancements, documentation, and discussion issues as well as few bugs.
5252
>

release-notes/1.0.alpha1.8.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Release<br/>Date | Version | Open<br/>Issues | Documentation<br/>Sections<br/>Draft Ready | Documentation<br/>Sections<br/>WIP |
44
|--------------|---------|-------------|-------|------|
5-
| April 12, 2021 | 1.0.alpha1.8 | ?? | ?? | ?? |
5+
| April 12, 2021 | 1.0.alpha1.8 | 127 | 36 | 9 |
66
| April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 |
77
| March 29, 2021 | 1.0.alpha1.6 | 167 | 35 | 10 |
88
> Open issues includes enhancements, documentation, and discussion issues as well as few bugs. Additional issues
@@ -23,11 +23,15 @@ None
2323
None
2424

2525
### Feature Added
26+
27+
+ [#402](https://github.com/hyperstack-org/hyperstack/issues/402) Class level
28+
`initialize` method will be called at boot for Observers
2629
+ [#401](https://github.com/hyperstack-org/hyperstack/issues/401) Can call `receives` inside the singleton class.
2730

31+
2832
### Fixed
2933

30-
None
34+
+ [#403](https://github.com/hyperstack-org/hyperstack/issues/403) Fixed: `isomorphic` method only worked before mounting
3135

3236
### Not Reproducible
3337

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module Component
3-
VERSION = '1.0.alpha1.7' # '1.0.alpha1.5'
3+
VERSION = '1.0.alpha1.8' # '1.0.alpha1.5'
44
end
55
end
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperloop
22
module Console
3-
VERSION = '1.0.alpha1.7'
3+
VERSION = '1.0.alpha1.8'
44
end
55
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperI18n
2-
VERSION = '1.0.alpha1.7'
2+
VERSION = '1.0.alpha1.8'
33
end
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module I18n
3-
VERSION = '1.0.alpha1.7'
3+
VERSION = '1.0.alpha1.8'
44
end
55
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperModel
2-
VERSION = '1.0.alpha1.7'
2+
VERSION = '1.0.alpha1.8'
33
end
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
class Operation
3-
VERSION = '1.0.alpha1.7'
3+
VERSION = '1.0.alpha1.8'
44
end
55
end
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperRouter
2-
VERSION = '1.0.alpha1.7'
2+
VERSION = '1.0.alpha1.8'
33
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperSpec
2-
VERSION = '1.0.alpha1.7'
2+
VERSION = '1.0.alpha1.8'
33
end
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module State
3-
VERSION = '1.0.alpha1.7'
3+
VERSION = '1.0.alpha1.8'
44
end
55
end
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Hyperstack
22
module Legacy
33
module Store
4-
VERSION = '1.0.alpha1.7'
4+
VERSION = '1.0.alpha1.8'
55
end
66
end
77
end
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperTrace
2-
VERSION = '1.0.alpha1.7'
2+
VERSION = '1.0.alpha1.8'
33
end
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module Config
3-
VERSION = '1.0.alpha1.7'
3+
VERSION = '1.0.alpha1.8'
44
end
55
end
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Hyperstack
2-
ROUTERVERSION = VERSION = '1.0.alpha1.7'
2+
ROUTERVERSION = VERSION = '1.0.alpha1.8'
33
end

0 commit comments

Comments
 (0)