catmando on noreset
initial commit refactoring now (compare)
barriehadfield on edge
Hyperloop point to master for JS (compare)
barriehadfield on edge
Hyperloop 0.99.1 (compare)
catmando on edge
got tests passing again Gemfiles point to released gems (compare)
catmando on edge
closes #19 closes #20 Merge branch 'edge' of github.c… resolved gemspec merge conflict (compare)
barriehadfield on edge
Update README.md (compare)
barriehadfield on edge
Update README.md (compare)
johansmitsnl on edge
Move the libv8 to running depen… Remove webdriver Remove empty helper (compare)
johansmitsnl on edge
johansmitsnl on edge
Download and install the chrome… (compare)
johansmitsnl on edge
Remove the find for the webdriv… (compare)
johansmitsnl on edge
Include the database schema (compare)
johansmitsnl on edge
Use find to locate the webdriver Don't set the path directly (compare)
johansmitsnl on edge
Update the gemfile.lock (compare)
Hi there!
I have a question. Why do you use this ugly syntax:
class HelloWorld < HyperComponent
render(DIV) do
# try changing 'world' to your own name
H1 { 'Hello world' }
P(class: 'green-text') { "Let's gets started!" }
end
end
instead of:
class HelloWorld < HyperComponent
render(div) do
# try changing 'world' to your own name
h1 { 'Hello world' }
p(class: 'green-text') { "Let's gets started!" }
end
end
CONSTANTS
and it feels strange, very strange because CONSTANTS
they are made to be always the same. But in Hyperstack it has a method. If the only things that maters here is the color to see quickly what is what, you can install a plugin in your editor to recognize the framework/language you use and change the color in that context.
MyComponent(...)
is shorthand for MyComponent.insert(...)
And the second question I have is why you are passing a DIV
to render
?
class HelloWorld < HyperComponent
render(DIV) do
# try changing 'world' to your own name
H1 { 'Hello world' }
P(class: 'green-text') { "Let's gets started!" }
end
end
maybe it would be better:
class HelloWorld < HyperComponent
render do
div do
# try changing 'world' to your own name
h1 { 'Hello world' }
p(class: 'green-text') { "Let's gets started!" }
end
end
end
class HelloWorld < HyperComponent
render(DIV) do
# try changing 'world' to your own name
H1 { 'Hello world' }
P(class: 'green-text') { "Let's gets started!" }
end
end
instead of
class HelloWorld < HyperComponent
DIV do
# try changing 'world' to your own name
H1 { 'Hello world' }
P(class: 'green-text') { "Let's gets started!" }
end
end
well if you want to try it, this patch seems to work... no specs yet, but:
# add to your HyperComponent base class
class << self
alias :my_original_meth_missing method_missing
def method_missing(name, *args, &block)
if const_defined?(name) &&
(klass = const_get(name)) &&
((klass.is_a?(Class) && klass.method_defined?(:render)) ||
Hyperstack::Internal::Component::Tags::HTML_TAGS.include?(klass))
render(klass, *args, &block)
else
my_original_meth_missing(name, *args, &block)
end
end
end
class HelloWorld < HyperComponent
H1 { 'Hello world' }
P(class: 'green-text') { "Let's gets started!" }
end
@peterlamber sometimes you don’t want to render a div, sometimes it needs to be another component or HTML element. A perfect example is button
which is likely to be a component (Button) or an HTML tag (BUTTON or button). For this reason, HTML tags in CAPS make sense. And actually, I have got used to them. You're right, H1
is better than h1
to read and DIV
or SPAN
look like tags whereas their lowercase cousins do not.
The bit I have a hump with is the conversion of param
s from snake_case to CamelCase. I don't like it for the following reasons:
param :my_special_thing
to @MySpecialThing which is unnecessary considering the point aboveattr_reader
where the instance variable is not converted, but available in the class as @my_special_thing
So basically, I don't see that we get the advantage (the immutable rule does not hold), but we get the negatives .
My vote is just that the default be rfeversed: param :my_special_thign
becomes @my_special_thing
and if you want to change it you opt for the behaviour where it becomes @MySpecialThing
Anyway, that's what I think. I will go with whatever is decided.
@my_special_thing
which is just going to mess you up when the param gets asyncrounosuly updated.param :fuel_pump_on, aka: :fuel_pump_on?