hyperstack-org / hyperstack-org/hyperstack

class rename details

Đang mở
#40 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
538
Fork
41
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Current direction:

```ruby
Hyperstack::Component::Mixin # include this to create a component class
class MyComponent
include Hyperstack::Component::Mixin
end

# typically we expect the application to create a master HyperComponent base class
# using the mixin similar to ApplicationController or ApplicationRecord

Hyperstack::Component::ReactAPI # public module giving low level access to React methods

Hyperstack::Component::Internal::RenderingContext # a private internal module

# Above applies to store as well, i.e. Hyperstack::Store::Mixin

# Models are slightly different because we already have an ApplicationRecord structure:
class ApplicationRecord < ActiveRecord::Base
# makes ApplicationRecord and children isomorphic
include Hyperstack::Model::ActiveRecordAdapter
...
end

# in future we will have adapters for other ORMs and dbs as well.

# Hyperstack::Operation is also different, in that it is not sensible to use it as a mixin. Instead
# Hyperstack::Operation is the base class of all operations.
```

As I am converting current code to this format I am thinking that this name structure is slightly redundant and that we would do well to drop the Mixin, thus we would have:

```ruby
Hyperstack::Component # include this to create a component class
class MyComponent
include Hyperstack::Component
end
# typically we expect the application to create a master HyperComponent base class
# using the mixin similar to ApplicationController or ApplicationRecord

Hyperstack::Component::ReactAPI # same as currently proposed but...
# because ReactAPI is now a direct descendent of the mixin inside of the application components
# you can directly say ReactAPI.

Hyperstack::Internal::Component::RenderingContext # swap Internal and Component to
# avoid polluting application components name space

# Above applies to store as well, i.e. Hyperstack::Store is the mixin

# Models don't change from current proposal

# Hyperstack::Operation could stay the same but because its a class (not a module) we could
# change it to Hyperstack::Operation::Base, and have its predefined subclasses be:
# Hyperstack::Operation::ServerOp and Hyperstack::Operation::ControllerOp
```

Its just an idea...

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.