Skip to content

Commit e8a5ca8

Browse files
Merge branch 'edge' of https://github.com/hyperstack-org/hyperstack into edge
2 parents 9d34715 + f5c3f69 commit e8a5ca8

File tree

34 files changed

+261
-123
lines changed

34 files changed

+261
-123
lines changed

.travis.yml

Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,60 @@ cache:
33
bundler: true
44
directories:
55
- node_modules # NPM packages
6-
addons:
7-
apt:
8-
sources:
9-
- sourceline: 'deb http://dl.yarnpkg.com/debian/ stable main'
10-
key_url: 'http://dl.yarnpkg.com/debian/pubkey.gpg'
11-
- sourceline: 'deb http://dl.google.com/linux/chrome/deb/ stable main'
12-
key_url: 'https://dl-ssl.google.com/linux/linux_signing_key.pub'
13-
packages:
14-
- chromium-chromedriver
15-
- google-chrome-stable
16-
- yarn
17-
mariadb: '10.3'
186
env:
19-
- COMPONENT=hyper-component LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
20-
#- COMPONENT=hyper-console LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
21-
- COMPONENT=hyper-i18n LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
22-
- COMPONENT=hyper-model LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
23-
- COMPONENT=hyper-operation LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
24-
- COMPONENT=hyper-router LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
25-
- COMPONENT=hyper-spec LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
26-
- COMPONENT=hyper-state LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
27-
- COMPONENT=hyper-store LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
7+
# - COMPONENT=hyper-component LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
8+
# #- COMPONENT=hyper-console LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
9+
# - COMPONENT=hyper-i18n LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
10+
# - COMPONENT=hyper-model LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
11+
# - COMPONENT=hyper-operation LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
12+
# - COMPONENT=hyper-router LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
13+
# - COMPONENT=hyper-spec LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
14+
# - COMPONENT=hyper-state LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
15+
# - COMPONENT=hyper-store LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
2816
- COMPONENT=hyper-trace LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
29-
- COMPONENT=rails-hyperstack LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
30-
- COMPONENT=hyperstack-config LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
31-
before_install:
32-
# yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package
33-
# must remove this zombie for new yarn to work
34-
- sudo rm -f /usr/local/bin/yarn
35-
- gem install bundler
36-
- nvm install 10
37-
- if [[ "$LANGUAGE" == "ruby" ]]; then rvm install $LANGUAGE_VERSION; fi
38-
- ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver
39-
before_script:
40-
- cd $LANGUAGE/$COMPONENT
41-
- if [[ "$LANGUAGE" == "ruby" ]]; then bundle install --jobs=3 --retry=3; fi
42-
- if [[ "$LANGUAGE" == "ruby" ]]; then bundle exec rake spec:prepare; fi
43-
- google-chrome --version
44-
- which google-chrome
45-
- yarn install
46-
script:
47-
- if [[ "$LANGUAGE" == "ruby" ]]; then DRIVER=travis bundle exec rake; fi
48-
49-
deploy:
50-
- provider: rubygems
51-
api_key:
52-
secure: "ORJMyp20YFCkvujBfxoDPwEZy8R8YJaKwRhHZUDTPZPiS84mJA7Mqd0JjvRlF0mlH/WzspruM7hZV0CuMU8F/0raRhSUU9RBh5veZ/4ij9kboCYnfuqBVt6qPRtaf8DgKe7CWGioUrTISJCVKLnygY6gZd2aFXCEbqZMrkUvC7y43ymOoFoeyCLsXC0j5uJxdHgNfbaIUetIl2DQJUbC2Rgq1Iaxvi72Ae97TR2xRCu+ko8DopRpQCug6U81IhzXftizGfKwzecqVFjuMn3XEf+UDlU6xbvwWWkcwjYNAbP2Kk+mWwUMx36s+1Pyx8MOveYLTwnQJ6gHocZHzh7WJOD548JNU3F5oXIlUB4EzD20bCSIeRKOdxTuKrNk7W3a5qGERuQi4rkIlkKaFIBP55IkliUxvYxqr0WujsjO2reRcNhNcLVGCOaX6LZbWFR5bf0WiEOL4vOxPNw66sI2JVHoMmQeAYtL2ghxikdSPXKRc+inT3QiRBsh+ns8YrAP7sV4lX6r/qyWUtPh6kY8xIeTP4VzMviyf20m5u++omao/FSEtVnU3cro5KjrZLg3ILg4NpNG+xoRqPS/Hmxry5ZPrggqNrxoqWuO7pLd/NnV/AnLiT8rd2P0PTriP9uRIM8+fFfyOeGwbplOLrbWUPnCdQVWp6dYOrNgE2yDJ/I="
53-
on:
54-
tags: true
55-
condition: $LANGUAGE = ruby
17+
# - COMPONENT=rails-hyperstack LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
18+
# - COMPONENT=hyperstack-config LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
19+
jobs:
20+
include:
21+
- stage: test
22+
addons:
23+
apt:
24+
sources:
25+
- sourceline: 'deb http://dl.yarnpkg.com/debian/ stable main'
26+
key_url: 'http://dl.yarnpkg.com/debian/pubkey.gpg'
27+
- sourceline: 'deb http://dl.google.com/linux/chrome/deb/ stable main'
28+
key_url: 'https://dl-ssl.google.com/linux/linux_signing_key.pub'
29+
packages:
30+
- chromium-chromedriver
31+
- google-chrome-stable
32+
- yarn
33+
mariadb: '10.3'
34+
before_install:
35+
# yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package
36+
# must remove this zombie for new yarn to work
37+
- sudo rm -f /usr/local/bin/yarn
38+
- gem install bundler
39+
- nvm install 10
40+
- if [[ "$LANGUAGE" == "ruby" ]]; then rvm install $LANGUAGE_VERSION; fi
41+
- ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver
42+
before_script:
43+
- cd $LANGUAGE/$COMPONENT
44+
- if [[ "$LANGUAGE" == "ruby" ]]; then bundle install --jobs=3 --retry=3; fi
45+
- if [[ "$LANGUAGE" == "ruby" ]]; then bundle exec rake spec:prepare; fi
46+
- google-chrome --version
47+
- which google-chrome
48+
- yarn install
49+
script:
50+
- if [[ "$LANGUAGE" == "ruby" ]]; then DRIVER=travis bundle exec rake; fi
51+
- stage: deploy
52+
before_script:
53+
- cd $LANGUAGE/$COMPONENT
54+
script:
55+
- echo deploying $COMPONENT
56+
deploy:
57+
- provider: rubygems
58+
api_key:
59+
secure: "ORJMyp20YFCkvujBfxoDPwEZy8R8YJaKwRhHZUDTPZPiS84mJA7Mqd0JjvRlF0mlH/WzspruM7hZV0CuMU8F/0raRhSUU9RBh5veZ/4ij9kboCYnfuqBVt6qPRtaf8DgKe7CWGioUrTISJCVKLnygY6gZd2aFXCEbqZMrkUvC7y43ymOoFoeyCLsXC0j5uJxdHgNfbaIUetIl2DQJUbC2Rgq1Iaxvi72Ae97TR2xRCu+ko8DopRpQCug6U81IhzXftizGfKwzecqVFjuMn3XEf+UDlU6xbvwWWkcwjYNAbP2Kk+mWwUMx36s+1Pyx8MOveYLTwnQJ6gHocZHzh7WJOD548JNU3F5oXIlUB4EzD20bCSIeRKOdxTuKrNk7W3a5qGERuQi4rkIlkKaFIBP55IkliUxvYxqr0WujsjO2reRcNhNcLVGCOaX6LZbWFR5bf0WiEOL4vOxPNw66sI2JVHoMmQeAYtL2ghxikdSPXKRc+inT3QiRBsh+ns8YrAP7sV4lX6r/qyWUtPh6kY8xIeTP4VzMviyf20m5u++omao/FSEtVnU3cro5KjrZLg3ILg4NpNG+xoRqPS/Hmxry5ZPrggqNrxoqWuO7pLd/NnV/AnLiT8rd2P0PTriP9uRIM8+fFfyOeGwbplOLrbWUPnCdQVWp6dYOrNgE2yDJ/I="
60+
on:
61+
tags: true
62+
condition: $LANGUAGE = ruby

install/rails-webpacker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# ----------------------------------- Add the gems
1010

1111
gem 'webpacker'
12-
gem 'rails-hyperstack', github: 'hyperstack-org/hyperstack', branch: 'edge', glob: 'ruby/*/*.gemspec'
12+
gem 'rails-hyperstack', '~> 1.0.alpha' # github: 'hyperstack-org/hyperstack', branch: 'edge', glob: 'ruby/*/*.gemspec'
1313

1414
gem_group :development do
1515
gem 'foreman'

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Hyperstack
22

3-
This is the edge branch - for current status on development see [current status.](https://github.com/hyperstack-org/hyperstack/blob/edge/current-status.md)
3+
[![Build Status](https://travis-ci.org/hyperstack-org/hyperstack.svg?branch=edge)](https://travis-ci.org/hyperstack-org/hyperstack)
44

5-
Visit the legacy branch for the current stable and released Hyperloop (old name) system. [![Build Status](https://travis-ci.org/hyperstack-org/hyperstack.svg?branch=hyperloop-legacy)](https://travis-ci.org/hyperstack-org/hyperstack)
5+
This is the edge branch - the system is stable, and there are approx 1000 test specs passig. For current status on development see [current status.](https://github.com/hyperstack-org/hyperstack/blob/edge/current-status.md)
66

77
Hyperstack is a Ruby-based DSL and modern web toolkit for building spectacular, interactive web applications fast!
88

ruby/examples/misc/stock-tickers/Gemfile.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PATH
22
remote: ../../../hyper-component
33
specs:
4-
hyper-component (0.1)
5-
hyper-state (= 0.1)
6-
hyperstack-config (= 0.1)
4+
hyper-component (1.0.alpha1)
5+
hyper-state (= 1.0.alpha1)
6+
hyperstack-config (= 1.0.alpha1)
77
libv8 (~> 6.3.0)
88
mini_racer (~> 0.1.15)
99
opal (>= 0.11.0, < 0.12.0)
@@ -13,7 +13,7 @@ PATH
1313
PATH
1414
remote: ../../../hyper-spec
1515
specs:
16-
hyper-spec (0.1)
16+
hyper-spec (1.0.alpha1)
1717
capybara
1818
chromedriver-helper (= 1.2.0)
1919
libv8 (~> 6.3.0)
@@ -32,20 +32,20 @@ PATH
3232
PATH
3333
remote: ../../../hyper-state
3434
specs:
35-
hyper-state (0.1)
36-
hyperstack-config (= 0.1)
35+
hyper-state (1.0.alpha1)
36+
hyperstack-config (= 1.0.alpha1)
3737
opal (>= 0.11.0, < 0.12.0)
3838

3939
PATH
4040
remote: ../../../hyper-trace
4141
specs:
42-
hyper-trace (0.1.0)
43-
hyperstack-config (= 0.1.0)
42+
hyper-trace (1.0.alpha1)
43+
hyperstack-config (= 1.0.alpha1)
4444

4545
PATH
4646
remote: ../../../hyperstack-config
4747
specs:
48-
hyperstack-config (0.1)
48+
hyperstack-config (1.0.alpha1)
4949
libv8 (~> 6.3.0)
5050
listen (~> 3.0)
5151
mini_racer (~> 0.1.15)
@@ -165,7 +165,7 @@ GEM
165165
rails-dom-testing (>= 1, < 3)
166166
railties (>= 4.2.0)
167167
thor (>= 0.14, < 2.0)
168-
libv8 (6.3.292.48.1)
168+
libv8 (6.3.292.48.1-x86_64-darwin-15)
169169
listen (3.1.5)
170170
rb-fsevent (~> 0.9, >= 0.9.4)
171171
rb-inotify (~> 0.9, >= 0.9.7)

ruby/examples/misc/stock-tickers/app/hyperstack/components/display_ticker.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
class DisplayTicker < HyperComponent
22
param :symbol
33
triggers :cancel
4-
before_mount { @ticker = StockTicker.new(@Symbol, 10.seconds) }
4+
before_mount { @_ticker = StockTicker.new(@Symbol, 10.seconds) }
55

66
def status
7-
case @ticker.status
7+
case @_ticker.status
88
when :loading
99
BS::Col(sm: 10) { 'loading...' }
1010
when :success
1111
BS::Col(class: 'text-right', sm: 3) { 'price' }
12-
BS::Col(class: 'text-right', sm: 3) { '%.2f' % @ticker.price }
13-
BS::Col(sm: 4) { "at #{@ticker.time.strftime('%I:%M:%S')}" }
12+
BS::Col(class: 'text-right', sm: 3) { '%.2f' % @_ticker.price }
13+
BS::Col(sm: 4) { "at #{@_ticker.time.strftime('%I:%M:%S')}" }
1414
when :failed
15-
BS::Col(sm: 10) { "failed to get quote: #{@ticker.reason}" }
15+
BS::Col(sm: 10) { "failed to get quote: #{@_ticker.reason}" }
1616
end
1717
end
1818

@@ -22,7 +22,7 @@ def status
2222
status
2323
BS::Col(sm: 1) do
2424
BS::Button(class: :close) { "\u00D7" }
25-
.on(:click) { cancel! } unless @ticker.status == :loading
25+
.on(:click) { cancel! } unless @_ticker.status == :loading
2626
end
2727
end
2828
end

ruby/examples/misc/stock-tickers/app/hyperstack/components/hyper_component.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# def Hyperstack.naming_convention
2+
# :prefix_params
3+
# end
4+
15
class HyperComponent
26
include Hyperstack::Component
37
include Hyperstack::State::Observable

ruby/hyper-component/Gemfile.lock

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ../hyper-spec
33
specs:
4-
hyper-spec (0.1)
4+
hyper-spec (1.0.alpha1)
55
capybara
66
chromedriver-helper (= 1.2.0)
77
libv8 (~> 6.3.0)
@@ -20,22 +20,22 @@ PATH
2020
PATH
2121
remote: ../hyper-state
2222
specs:
23-
hyper-state (0.1)
24-
hyperstack-config (= 0.1)
23+
hyper-state (1.0.alpha1)
24+
hyperstack-config (= 1.0.alpha1)
2525
opal (>= 0.11.0, < 0.12.0)
2626

2727
PATH
2828
remote: ../hyper-store
2929
specs:
30-
hyper-store (0.1)
31-
hyper-state (= 0.1)
32-
hyperstack-config (= 0.1)
30+
hyper-store (1.0.alpha1)
31+
hyper-state (= 1.0.alpha1)
32+
hyperstack-config (= 1.0.alpha1)
3333
opal (>= 0.11.0, < 0.12.0)
3434

3535
PATH
3636
remote: ../hyperstack-config
3737
specs:
38-
hyperstack-config (0.1)
38+
hyperstack-config (1.0.alpha1)
3939
libv8 (~> 6.3.0)
4040
listen (~> 3.0)
4141
mini_racer (~> 0.1.15)
@@ -47,9 +47,9 @@ PATH
4747
PATH
4848
remote: .
4949
specs:
50-
hyper-component (0.1)
51-
hyper-state (= 0.1)
52-
hyperstack-config (= 0.1)
50+
hyper-component (1.0.alpha1)
51+
hyper-state (= 1.0.alpha1)
52+
hyperstack-config (= 1.0.alpha1)
5353
libv8 (~> 6.3.0)
5454
mini_racer (~> 0.1.15)
5555
opal (>= 0.11.0, < 0.12.0)
@@ -115,13 +115,14 @@ GEM
115115
babel-source (>= 4.0, < 6)
116116
execjs (~> 2.0)
117117
builder (3.2.3)
118-
capybara (3.9.0)
118+
capybara (3.10.1)
119119
addressable
120120
mini_mime (>= 0.1.3)
121121
nokogiri (~> 1.8)
122122
rack (>= 1.6.0)
123123
rack-test (>= 0.6.3)
124-
xpath (~> 3.1)
124+
regexp_parser (~> 1.2)
125+
xpath (~> 3.2)
125126
childprocess (0.9.0)
126127
ffi (~> 1.0, >= 1.0.11)
127128
chromedriver-helper (1.2.0)
@@ -151,7 +152,7 @@ GEM
151152
rails-dom-testing (>= 1, < 3)
152153
railties (>= 4.2.0)
153154
thor (>= 0.14, < 2.0)
154-
libv8 (6.3.292.48.1)
155+
libv8 (6.3.292.48.1-x86_64-darwin-15)
155156
listen (3.1.5)
156157
rb-fsevent (~> 0.9, >= 0.9.4)
157158
rb-inotify (~> 0.9, >= 0.9.7)
@@ -261,6 +262,7 @@ GEM
261262
execjs
262263
railties (>= 3.2)
263264
tilt
265+
regexp_parser (1.2.0)
264266
rspec-core (3.8.0)
265267
rspec-support (~> 3.8.0)
266268
rspec-expectations (3.8.2)
@@ -288,7 +290,7 @@ GEM
288290
ruby-progressbar (1.10.0)
289291
ruby_dep (1.5.0)
290292
rubyzip (1.2.2)
291-
selenium-webdriver (3.14.1)
293+
selenium-webdriver (3.141.0)
292294
childprocess (~> 0.5)
293295
rubyzip (~> 1.2, >= 1.2.2)
294296
sourcemap (0.1.1)

ruby/hyper-component/lib/hyperstack/component.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ def self.included(base)
3030
base.extend(Hyperstack::Internal::Component::ClassMethods)
3131
end
3232

33+
def self.mounted_components
34+
@__hyperstack_component_mounted_components ||= Set.new
35+
end
36+
3337
def self.force_update!
34-
components = Hyperstack::Internal::Component.mounted_components.to_a
38+
components = mounted_components.to_a # need a copy as force_update may change the list
3539
components.each do |comp|
36-
next unless Hyperstack::Internal::Component.mounted_components.include? comp
40+
# check if its still mounted
41+
next unless mounted_components.include? comp
3742
comp.force_update!
3843
end
3944
end
@@ -62,7 +67,7 @@ def component_will_mount
6267
@__hyperstack_component_params_wrapper = self.class.props_wrapper.new(self)
6368
IsomorphicHelpers.load_context(true) if IsomorphicHelpers.on_opal_client?
6469
observing(immediate_update: true) do
65-
Hyperstack::Internal::Component.mounted_components << self
70+
Hyperstack::Component.mounted_components << self
6671
run_callback(:before_mount, props)
6772
end
6873
end
@@ -96,7 +101,7 @@ def component_will_unmount
96101
observing do
97102
unmount # runs unmount callbacks as well
98103
remove
99-
Hyperstack::Internal::Component.mounted_components.delete self
104+
Hyperstack::Component.mounted_components.delete self
100105
end
101106
end
102107

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module Component
3-
VERSION = '0.1'
3+
VERSION = '1.0.alpha1.1' # '1.0.alpha1.1'
44
end
55
end

ruby/hyper-component/lib/hyperstack/internal/component.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,4 @@ module Hyperstack
44

55
define_setting :prerendering, :off if RUBY_ENGINE != 'opal'
66

7-
module Internal
8-
module Component
9-
class << self
10-
def mounted_components
11-
@__hyperstack_component_mounted_components ||= Set.new
12-
end
13-
end
14-
end
15-
end
167
end

0 commit comments

Comments
 (0)